/* =========================================
   Music Manager 统一设计系统
   所有页面共享的 CSS 变量和组件样式
   ========================================= */

/* Light theme (default) */
:root, [data-theme="light"] {
    --bg: #f0f2f5;
    --bg-card: #ffffff;
    --bg-hover: #f5f7fa;
    --text: #1a1a2e;
    --text-secondary: #4a4a6a;
    --muted: #8888a0;
    --accent: #5b5ef4;
    --accent-hover: #4a4ae0;
    --accent-glow: rgba(91,94,244,0.15);
    --border: #e2e4ea;
    --border-card: #f0f2f5;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --radio-talk: #f59e0b;
    --sidebar: #1a1a2e;
    --sidebar-text: #8888aa;
    --sidebar-active: #ffffff;
    --sidebar-bg: #12122a;
    --sidebar-width: 240px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

/* Dark theme */
[data-theme="dark"], .theme-dark {
    --bg: #0a0a0a;
    --bg-card: #1a1a1a;
    --bg-hover: #222222;
    --text: #f5f5f5;
    --text-secondary: #a3a3a3;
    --muted: #6b6b6b;
    --accent: #f97316;
    --accent-hover: #ea580c;
    --accent-glow: rgba(249,115,22,0.2);
    --border: #2a2a2a;
    --border-card: #222222;
    --success: #22c55e;
    --warning: #fbbf24;
    --danger: #ef4444;
    --radio-talk: #f59e0b;
    --sidebar: #000000;
    --sidebar-text: #6b6b6b;
    --sidebar-active: #f5f5f5;
    --sidebar-bg: #0a0a0a;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.5);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.6);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.5);
}

/* ===== Utility 类 (替换 JS 里重复出现的 inline style) ===== */
.flex-fill { flex: 1; min-width: 0; }
.txt-mute { color: var(--muted); }
.txt-mute-sm { font-size: 11px; color: var(--muted); }
.txt-mute-xs { font-size: 12px; color: var(--muted); }
.txt-mute-xs-norm { font-size: 12px; color: var(--muted); font-weight: normal; }
.txt-danger { color: var(--danger); }
.txt-accent { color: var(--accent); }
.row-between { display: flex; justify-content: space-between; align-items: center; }
.txt-ellipsis { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-base { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 16px; }
.input-base { padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-card); color: var(--text); font-size: 13px; }
.input-base-lg { width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 8px; color: var(--text); font-size: 13px; }
.btn-icon-sm { border: none; background: none; cursor: pointer; font-size: 12px; color: var(--muted); padding: 4px; }
.btn-icon-sm-md { border: none; background: none; cursor: pointer; font-size: 14px; color: var(--muted); }
.radio-cal-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    margin: 3px auto 0;
}
.radio-cal-dot-lg {
    display: inline-block;
    width: 10px;
    height: 10px;
    vertical-align: middle;
    margin-right: 4px;
}
.empty-state-box { text-align: center; padding: 20px; color: var(--muted); }
.empty-state-lg { text-align: center; padding: 40px; color: var(--muted); }

/* 全局重置 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    /* iOS Safari: 用 100dvh 跟随地址栏收缩/展开, 避免页面跳动 */
    min-height: 100dvh;
    /* 2026-06-16: 不在 body 上加 safe-area padding
       之前加 padding-left/right env(safe-area-inset-*) 导致 PWA 竖屏也产生 47px 左边距
       (某些 iOS 17+ 设备的 PWA 即使竖屏也报 safe-area-inset-left>0)
       改方案: 各页面/容器自己处理 safe-area (.topbar / .mobile-nav 已自带)
       PWA 主屏/全屏: env() 应该是 0, 不需要 body padding */
    padding: 0;
    margin: 0;
}

/* 布局 */
.app-layout { display: flex; min-height: 100vh; align-items: stretch; min-height: 100dvh; }

/* 侧边栏 */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar);
    padding: 0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-self: stretch;
    height: auto;
    min-height: 100vh;
    min-height: 100dvh;
}
.sidebar-brand {
    padding: 24px 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 12px;
    color: var(--sidebar-active);
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.03) 60%, transparent 100%);
    box-shadow: 0 4px 12px rgba(0,0,0,0.25), inset 0 -1px 0 rgba(0,0,0,0.2);
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
    border-top: 1px solid rgba(255,255,255,0.05);
}
.sidebar-brand small {
    display: block;
    font-size: 11px;
    color: var(--sidebar-text);
    font-weight: 400;
    margin-top: 2px;
}
.sidebar-nav { flex: 1; padding: 10px 0; overflow-y: auto; }

/* 导航项 */
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    margin: 2px 8px;
    border-radius: 10px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 13px;
    /* 2026-06-17 19:30: nav-icon SVG 对齐 */
}
.nav-item .nav-icon, .nav-item .admin-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.nav-item .nav-icon svg, .nav-item .admin-arrow svg {
    display: block;
}
.mobile-nav-item .nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}
.mobile-nav-item .nav-icon svg {
    display: block;
}
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
.nav-item:hover {
    background: var(--sidebar-bg);
    color: var(--sidebar-active);
    transform: translateX(3px);
}
.nav-item.active {
    background: var(--sidebar-bg);
    color: var(--sidebar-active);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--accent), 0 2px 8px rgba(0,0,0,0.15);
}
.nav-divider {
    padding: 8px 20px;
    font-size: 11px;
    color: var(--sidebar-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 5px;
}

/* 主内容区 */
.main-content {
    flex: 1;
    padding: 30px;
    max-width: calc(100vw - var(--sidebar-width));
    overflow-x: hidden;
    background: var(--bg);
}

/* 页面显示 */
.page { display: none; }
.page.active { display: block; background: var(--bg); min-height: 200px; }
.page h2 { font-size: inherit; }

.raw-sub-page { display: none; }
.raw-sub-page.active { display: block; }

/* 头部 */
.content-header { margin-bottom: 24px; }
.content-header h2 { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.content-header p { color: var(--muted); font-size: 14px; }

/* 搜索栏 */
.search-bar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.search-bar input {
    flex: 1; min-width: 200px; max-width: 400px;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    font-size: 14px;
}
.search-bar input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0,113,227,0.15);
}

/* 统计卡片 */
.stats-bar { display: flex; gap: 20px; margin-bottom: 24px; }
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 24px;
    flex: 1;
}
.stat-card .num { font-size: 28px; font-weight: 700; }
.stat-card .label { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
    font-family: inherit;
}
.btn:hover { background: #e8e8ed; }
.btn-primary { background: var(--accent); color: white; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-success { background: var(--success); color: white; border-color: var(--success); }
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 卡片 */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}
.card-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; }

/* 表单 */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 10px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(0,113,227,0.15);
}
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }

/* 上传区 */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 50px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--bg-card);
}
.upload-zone:hover {
    border-color: var(--accent);
    background: rgba(0,113,227,0.03);
}
.upload-zone.dragover {
    border-color: var(--accent);
    background: rgba(0,113,227,0.08);
}
.upload-zone h3 { color: var(--muted); font-weight: normal; margin-bottom: 8px; }

/* 徽章 */
.badge {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    display: inline-block;
}
.badge-pending { background: rgba(255,159,10,0.15); color: var(--warning); }
.badge-split { background: rgba(48,209,88,0.15); color: var(--success); }
.badge-error { background: rgba(255,69,58,0.15); color: var(--danger); }

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal.active { display: flex; }
.modal-content {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--muted); }
.modal-close:hover { color: var(--text); }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--border); }

/* Tab */
.tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab { padding: 10px 20px; cursor: pointer; color: var(--muted); font-size: 14px; transition: all 0.15s; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom: 2px solid var(--accent); margin-bottom: -2px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; padding: 10px 12px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--border); font-weight: 500; }
td { padding: 10px 12px; font-size: 13px; border-bottom: 1px solid var(--border); }
tr:hover td { background: rgba(0,0,0,0.02); }

/* 空状态 */
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty-state h3 { font-weight: normal; margin-bottom: 8px; }

/* 标签输入 */
.tag-input-wrap { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); min-height: 42px; align-items: center; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; background: var(--accent); color: white; border-radius: 4px; font-size: 12px; }
.tag .remove { cursor: pointer; font-size: 14px; line-height: 1; }
.tag-input { border: none; background: transparent; outline: none; font-size: 13px; min-width: 80px; flex: 1; color: var(--text); }

/* 进度条 */
.progress-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-bar .fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.3s; }


/* =========================================
   移动端元素桌面端隐藏
   ========================================= */
.hamburger-btn { display: none; }  /* v3.2.93: 去掉 !important, 桌面端由 @media (min-width: 1025px) 用 !important 隐藏 */
.sidebar-overlay { display: none; }  /* 移动端由@media控制 */
.mobile-nav { display: none; }
#mobile-more-panel { display: none; }
/* v3.2.91: 取消 mobile-header display 的 !important
   因为 desktop 1025 块需要 !important 隐藏它, default 用 !important 会跟它 cascade 冲突 */
.mobile-header {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; right: 0;
    /* v3.2.93x: padding-top 44px, inner 32, hamburger 绝对定位 40x40 独立于 inner */
    padding-top: 44px;
    background: var(--sidebar);
    z-index: 99999;
    border-bottom: 1px solid #38383a;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.mobile-header-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    position: relative;
}
.hamburger-btn {
    display: flex;
    position: absolute;
    left: 6px;
    top: 47px;
    z-index: 100000;
    width: 40px; height: 40px;
    background: transparent;
    color: white;
    border: none;
    font-size: 22px;
    font-family: inherit;
    padding: 0;
    margin: 0;
    align-items: center; justify-content: center;
    cursor: pointer;
}
.mobile-header-title {
    color: var(--sidebar-active);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
@media (min-width: 1025px) {
    .mobile-header { display: none !important; }
    .hamburger-btn { display: none !important; }
}

/* 全屏播放器 - 移动端点击播放器条展开 */
.player-fullscreen { display: none; }

/* 响应式 - 多分辨率适配 */
@media (max-width: 1024px) {
    /* v3.2.93y: 移到 1024 块 (之前在 768 块, 16e 横屏 852 宽不匹配) */
    .player-fullscreen.active { display: flex !important; }
    /* v3.2.93za: 全屏视觉规则 (bg, ::before, padding) 从 768 块挪到 1024 块 */
    .player-fullscreen {
        display: none;
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        z-index: 100000;
        background-color: #0f0f1e;
        background-image: linear-gradient(180deg, #1a1a2e 0%, #0f0f1e 100%);
        background-size: cover;
        background-position: center;
        flex-direction: column;
        padding: 0 20px 20px;
        padding-top: max(47px, env(safe-area-inset-top, 0px));
        padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
        animation: fsSlideUp 0.25s ease;
        overflow: hidden;
    }
    .player-fullscreen::before {
        content: '';
        position: absolute;
        top: 0; left: 0; right: 0; bottom: 0;
        background-image: inherit;
        background-size: cover;
        background-position: center;
        filter: blur(40px) brightness(0.35) saturate(1.4);
        z-index: -1;
    }
    :root {
        --sidebar-width: 0px;
        /* 底部 mobile-nav 实际占位高度: 50px + iPhone home indicator safe-area
           (landscape 覆盖为 44px) 平板/大屏手机横屏也能用到，避免 player-bar 被压住 */
        --mobile-nav-height: calc(50px + env(safe-area-inset-bottom, 0px));
    }
    .sidebar { display: none !important; }
    .main-content {
        margin-left: 0 !important;
        max-width: 100vw !important;
        /* 底部 padding 跟随 mobile-nav 真实高度 (比手机 70px 多 20px 间距) */
        padding-bottom: calc(20px + var(--mobile-nav-height, 50px)) !important;
    }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .form-row-4 { grid-template-columns: repeat(2, 1fr); }
    /* 专辑网格缩小 */
    .album-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
    /* 歌手字母栏 */
    .artist-letter-bar { gap: 4px; }
    .letter-item { min-width: 28px; height: 28px; font-size: 12px; }
    /* ===== 底部导航 (平板/手机都显示) ===== */
    .mobile-nav {
        display: flex !important;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        height: 50px;
        background: var(--sidebar);
        z-index: 949;
        border-top: 1px solid #38383a;
    }
    /* iPhone home indicator: 用 padding-bottom 撑出 safe-area 高度
       为了避免 icon 被压到顶部, 同时把 .mobile-nav-item 的 padding-bottom 调为 0
       让内容平铺到容器底部 (padding-bottom 仅包含 safe-area) */
    .mobile-nav {
        min-height: calc(50px + env(safe-area-inset-bottom, 0px));
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    .mobile-nav-item {
        /* 覆盖上面定义的 padding: 4px 2px, 去掉 padding-bottom 让内容靠下 */
        padding: 4px 2px 0 2px;
    }
    .mobile-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        color: var(--sidebar-text);
        font-size: 9px;
        cursor: pointer;
        transition: color 0.15s;
        padding: 4px 2px;
    }
    .mobile-nav-item.active, .mobile-nav-item:hover { color: var(--sidebar-active); }
    .mobile-nav-item span:first-child { font-size: 18px; }
    /* ===== 移动端 player-bar bottom 跟随 mobile-nav 高度 ===== */
    #player-bar {
        bottom: 0;
        padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
        z-index: 960;
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1000;
    }
    .sidebar-overlay.active { display: block; }

    /* 移动端侧边栏（滑出） */
    .sidebar {
        display: block !important;
        position: fixed;
        top: 0; left: -260px;
        width: 260px;
        height: 100vh;
        height: 100dvh;
        z-index: 1001;
        transition: left 0.25s ease;
        box-shadow: 3px 0 20px rgba(0,0,0,0.3);
        overflow: hidden;
    }
    .sidebar.open { left: 0; }
    .sidebar-brand { position: relative; z-index: 2; }
    /* iOS Safari 关键: sidebar-nav 独立 fixed 定位, 脱离 sidebar 的层叠上下文
       这是 iOS 上 drawer 滚动的标准模式 */
    .sidebar-nav {
        position: fixed;
        top: 75px;
        left: -260px;  /* 默认隐藏 */
        width: 260px;
        height: calc(100vh - 75px);
        height: calc(100dvh - 75px);
        padding: 10px 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        transition: left 0.25s ease;
        z-index: 1000;
    }
    .sidebar.open .sidebar-nav {
        left: 0;  /* 跟着 sidebar 同步滑出 */
    }

    .main-content { padding-top: 58px; }

    /* ===== 歌曲列表移动端优化 ===== */
    .track-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .track-table-wrap table { min-width: 500px; }
    .track-table-wrap table .track-row td:first-child { padding-left: 8px; }
    .track-table-wrap table .track-row td:last-child { padding-right: 8px; }

    /* ===== 专辑网格移动端 ===== */
    .album-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
    .album-grid .album-card .cover { font-size: 32px; }
    .album-grid .album-card .info { padding: 8px; }
    .album-grid .album-card h4 { font-size: 12px; }
    .album-grid .album-card p { font-size: 10px; }

    /* ===== 内容区块移动端 ===== */
    .content-header { padding: 12px 0 8px; }
    .content-header h2 { font-size: 18px; }
    .content-header p { font-size: 12px; }
    .section-header h2 { font-size: 15px; }
    .stat-card .stat-value { font-size: 22px; }
    .stat-card .stat-label { font-size: 11px; }
}

@media (max-width: 768px) {
    :root {
        /* --sidebar-width / --mobile-nav-height 已在 1024px 媒体查询中定义 */
        /* v3.2.93zd: 竖屏 player-bar 高度 */
        --player-bar-height: 64px;
    }
    .sidebar { display: none; }  /* v3.2.93: 去掉 !important, 1024 块用 !important 显示 (mobile drawer 可见) */
    .main-content {
        padding: 12px 10px calc(20px + var(--mobile-nav-height, 50px)) !important;
        max-width: 100vw !important;
        margin-left: 0 !important;
    }
    .form-row, .form-row-3, .form-row-4 { grid-template-columns: 1fr; }

    /* 统计卡片: 3 个挤一行会超宽, 改 grid 3 列 + 缩小 padding
       (在文件末尾有 !important 兑底) */

    /* ===== 播放器适配 ===== */
    #player-bar {
        left: 0;
        right: 0;
        /* bottom 由 1024px 媒体查询设置, 这里只补 width/size */
        /* v3.2.93zd: 统一 --player-bar-height, 竖屏 64 / 横屏 48 独立设 */
        height: var(--player-bar-height, 64px);
        max-height: var(--player-bar-height, 64px);
        overflow: hidden;
        z-index: 960;
        padding: 6px 12px;
        cursor: pointer;  /* 移动端: 点击展开全屏 */
    }
    #player-bar.active {
        display: flex;
    }
    #player-bar.active ~ .mobile-nav {
        display: none !important;
    }
    /* v4.2.1 20:10: mini 模式由 JS 在 toggleMiniPlayer 去掉 player-bar 的 active class
       (CSS ID 选择器 specificity 高, !important 拼不过, JS 移除更稳) */
    /* 移动端: 隐藏桌面播放器条里的次要按钮 (歌词/模式/懒人/队列) */
    #player-lyrics-btn, #player-mode-btn, #player-lazy-btn, #queue-toggle-btn {
        display: none !important;
    }
    /* 移动端: 播放器条进度条与控制布局紧凑 */
    #player-bar #player-volume { display: none !important; }
    #player-bar #player-time { font-size: 10px !important; }
    /* 移动端: 封面背景象灮 (大版式留个骨欢) */
    #player-bar #player-cover-thumb { display: none !important; }

    /* 下拉关闭动画: 全屏跟随手指下移 */
    .player-fullscreen.dragging {
        transition: none !important;
    }
    .player-fullscreen.dragging::after {
        content: '↓ 松手关闭';
        position: absolute;
        top: 80px;
        left: 0; right: 0;
        text-align: center;
        color: rgba(255,255,255,0.7);
        font-size: 13px;
        pointer-events: none;
    }
    #mobile-more-panel.active, #mobile-more-panel[style*="display: block"] { display: block !important; }
    @keyframes fsSlideUp {
        from { transform: translateY(100%); opacity: 0; }
        to { transform: translateY(0); opacity: 1; }
    }
    .pf-close {
        background: none; border: none;
        color: rgba(255,255,255,0.85);
        font-size: 32px; font-weight: 300;
        cursor: pointer;
        padding: 8px 16px;
        line-height: 1;
        flex-shrink: 0;
    }
    .pf-close:active { opacity: 0.6; }
    .pf-mode-btn {
        background: none; border: none;
        color: rgba(255,255,255,0.7);
        cursor: pointer;
        padding: 8px 16px;
        flex-shrink: 0;
        display: flex; align-items: center; justify-content: center;
    }
    .pf-mode-btn:active { opacity: 0.6; }
    .pf-title-wrap {
        flex: 1; min-width: 0;
        display: flex; align-items: center; justify-content: center;
        overflow: hidden;
    }
    .pf-title-mini {
        font-size: 14px;
        color: rgba(255,255,255,0.6);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }
    #pf-header {
        display: flex; align-items: center; justify-content: space-between;
        min-height: 48px;
        padding: 0 4px;
    }
    .pf-cover {
        flex: 1;
        display: flex; align-items: flex-start; justify-content: center;
        min-height: 180px;
        margin: 8px 0 0;
        padding-top: 4px;
    }
    .pf-cover-inner {
        width: min(80vw, 320px);
        aspect-ratio: 1;
        background: linear-gradient(135deg, #2a2a4e 0%, #1a1a2e 100%);
        border-radius: 50%;          /* 圆形黑胶 */
        display: flex; align-items: center; justify-content: center;
        font-size: 80px;
        box-shadow: 0 20px 60px rgba(0,0,0,0.5);
        overflow: hidden;
        position: relative;
    }
    .pf-cover-inner img {
        width: 100%; height: 100%;
        border-radius: 50%;
        object-fit: cover;
        animation: coverSpin 12s linear infinite;
        animation-play-state: paused;
    }
    .pf-cover-inner.playing img {
        animation-play-state: running;
    }
    /* 黑胶中心点 */
    .pf-cover-inner::after {
        content: '';
        position: absolute;
        width: 16%;
        aspect-ratio: 1;
        background: #0f0f1e;
        border: 2px solid rgba(255,255,255,0.15);
        border-radius: 50%;
        z-index: 2;
    }
    @keyframes coverSpin {
        from { transform: rotate(0deg); }
        to   { transform: rotate(360deg); }
    }
    .pf-info { text-align: center; color: white; margin-bottom: 16px; }
    .pf-info .pf-title { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
    .pf-info .pf-artist { font-size: 14px; color: rgba(255,255,255,0.6); }
    .pf-progress { margin-bottom: 20px; }
    .pf-progress input[type=range] { width: 100%; height: 4px; accent-color: var(--accent); cursor: pointer; }
    .pf-time { display: flex; justify-content: space-between; color: rgba(255,255,255,0.5); font-size: 11px; margin-top: 4px; }
    .pf-controls { display: flex; justify-content: center; align-items: center; gap: 40px; margin-bottom: 16px; }
    .pf-btn {
        background: none; border: none; color: white;
        font-size: 32px; cursor: pointer;
        width: 64px; height: 64px;
        display: flex; align-items: center; justify-content: center;
    }
    .pf-btn.play { font-size: 40px; background: var(--accent); border-radius: 50%; width: 72px; height: 72px; }
    .pf-play-btn { background: var(--accent); border-radius: 50%; width: 72px; height: 72px; color: white; font-size: 24px; border: none; cursor: pointer; }
    .pf-btn:active { transform: scale(0.92); }
    /* 歌词样式 (在 pf-cover-wrap 里) */
    #pf-lyrics-display {
        text-align:center;
        font-size:14px;
        line-height:2.2;
        color:rgba(255,255,255,0.5);
        padding:20px;
        max-height:100%;
        overflow-y:auto;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
    #pf-lyrics-display span {
        display: block;
        padding: 4px 0;
        transition: all 0.3s ease;
    }
    #pf-lyrics-display span.active {
        color: var(--accent);
        font-size: 18px;
        font-weight: 600;
    }
    /* section tag ([Verse] [Chorus]) — 小灰字分隔 */
    #pf-lyrics-display span.section-tag {
        font-size: 11px;
        color: rgba(255,255,255,0.3);
        font-style: italic;
        margin: 16px 0 4px;
        letter-spacing: 1px;
    }
/* 全屏内第二排工具栏 (队列/收藏/音量) */
    .pf-extras {
        display: flex; align-items: center; justify-content: space-around;
        margin-bottom: 0;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        color: rgba(255,255,255,0.7);
    }
    .pf-extras button {
        background: none; border: none; color: inherit;
        cursor: pointer; padding: 8px;
        display: flex; align-items: center; gap: 4px;
        font-size: 13px;
    }
    .pf-extras button.active { color: var(--accent); }
    .pf-extras input[type=range] {
        /* 全屏音量滑块: 加高到 24px 让手指能拖到; touch-action: manipulation 不干预原生 slider 拖动, 又能避免双击缩放 */
        width: 90px; height: 24px;
        accent-color: var(--accent);
        touch-action: manipulation;
    }
    .pf-extras #pf-volume-icon {
        /* 取消 cursor:default, 让他看起来像可点按钮 */
        cursor: pointer !important;
    }
    .pf-extras #pf-volume-icon.muted { color: var(--muted); }
    /* 进度条拖动气泡 */
    .pf-seek-wrap { position: relative; }
    #pf-seek-bubble {
        position: absolute;
        bottom: 24px;
        transform: translateX(-50%);
        background: rgba(0,0,0,0.85);
        color: #fff;
        padding: 4px 8px;
        border-radius: 6px;
        font-size: 11px;
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.15s;
    }
    #pf-seek-bubble.visible { opacity: 1; }
    #player-lyrics-panel {
        left: auto; right: 8px;
        width: 300px; bottom: 118px;
    }
    #player-queue-panel {
        left: 8px; right: auto;
        width: 320px; bottom: 118px;
    }


@media (min-width: 1025px) {
    .mobile-header { display: none !important; }
    .hamburger-btn { display: none !important; }
}

}

/* ===== 横屏 / 大屏手机适配 ===== */
/* v4.1.2 01:50: mini 模式时 mobile-nav 隐藏 (跟 player-bar 互斥)
   避免 "点了 mini 按钮只看到 nav" 误以为 mini 没生效
   跟 #player-bar.active ~ .mobile-nav { display:none } 互补:
   - player-bar active: nav 隐藏 (因为 bar 在底部占位)
   - mini 模式: nav 隐藏 (因为 mini 是 player 的 mini 形态, 不需要 nav) */
body.player-mini-mode ~ .mobile-nav,
body.player-mini-mode .mobile-nav { display: none !important; }

@media (max-width: 1024px) and (orientation: landscape) {
    :root {
        /* 横屏: mobile-nav 紧凑高度 44px */
        --mobile-nav-height: calc(44px + env(safe-area-inset-bottom, 0px));
        /* v3.2.93ze: 横屏 48 -> 64px 跟竖屏一致 */
        --player-bar-height: 64px;
    }
    #player-bar {
        height: var(--player-bar-height) !important;
        max-height: var(--player-bar-height) !important;
        padding: 4px 16px !important;
    }
    /* 横屏: 高度 44px (比竖屏 50px 紧凑), home indicator 由 padding-bottom 撑出 */
    .mobile-nav { min-height: calc(44px + env(safe-area-inset-bottom, 0px)); }
    /* 横屏: 刘海在侧, header 顶部不需让位, 压低到 8px */
    .mobile-header { padding-top: 8px !important; }
    /* v3.2.93z: 横屏 hamburger top 47->4px, 跟上 padding-top 8px 配合 */
    .hamburger-btn { top: 4px !important; }
    .mobile-nav-item { font-size: 8px; }
    /* v3.2.93zb: 横屏 player-bar active 隐藏 nav (竖屏 768 块已存在) */
    #player-bar.active ~ .mobile-nav { display: none !important; }
    .mobile-nav-item span:first-child { font-size: 16px; }
    .main-content { padding-bottom: calc(12px + var(--mobile-nav-height, 50px)) !important; }
    .album-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}

/* ===== 小屏手机 (< 480px) ===== */
@media (max-width: 480px) {
    .mobile-nav-item { font-size: 8px; }
    .mobile-nav-item span:first-child { font-size: 16px; }
    .album-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; }
    .album-grid .album-card .info { padding: 6px; }
    .album-grid .album-card h4 { font-size: 11px; }
    #player-bar { padding: 4px 8px !important; }
    .track-table-wrap table { min-width: 400px; }
}

/* 移动端更多菜单项 */
.mobile-more-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}
.mobile-more-item:last-child { border-bottom: none; }
.mobile-more-item:hover { background: var(--bg); }
.mobile-more-item span:first-child { font-size: 16px; }

/* 整轨管理内嵌页面特殊样式 */
.raw-album-layout { flex-direction: column !important; overflow-y: auto; height: auto !important; }
.raw-album-layout .main-content { padding: 0 !important; max-width: 100% !important; flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.raw-album-layout .page { display: none; flex-direction: column; }
.raw-album-layout .page.active { display: flex; flex-direction: column; flex: 1; }

/* 歌单详情头部 */
.pl-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 16px 0;
    flex-wrap: wrap;
}
.pl-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}
.pl-cover-icon {
    width: 44px;
    height: 44px;
    background: var(--bg);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--muted);
}
.pl-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pl-count {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}
.pl-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
}
.pl-header .pl-btn {
    padding: 7px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    border: none;
    white-space: nowrap;
    line-height: 1.4;
}
.pl-btn-primary { background: var(--accent); color: white; }
.pl-btn-secondary { background: var(--bg); border: 1px solid var(--border) !important; color: var(--text); }
.pl-btn-danger { background: var(--danger); color: white; }
.raw-album-layout .content-header { padding: 20px 24px 10px; flex-shrink: 0; }
.raw-album-layout .content-body[data-theme="light"] { background: linear-gradient(135deg, #f8fafc 0%, #eef2f7 40%, #f5f7fa 100%) !important; }


/* ===== 整轨模块补充样式 ===== */
.btn-secondary { background: var(--bg-card); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: #e8e8ed; }

.loading { text-align: center; padding: 40px; color: var(--muted); }
.spinner { display: inline-block; width: 20px; height: 20px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.session-list-item { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; cursor: pointer; transition: all 0.15s; background: var(--bg-card); }
.session-list-item:hover { border-color: var(--accent); background: rgba(0,113,227,0.04); }
.session-list-item .info { flex: 1; min-width: 0; }
.session-list-item .title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-list-item .meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.session-list-item .badge { margin-left: auto; flex-shrink: 0; }

.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.breadcrumb a { color: var(--accent); cursor: pointer; }
.breadcrumb a:hover { text-decoration: underline; }

.form-row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }

/* 音轨表格 */
.tracks-table { width: 100%; border-collapse: collapse; }
.tracks-table th { text-align: left; padding: 10px 12px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--border); background: var(--bg); font-weight: 500; }
.tracks-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
.tracks-table tr:hover td { background: rgba(0,0,0,0.02); }
.track-input { width: 100%; padding: 4px 8px; border: 1px solid var(--border); border-radius: 4px; background: var(--bg); color: var(--text); font-size: 13px; box-sizing: border-box; }
.track-input:focus { border-color: var(--accent); outline: none; }

/* Toast 通知 - 2026-06-14 补回: 历来项目没写过 toast CSS, 76 个 showToast() 都是隐形的
   重写成不依赖 flex / animation 的保险版, 避免某些浏览器/缓存下不出 */
#toast-container {
    position: fixed;
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));  /* 播放器上方, 避开底部安全区 */
    left: 0;
    right: 0;
    z-index: 100200;   /* 高于全屏 100000, 高于队列 fs-mode 100100 */
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}
.toast {
    /* 不靠动画填关键属性, 即便动画出问题也是可见的 */
    background: #1f2937;      /* fallback 色, 跟暗色背景 */
    color: #ffffff;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 10px 16px;
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.4;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
    text-align: center;
    opacity: 1;                /* 明确指定, 不受 keyframe 干扰 */
    transform: none;           /* 明确指定, 不受 keyframe 干扰 */
    max-width: calc(100vw - 32px);
    word-wrap: break-word;
    animation: toastSlideIn 0.2s ease-out;
}
.toast.info    { border-left: 3px solid #3b82f6; background: var(--bg-card, #1f2937); color: var(--text, #ffffff); }
.toast.success { border-left: 3px solid #22c55e; background: var(--bg-card, #1f2937); color: var(--text, #ffffff); }
.toast.error   { border-left: 3px solid #ef4444; background: var(--bg-card, #1f2937); color: var(--text, #ffffff); }
.toast.warning { border-left: 3px solid #fbbf24; background: var(--bg-card, #1f2937); color: var(--text, #ffffff); }
@keyframes toastSlideIn {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 搜索/批处理模态框 */
.search-modal, .batch-modal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); align-items: center; justify-content: center; z-index: 1000; }
.search-modal.active, .batch-modal.active { display: flex; }
.search-modal .modal-content, .batch-modal .modal-content { background: var(--bg-card); border-radius: 12px; padding: 24px; max-width: 700px; width: 90%; max-height: 80vh; overflow-y: auto; }
.search-modal .modal-header, .batch-modal .modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.search-modal .modal-header h3, .batch-modal .modal-header h3 { font-size: 16px; font-weight: 600; }
.search-modal .modal-close, .batch-modal .modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--muted); }

.search-results { max-height: 400px; overflow-y: auto; }
.search-result-item { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; cursor: pointer; transition: all 0.15s; }
.search-result-item:hover { border-color: var(--accent); background: rgba(0,113,227,0.04); }
.search-result-item img { width: 50px; height: 50px; border-radius: 6px; object-fit: cover; }
.search-result-item .info { flex: 1; }
.search-result-item .title { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-item .meta { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.batch-field-row { display: grid; grid-template-columns: 120px 1fr; gap: 10px; align-items: center; margin-bottom: 12px; }
.batch-field-row label { font-size: 13px; color: var(--muted); }
.batch-field-row select, .batch-field-row input { padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; background: var(--bg); color: var(--text); }
.batch-field-row select:focus, .batch-field-row input:focus { border-color: var(--accent); outline: none; }

/* 上传整轨弹窗 */
#upload-raw-modal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); align-items: center; justify-content: center; z-index: 1000; }
#upload-raw-modal.active { display: flex; }
#upload-raw-modal .modal-content { background: var(--bg-card); border-radius: 12px; padding: 24px; max-width: 600px; width: 90%; }
#upload-raw-modal .modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
#upload-raw-modal .modal-header h3 { font-size: 16px; font-weight: 600; }

/* ===== 歌手详情页 ===== */
.artist-detail-header { display: flex; gap: 24px; align-items: flex-end; padding: 24px 0 20px; }
.artist-avatar { width: 160px; height: 160px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 64px; font-weight: 700; color: white; flex-shrink: 0; box-shadow: 0 8px 32px rgba(0,0,0,0.3); overflow: hidden; position: relative; }
.artist-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.artist-avatar span { line-height: 1; }
.artist-header-info { flex: 1; min-width: 0; padding-bottom: 4px; }
.artist-type-label { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 4px; }
.artist-name { font-size: 36px; font-weight: 700; line-height: 1.2; margin: 0 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.artist-meta { font-size: 14px; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.artist-meta .meta-sep { color: var(--border); }
.artist-genres { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.genre-tag { background: var(--bg); border: 1px solid var(--border); border-radius: 20px; padding: 3px 12px; font-size: 12px; color: var(--muted); }
.genre-tag:first-child { background: var(--accent); color: white; border-color: var(--accent); }

.breadcrumb { margin-bottom: 8px; }
.back-btn { color: var(--accent); cursor: pointer; }
.back-btn:hover { text-decoration: underline; }

.section { margin-bottom: 32px; }
.section-header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.section-header h2 { font-size: 20px; font-weight: 600; margin: 0; }
.section-count { background: var(--bg); border: 1px solid var(--border); border-radius: 20px; padding: 1px 10px; font-size: 12px; color: var(--muted); }

/* 歌曲列表 */
.track-list-table { background: var(--bg-card); border-radius: 12px; overflow: hidden; }
.track-list-table table { width: 100%; border-collapse: collapse; }
.track-list-table thead tr { background: var(--bg); border-bottom: 1px solid var(--border); }
.track-list-table th { padding: 10px 16px; text-align: left; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.track-list-table th:nth-child(1) { width: 40px; text-align: center; }
.track-list-table th:nth-child(3) { width: 200px; }
.track-list-table th:nth-child(4) { width: 80px; text-align: right; }
.track-row { border-bottom: 1px solid var(--border); cursor: pointer; }
.track-row:last-child { border-bottom: none; }
.track-row:hover { background: var(--bg-hover, var(--bg)); }

/* table row hover: propagate to cells */

table tr.track-row:hover td { background: var(--bg-hover, var(--bg)); color: inherit; }

[data-theme="dark"] .track-row:hover { background: #222240 !important; color: #ffffff !important; }

[data-theme="dark"] table tr.track-row:hover td { background: #222240 !important; color: #ffffff !important; }

[data-theme="dark"] .track-table-wrap table tbody tr.track-row:hover { background: #222240 !important; color: #ffffff !important; }

[data-theme="dark"] .track-table-wrap table tbody tr.track-row td { background: inherit; color: var(--muted); }
.track-row td { padding: 10px 16px; vertical-align: middle; }
.track-num { text-align: center; color: var(--muted); font-size: 13px; }
.track-info .track-title { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-info .track-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-album { font-size: 13px; color: var(--muted); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-album:hover { color: var(--accent); }
.track-dur { text-align: right; font-size: 13px; color: var(--muted); }

/* 专辑网格 */
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
/* 专辑列表页容器（与 .album-grid 一致） */
.album-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.album-list .album-card { background: var(--bg-card); border-radius: 12px; overflow: hidden; cursor: pointer; transition: all 0.15s; border: 1px solid var(--border); }
.album-list .album-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.12); border-color: var(--accent); }
.album-list .album-card .cover { width: 100%; aspect-ratio: 1; background: var(--bg); overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 40px; }
.album-list .album-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.album-list .album-card .info { padding: 12px; }
.album-list .album-card h4 { font-size: 14px; font-weight: 500; margin: 0 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.album-list .album-card p { font-size: 12px; color: var(--muted); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.album-list .album-card .meta { margin-top: 6px; font-size: 12px; color: var(--muted); }
.album-grid .album-card { background: var(--bg-card); border-radius: 12px; overflow: hidden; cursor: pointer; transition: all 0.15s; border: 1px solid var(--border); }
.album-grid .album-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.12); border-color: var(--accent); }
.album-grid .album-card .cover { width: 100%; aspect-ratio: 1; background: var(--bg); overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 40px; }
.album-grid .album-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.album-grid .album-card .info { padding: 12px; }
.album-grid .album-card h4 { font-size: 14px; font-weight: 500; margin: 0 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.album-grid .album-card p { font-size: 12px; color: var(--muted); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.album-grid .album-card .meta { margin-top: 6px; font-size: 12px; color: var(--muted); }

/* ===== 歌手列表增强 ===== */
.artist-filter-bar { overflow-x: auto; scrollbar-width: none; }
.artist-filter-bar::-webkit-scrollbar { display: none; }
.artist-letter-bar { display: flex; gap: 2px; align-items: center; padding: 4px 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.artist-letter-bar::-webkit-scrollbar { display: none; }
.letter-item { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; transition: all 0.15s; white-space: nowrap; padding: 0 6px; }
.letter-item:hover { background: var(--bg); color: var(--text); }
.letter-item.active { background: var(--accent); color: white; }

.btn-group { display: flex; gap: 4px; }
.btn-group .btn.active { background: var(--accent); color: white; border-color: var(--accent); }

/* 歌手卡片增强 */
.artist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.artist-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 0; cursor: pointer; transition: all 0.2s; overflow: hidden; display: flex; flex-direction: column; }
.artist-card:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.12); border-color: var(--accent); }
.artist-card.large { grid-column: span 2; }
.artist-card.medium { }
.artist-card-avatar { width: 100%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; font-size: 40px; font-weight: 700; color: rgba(255,255,255,0.9); }
.artist-card-body { padding: 12px 14px; flex: 1; }
.artist-card-body h3 { font-size: 14px; font-weight: 600; margin: 0 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.artist-card-body p { font-size: 12px; color: var(--muted); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== 歌手标签列表（圆形） ===== */
/* 2026-06-16: 修复 PWA 左侧大空隙
   原因: 之前 flex-start + 移动端 2 列布局, 卡片小+列固定, 右侧留空看着像"左偏"
   解决: justify-content: center, 内容居中而非左对齐
   PWA 在 iOS 17+ 某些设备 safe-area-inset-left > 0 即便竖屏,
   body 已去掉全局 safe-area padding, 这里兜底让内容看起来居中 */
#artist-list-content {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    padding: 20px 0;
    align-content: flex-start;
    justify-content: center;
}
.artist-tag {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
    overflow: hidden;
    font-size: 20px;
    font-weight: 700;
    color: rgba(255,255,255,0.85);
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.artist-tag:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(0,0,0,0.5);
    z-index: 10;
}
.artist-tag img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.artist-tag span {
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}



/* =========================================
   UI 美化 — 2026-05-21
   ========================================= */

/* 全局过渡 */
* { transition: background-color 0.2s, border-color 0.2s; }

/* 深色模式切换按钮 */
.theme-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px 8px;
    border-radius: 6px;
    color: var(--sidebar-text);
}
.theme-toggle-btn:hover { background: var(--sidebar-bg); }

/* 页面切换动画 */
.page {
    animation: pageFadeIn 0.2s ease-out;
}
@keyframes pageFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 卡片 Hover 效果 */
.album-card:hover, .stat-card:hover, .track-row:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* 播放条升级 */
#player-bar {
    position: fixed;
    bottom: 0;
    left: var(--sidebar-width);
    right: 0;
    height: 72px;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    z-index: 1000;
    display: none;
    align-items: center;
    gap: 16px;
    padding: 0 24px;
}
#player-bar.active { display: flex; }

/* 2026-06-14: 管理员关掉下载 (DOWNLOAD_ENABLED=false) 时, 播放器上下载按钮不该出现
   用 body 属性控制: JS 只 toggle data-download-enabled, CSS 决定是否显
   避开 !important 优先级问题 (CSS !important 会赢 JS style.display='') */
#player-dl-btn,
#pf-download-btn {
    display: none !important;
}
body[data-download-enabled="true"] #player-dl-btn,
body[data-download-enabled="true"] #pf-download-btn {
    display: inline-block !important;
}
#player-bar .player-cover {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--bg);
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}
#player-bar .player-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
#player-bar.playing .player-cover img {
    animation: coverSpin 8s linear infinite;
}
@keyframes coverSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
#player-bar .player-info {
    flex: 1;
    min-width: 0;
}
#player-bar .player-track-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#player-bar .player-artist-name {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#player-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
#player-play-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: white;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px var(--accent-glow);
}
#player-play-btn:hover { background: var(--accent-hover); }
#player-seek {
    width: 180px;
    height: 4px;
    accent-color: var(--accent);
    cursor: pointer;
}
#player-time {
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
    flex-shrink: 0;
}
#player-volume {
    width: 70px;
    height: 4px;
    accent-color: var(--accent);
    cursor: pointer;
}
#player-bar .close-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: var(--muted);
    padding: 4px;
}
#player-bar .close-btn:hover { color: var(--text); }

/* 专辑卡片美化 */
.album-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden;
}
.album-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}
.album-card .album-cover-wrap {
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

/* 歌手圆形标签美化 */
.artist-tag {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.15s;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
}
.artist-tag:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 8px 24px rgba(91,94,244,0.35);
}
.artist-tag img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 按钮美化 */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    box-shadow: var(--shadow-sm);
}
.btn:hover {
    background: var(--bg-hover);
    box-shadow: var(--shadow-md);
}
.btn-primary {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* 统计卡片美化 */
.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-card);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card .num {
    font-size: 32px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
}
.stat-card .label {
    font-size: 13px;
    color: var(--muted);
    margin-top: 6px;
}

/* 搜索栏美化 */
.search-bar input {
    border-radius: var(--radius-md) !important;
    border: 1px solid var(--border) !important;
    background: var(--bg-card) !important;
    color: var(--text) !important;
    box-shadow: var(--shadow-sm);
}
.search-bar input:focus {
    outline: none;
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px var(--accent-glow) !important;
}

/* 加载动画 */
.global-loading {
    position: fixed;
    top: 0; left: 0; right: 0;
    background: var(--accent);
    height: 3px;
    z-index: 9999;
    animation: loadingPulse 1.2s ease-in-out infinite;
}
@keyframes loadingPulse {
    0% { opacity: 1; transform: scaleX(0.3); transform-origin: left; }
    50% { opacity: 1; transform: scaleX(0.7); transform-origin: left; }
    100% { opacity: 0; transform: scaleX(1); transform-origin: left; }
}

/* 空状态插画 */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--muted);
}
.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}
.empty-state p {
    font-size: 14px;
    line-height: 1.6;
}

/* 内容区块头部 */
.content-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}
.content-header p {
    color: var(--muted);
    font-size: 13px;
    margin-top: 4px;
}

/* Tooltip 美化 */
#artist-tooltip {
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-lg) !important;
    color: var(--text) !important;
    padding: 10px 14px !important;
    font-size: 13px !important;
    backdrop-filter: blur(10px);
}

@keyframes lyricScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}




/* Dashboard Tab Styles */





/* Dashboard Colored Tab Styles (using CSS variables - defined below per theme) */

/* Theme-specific sidebar overrides (force .sidebar to read from body.theme-X) */
body.theme-sunset .sidebar { background: var(--sidebar); }
body.theme-ocean .sidebar { background: var(--sidebar); }
body.theme-forest .sidebar { background: var(--sidebar); }
body.theme-lavender .sidebar { background: var(--sidebar); }
body.theme-mono .sidebar { background: var(--sidebar); }
body.theme-default .sidebar { background: var(--sidebar); }

body.theme-default {
    /* --bg-hover 由 JS _applyColorTheme 写到 html inline, 此处不设 */
    --bg:#f0f2f5;--bg-card:#ffffff;--text:#1a1a2e;--text-secondary:#4a4a6a;--muted:#8888a0;--accent:#5b5ef4;--accent-hover:#4a4ae0;--border:#e2e4ea;--sidebar:#1a1a2e;--sidebar-text:#8888aa;--sidebar-active:#ffffff;
    --tab-rec: #d97706; --tab-rec-bg: rgba(245,158,11,0.12); --tab-rec-active: rgba(245,158,11,0.22);
    --tab-week: #dc2626; --tab-week-bg: rgba(239,68,68,0.1); --tab-week-active: rgba(239,68,68,0.18);
    --tab-month: #1d4ed8; --tab-month-bg: rgba(37,99,235,0.1); --tab-month-active: rgba(37,99,235,0.18);
    --tab-fav: #db2777; --tab-fav-bg: rgba(236,72,153,0.1); --tab-fav-active: rgba(236,72,153,0.18);
    --tab-pl: #9333ea; --tab-pl-bg: rgba(168,85,247,0.1); --tab-pl-active: rgba(168,85,247,0.18);
    --tab-recent: #059669; --tab-recent-bg: rgba(16,185,129,0.1); --tab-recent-active: rgba(16,185,129,0.18);
    --tab-top: #f97316; --tab-top-bg: rgba(249,115,22,0.12); --tab-top-active: rgba(249,115,22,0.22);
    --tab-top: #f97316; --tab-top-bg: rgba(249,115,22,0.12); --tab-top-active: rgba(249,115,22,0.22);
    --sidebar-bg:#12122a;
    --tab-rec: #d97706; --tab-rec-bg: rgba(245,158,11,0.12); --tab-rec-dark: #fcd34d; --tab-rec-bg-dark: rgba(251,191,36,0.15);
    --tab-week: #dc2626; --tab-week-bg: rgba(239,68,68,0.1); --tab-week-dark: #f87171; --tab-week-bg-dark: rgba(252,129,129,0.15);
    --tab-month: #1d4ed8; --tab-month-bg: rgba(37,99,235,0.1); --tab-month-dark: #60a5fa; --tab-month-bg-dark: rgba(96,165,250,0.15);
    --tab-fav: #db2777; --tab-fav-bg: rgba(236,72,153,0.1); --tab-fav-dark: #f472b6; --tab-fav-bg-dark: rgba(244,114,182,0.15);
    --tab-pl: #9333ea; --tab-pl-bg: rgba(168,85,247,0.1); --tab-pl-dark: #c084fc; --tab-pl-bg-dark: rgba(192,132,252,0.15);
    --tab-recent: #059669; --tab-recent-bg: rgba(16,185,129,0.1); --tab-recent-dark: #34d399;
    --tab-top: #f97316; --tab-top-bg: rgba(249,115,22,0.12); --tab-top-dark: #fdba74; --tab-top-bg-dark: rgba(253,186,116,0.15); --tab-recent-bg-dark: rgba(52,211,153,0.15);
}

/* Theme: Sunset (Orange) */
body.theme-sunset {
    /* --bg-hover 由 JS _applyColorTheme 写到 html inline, 此处不设 */
    --bg:#faf5f0;--bg-card:#fffcfa;--text:#2d1b0e;--text-secondary:#6b4423;--muted:#9c7a5a;--accent:#ea580c;--accent-hover:#c2410c;--border:#f0dcc8;--sidebar:#2d1b0e;--sidebar-text:#c4a882;--sidebar-active:#faf5f0;
    --tab-rec: #ea580c; --tab-rec-bg: rgba(234,88,12,0.12); --tab-rec-active: rgba(234,88,12,0.22);
    --tab-week: #dc2626; --tab-week-bg: rgba(239,68,68,0.1); --tab-week-active: rgba(239,68,68,0.18);
    --tab-month: #c2410c; --tab-month-bg: rgba(194,65,12,0.1); --tab-month-active: rgba(194,65,12,0.18);
    --tab-fav: #be185d; --tab-fav-bg: rgba(190,24,93,0.1); --tab-fav-active: rgba(190,24,93,0.18);
    --tab-pl: #7c3aed; --tab-pl-bg: rgba(124,58,237,0.1); --tab-pl-active: rgba(124,58,237,0.18);
    --tab-recent: #0d9488; --tab-recent-bg: rgba(13,148,136,0.1); --tab-recent-active: rgba(13,148,136,0.18);
    --tab-top: #ea580c; --tab-top-bg: rgba(234,88,12,0.12); --tab-top-active: rgba(234,88,12,0.22);
    --sidebar-bg:#1a0f08;
    --tab-rec: #ea580c; --tab-rec-bg: rgba(234,88,12,0.12); --tab-rec-dark: #fdba74; --tab-rec-bg-dark: rgba(253,186,116,0.15);
    --tab-week: #dc2626; --tab-week-bg: rgba(239,68,68,0.1); --tab-week-dark: #fca5a5; --tab-week-bg-dark: rgba(252,165,165,0.15);
    --tab-month: #c2410c; --tab-month-bg: rgba(194,65,12,0.1); --tab-month-dark: #fed7aa; --tab-month-bg-dark: rgba(254,215,170,0.15);
    --tab-fav: #be185d; --tab-fav-bg: rgba(190,24,93,0.1); --tab-fav-dark: #f9a8d4; --tab-fav-bg-dark: rgba(249,168,212,0.15);
    --tab-pl: #7c3aed; --tab-pl-bg: rgba(124,58,237,0.1); --tab-pl-dark: #d8b4fe; --tab-pl-bg-dark: rgba(216,180,254,0.15);
    --tab-recent: #0d9488; --tab-recent-bg: rgba(13,148,136,0.1); --tab-recent-dark: #5eead4; --tab-recent-bg-dark: rgba(94,234,212,0.15);
    --tab-top: #ea580c; --tab-top-bg: rgba(234,88,12,0.12); --tab-top-dark: #fdba74; --tab-top-bg-dark: rgba(253,186,116,0.15);
}

/* Theme: Ocean (Cyan/Blue) */
body.theme-ocean {
    /* --bg-hover 由 JS _applyColorTheme 写到 html inline, 此处不设 */
    --bg:#f0f8fa;--bg-card:#ffffff;--text:#0a2a3a;--text-secondary:#2a5a72;--muted:#5a8a9a;--accent:#0891b2;--accent-hover:#0369a1;--border:#c8e4ec;--sidebar:#0a2a3a;--sidebar-text:#6ab0c8;--sidebar-active:#f0f8fa;
    --tab-rec: #0891b2; --tab-rec-bg: rgba(8,145,178,0.12); --tab-rec-active: rgba(8,145,178,0.22);
    --tab-week: #0284c7; --tab-week-bg: rgba(2,132,199,0.1); --tab-week-active: rgba(2,132,199,0.18);
    --tab-month: #0369a1; --tab-month-bg: rgba(3,105,161,0.1); --tab-month-active: rgba(3,105,161,0.18);
    --tab-fav: #db2777; --tab-fav-bg: rgba(236,72,153,0.1); --tab-fav-active: rgba(236,72,153,0.18);
    --tab-pl: #7c3aed; --tab-pl-bg: rgba(168,85,247,0.1); --tab-pl-active: rgba(168,85,247,0.18);
    --tab-recent: #059669; --tab-recent-bg: rgba(5,150,105,0.1); --tab-recent-active: rgba(5,150,105,0.18);
    --tab-top: #f97316; --tab-top-bg: rgba(249,115,22,0.12); --tab-top-active: rgba(249,115,22,0.22);
    --sidebar-bg:#061820;
    --tab-rec: #0891b2; --tab-rec-bg: rgba(8,145,178,0.12); --tab-rec-dark: #67e8f9; --tab-rec-bg-dark: rgba(103,232,249,0.15);
    --tab-week: #0284c7; --tab-week-bg: rgba(2,132,199,0.1); --tab-week-dark: #7dd3fc; --tab-week-bg-dark: rgba(125,211,252,0.15);
    --tab-month: #0369a1; --tab-month-bg: rgba(3,105,161,0.1); --tab-month-dark: #bae6fd; --tab-month-bg-dark: rgba(186,230,253,0.15);
    --tab-fav: #db2777; --tab-fav-bg: rgba(236,72,153,0.1); --tab-fav-dark: #f472b6; --tab-fav-bg-dark: rgba(244,114,182,0.15);
    --tab-pl: #7c3aed; --tab-pl-bg: rgba(168,85,247,0.1); --tab-pl-dark: #c084fc; --tab-pl-bg-dark: rgba(192,132,252,0.15);
    --tab-recent: #059669; --tab-recent-bg: rgba(5,150,105,0.1); --tab-recent-dark: #6ee7b7; --tab-recent-bg-dark: rgba(110,231,183,0.15);
    --tab-top: #f97316; --tab-top-bg: rgba(249,115,22,0.12); --tab-top-dark: #fdba74; --tab-top-bg-dark: rgba(253,186,116,0.15);
}

/* Theme: Forest (Green) */
body.theme-forest {
    /* --bg-hover 由 JS _applyColorTheme 写到 html inline, 此处不设 */
    --bg:#f0f7f2;--bg-card:#ffffff;--text:#1a2e1f;--text-secondary:#2d5a3a;--muted:#5a8a6a;--accent:#15803d;--accent-hover:#166534;--border:#c8e4d0;--sidebar:#1a2e1f;--sidebar-text:#6aaa7a;--sidebar-active:#f0f7f2;
    --tab-rec: #15803d; --tab-rec-bg: rgba(21,128,61,0.12); --tab-rec-active: rgba(21,128,61,0.22);
    --tab-week: #b45309; --tab-week-bg: rgba(180,83,9,0.1); --tab-week-active: rgba(180,83,9,0.18);
    --tab-month: #166534; --tab-month-bg: rgba(22,101,52,0.1); --tab-month-active: rgba(22,101,52,0.18);
    --tab-fav: #be185d; --tab-fav-bg: rgba(190,24,93,0.1); --tab-fav-active: rgba(190,24,93,0.18);
    --tab-pl: #6d28d9; --tab-pl-bg: rgba(109,40,217,0.1); --tab-pl-active: rgba(109,40,217,0.18);
    --tab-recent: #047857; --tab-recent-bg: rgba(4,120,87,0.1); --tab-recent-active: rgba(4,120,87,0.18);
    --tab-top: #ea580c; --tab-top-bg: rgba(234,88,12,0.12); --tab-top-active: rgba(234,88,12,0.22);
    --sidebar-bg:#0f1f14;
    --tab-rec: #15803d; --tab-rec-bg: rgba(21,128,61,0.12); --tab-rec-dark: #86efac; --tab-rec-bg-dark: rgba(134,239,172,0.15);
    --tab-week: #b45309; --tab-week-bg: rgba(180,83,9,0.1); --tab-week-dark: #fde68a; --tab-week-bg-dark: rgba(253,230,138,0.15);
    --tab-month: #166534; --tab-month-bg: rgba(22,101,52,0.1); --tab-month-dark: #bbf7d0; --tab-month-bg-dark: rgba(187,247,208,0.15);
    --tab-fav: #be185d; --tab-fav-bg: rgba(190,24,93,0.1); --tab-fav-dark: #f9a8d4; --tab-fav-bg-dark: rgba(249,168,212,0.15);
    --tab-pl: #6d28d9; --tab-pl-bg: rgba(109,40,217,0.1); --tab-pl-dark: #ddd6fe; --tab-pl-bg-dark: rgba(221,214,254,0.15);
    --tab-recent: #047857; --tab-recent-bg: rgba(4,120,87,0.1); --tab-recent-dark: #a7f3d0; --tab-recent-bg-dark: rgba(167,243,208,0.15);
    --tab-top: #ea580c; --tab-top-bg: rgba(234,88,12,0.12); --tab-top-dark: #fbbf24; --tab-top-bg-dark: rgba(251,191,36,0.15);
}

/* Theme: Lavender (Purple) */
body.theme-lavender {
    /* --bg-hover 由 JS _applyColorTheme 写到 html inline, 此处不设 */
    --bg:#f8f5ff;--bg-card:#ffffff;--text:#2a1a3a;--text-secondary:#5a3a72;--muted:#8a6a9a;--accent:#7c3aed;--accent-hover:#6d28d9;--border:#e4d0f0;--sidebar:#2a1a3a;--sidebar-text:#a88ac8;--sidebar-active:#f8f5ff;
    --tab-rec: #7c3aed; --tab-rec-bg: rgba(124,58,237,0.12); --tab-rec-active: rgba(124,58,237,0.22);
    --tab-week: #db2777; --tab-week-bg: rgba(219,39,119,0.1); --tab-week-active: rgba(219,39,119,0.18);
    --tab-month: #9333ea; --tab-month-bg: rgba(147,51,234,0.1); --tab-month-active: rgba(147,51,234,0.18);
    --tab-fav: #e11d48; --tab-fav-bg: rgba(225,29,72,0.1); --tab-fav-active: rgba(225,29,72,0.18);
    --tab-pl: #4f46e5; --tab-pl-bg: rgba(79,70,229,0.1); --tab-pl-active: rgba(79,70,229,0.18);
    --tab-recent: #0f766e; --tab-recent-bg: rgba(15,118,110,0.1); --tab-recent-active: rgba(15,118,110,0.18);
    --tab-top: #f97316; --tab-top-bg: rgba(249,115,22,0.12); --tab-top-active: rgba(249,115,22,0.22);
    --sidebar-bg:#1a0f2a;
    --tab-rec: #7c3aed; --tab-rec-bg: rgba(124,58,237,0.12); --tab-rec-dark: #c4b5fd; --tab-rec-bg-dark: rgba(196,181,253,0.15);
    --tab-week: #db2777; --tab-week-bg: rgba(219,39,119,0.1); --tab-week-dark: #f9a8d4; --tab-week-bg-dark: rgba(249,168,212,0.15);
    --tab-month: #9333ea; --tab-month-bg: rgba(147,51,234,0.1); --tab-month-dark: #d8b4fe; --tab-month-bg-dark: rgba(216,180,254,0.15);
    --tab-fav: #e11d48; --tab-fav-bg: rgba(225,29,72,0.1); --tab-fav-dark: #fda4af; --tab-fav-bg-dark: rgba(253,164,175,0.15);
    --tab-pl: #4f46e5; --tab-pl-bg: rgba(79,70,229,0.1); --tab-pl-dark: #a5b4fc; --tab-pl-bg-dark: rgba(165,180,252,0.15);
    --tab-recent: #0f766e; --tab-recent-bg: rgba(15,118,110,0.1); --tab-recent-dark: #5eead4; --tab-recent-bg-dark: rgba(94,234,212,0.15);
    --tab-top: #f97316; --tab-top-bg: rgba(249,115,22,0.12); --tab-top-dark: #fdba74; --tab-top-bg-dark: rgba(253,186,116,0.15);
}

/* Theme: Mono (Gray) */

/* Theme: Midnight (Deep Dark) */
body.theme-midnight {
    /* --bg-hover 由 JS _applyColorTheme 写到 html inline, 此处不设 */
    --bg:#0c0e16;--bg-card:#131520;--text:#e2e4ea;--text-secondary:#8890a4;--muted:#5a6070;--accent:#5b8def;--accent-hover:#93b4f0;--border:#252836;--sidebar:#0a0b10;--sidebar-text:#5a6070;--sidebar-active:#e2e4ea;--sidebar-bg:#161922;
    --tab-rec:#f59e0b; --tab-rec-bg:rgba(245,158,11,0.15); --tab-rec-active:rgba(245,158,11,0.28);
    --tab-week:#f87171; --tab-week-bg:rgba(248,113,113,0.12); --tab-week-active:rgba(248,113,113,0.25);
    --tab-month:#60a5fa; --tab-month-bg:rgba(96,165,250,0.12); --tab-month-active:rgba(96,165,250,0.25);
    --tab-fav:#f472b6; --tab-fav-bg:rgba(244,114,182,0.12); --tab-fav-active:rgba(244,114,182,0.25);
    --tab-pl:#a78bfa; --tab-pl-bg:rgba(167,139,250,0.12); --tab-pl-active:rgba(167,139,250,0.25);
    --tab-recent:#34d399; --tab-recent-bg:rgba(52,211,153,0.12); --tab-recent-active:rgba(52,211,153,0.25);
    --tab-top: #f97316; --tab-top-bg: rgba(249,115,22,0.12); --tab-top-active: rgba(249,115,22,0.22);
    --tab-top: #f97316; --tab-top-bg: rgba(249,115,22,0.12); --tab-top-active: rgba(249,115,22,0.22);
}
body.theme-midnight .sidebar { background: var(--sidebar); }

body.theme-mono {
    /* --bg-hover 由 JS _applyColorTheme 写到 html inline, 此处不设 */
    --bg:#f5f5f5;--bg-card:#ffffff;--text:#111827;--text-secondary:#4b5563;--muted:#6b7280;--accent:#374151;--accent-hover:#1f2937;--border:#e5e7eb;--sidebar:#111827;--sidebar-text:#6b7280;--sidebar-active:#f5f5f5;
    --tab-rec: #374151; --tab-rec-bg: rgba(55,65,81,0.12); --tab-rec-active: rgba(55,65,81,0.22);
    --tab-week: #4b5563; --tab-week-bg: rgba(75,85,99,0.1); --tab-week-active: rgba(75,85,99,0.18);
    --tab-month: #6b7280; --tab-month-bg: rgba(107,114,128,0.1); --tab-month-active: rgba(107,114,128,0.18);
    --tab-fav: #1f2937; --tab-fav-bg: rgba(31,41,55,0.1); --tab-fav-active: rgba(31,41,55,0.18);
    --tab-pl: #111827; --tab-pl-bg: rgba(17,24,39,0.1); --tab-pl-active: rgba(17,24,39,0.18);
    --tab-recent: #0f172a; --tab-recent-bg: rgba(15,23,42,0.1); --tab-recent-active: rgba(15,23,42,0.18);
    --tab-top: #374151; --tab-top-bg: rgba(55,65,81,0.12); --tab-top-active: rgba(55,65,81,0.22);
    --sidebar-bg:#0a0a0a;
    --tab-rec: #374151; --tab-rec-bg: rgba(55,65,81,0.12); --tab-rec-dark: #d1d5db; --tab-rec-bg-dark: rgba(209,213,219,0.15);
    --tab-week: #4b5563; --tab-week-bg: rgba(75,85,99,0.1); --tab-week-dark: #e5e7eb; --tab-week-bg-dark: rgba(229,231,235,0.15);
    --tab-month: #6b7280; --tab-month-bg: rgba(107,114,128,0.1); --tab-month-dark: #f3f4f6; --tab-month-bg-dark: rgba(243,244,246,0.15);
    --tab-fav: #1f2937; --tab-fav-bg: rgba(31,41,55,0.1); --tab-fav-dark: #e5e7eb; --tab-fav-bg-dark: rgba(229,231,235,0.15);
    --tab-pl: #111827; --tab-pl-bg: rgba(17,24,39,0.1); --tab-pl-dark: #f9fafb; --tab-pl-bg-dark: rgba(249,250,251,0.15);
    --tab-recent: #0f172a; --tab-recent-bg: rgba(15,23,42,0.1); --tab-recent-dark: #f1f5f9; --tab-recent-bg-dark: rgba(241,245,249,0.15);
    --tab-top: #374151; --tab-top-bg: rgba(55,65,81,0.12); --tab-top-dark: #d1d5db; --tab-top-bg-dark: rgba(209,213,219,0.15);
}

/* ============================================
   Tab Button Theme Styles
   ============================================ */
.dash-tab {
    border: none !important;
    border-radius: 10px 10px 0 0;
    cursor: pointer;
    font-size: 13px;
    padding: 6px 14px;
    transition: all 0.25s;
    font-weight: 500;
}
.dash-tab:hover { filter: brightness(0.92); }
.dash-tab.active { font-weight: 700; background: var(--tab-rec-active); color: var(--tab-rec); box-shadow: 0 -3px 10px rgba(0,0,0,0.08); }

/* Apply theme colors to tabs using CSS variables */
.dash-tab[data-tab="rec"] { color: var(--tab-rec); background: var(--tab-rec-bg); }
.dash-tab[data-tab="rec"].active { background: var(--tab-rec-active); color: var(--tab-rec); }

.dash-tab[data-tab="week"] { color: var(--tab-week); background: var(--tab-week-bg); }
.dash-tab[data-tab="week"].active { background: var(--tab-week-active); color: var(--tab-week); }

.dash-tab[data-tab="month"] { color: var(--tab-month); background: var(--tab-month-bg); }
.dash-tab[data-tab="month"].active { background: var(--tab-month-active); color: var(--tab-month); }

.dash-tab[data-tab="fav"] { color: var(--tab-fav); background: var(--tab-fav-bg); }
.dash-tab[data-tab="fav"].active { background: var(--tab-fav-active); color: var(--tab-fav); }

.dash-tab[data-tab="pl"] { color: var(--tab-pl); background: var(--tab-pl-bg); }
.dash-tab[data-tab="pl"].active { background: var(--tab-pl-active); color: var(--tab-pl); }

.dash-tab[data-tab="recent"] { color: var(--tab-recent); background: var(--tab-recent-bg); }
.dash-tab[data-tab="recent"].active { background: var(--tab-recent-active); color: var(--tab-recent); }

.dash-tab[data-tab="top"] { color: var(--tab-top); background: var(--tab-top-bg); }
.dash-tab[data-tab="top"].active { background: var(--tab-top-active); color: var(--tab-top); }

/* ============================================
   Theme Selector in Settings
   ============================================ */
.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 12px; }
.theme-card {
    padding: 12px;
    border-radius: 10px;
    border: 2px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
}
.theme-card:hover { border-color: var(--muted); }
.theme-card.active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(0,113,227,0.2); }
.theme-name { font-size: 13px; margin-bottom: 8px; }
.theme-swatches { display: flex; gap: 4px; justify-content: center; }
.theme-swatch { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.1); }

/* ============================================
   Player Bar — Scrolling Lyrics
   ============================================ */
@keyframes lyric-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

#player-lyric-line {
    display: block;
    max-width: 300px;
    white-space: nowrap;
    overflow: visible;   /* 让动画露出来 */
    text-overflow: ellipsis;
}

#player-lyric-line.scrolling {
    overflow: hidden;
    animation: lyric-scroll var(--lyric-duration, 8s) linear infinite;
    /* 文字向左滚动的速度由 --lyric-duration 控制 */
}

#player-lyric-line.scrolling:hover {
    animation-play-state: paused;
}


/* ===== Settings Page Styles ===== */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
        .settings-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
        .settings-card h3 { font-size: 15px; color: var(--accent); margin-bottom: 8px; }
        .settings-card .desc { font-size: 13px; color: var(--muted); margin-bottom: 12px; line-height: 1.5; }
        .settings-card .current { font-size: 12px; color: var(--muted); margin-bottom: 8px; word-break: break-all; }
        .settings-card input[type="text"],
        .settings-card input[type="number"],
        .settings-card input[type="password"] { width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 10px; color: var(--text); font-size: 14px; }
        .settings-card input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }
        .settings-card .checkbox-row { display: flex; align-items: center; gap: 10px; }
        .settings-card .checkbox-row label { cursor: pointer; color: var(--text); }
        .settings-card .warning { background: rgba(210,153,34,0.15); border: 1px solid #d29922; border-radius: 6px; padding: 10px; font-size: 12px; color: #d29922; margin-bottom: 12px; }
        .settings-card.full-width { grid-column: 1 / -1; }
        .save-btn { background: var(--success); color: var(--bg); padding: 10px 30px; border: none; border-radius: 8px; cursor: pointer; font-size: 14px; margin-top: 20px; }
        .save-btn:hover { opacity: 0.85; }
/* 移动端音量浮层指示器 */
#volume-indicator {
    position: fixed;
    left: 50%;
    bottom: 80px;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 20px;
    padding: 12px 20px;
    font-size: 14px;
    color: white;
    pointer-events: none;
    animation: volFadeIn 0.2s ease-out;
}
#volume-indicator #vi-icon { font-size: 20px; }
#volume-indicator #vi-bar {
    width: 100px;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
    overflow: hidden;
}
#volume-indicator #vi-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.05s;
}
@keyframes volFadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* 播放器歌词跑马灯 */
#player-lyrics-marquee {
    animation: marquee 12s linear infinite;
    overflow: hidden;
}
#player-lyrics-marquee.paused {
    animation-play-state: paused;
}
@keyframes marquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
#player-lyrics-marquee-wrapper {
    overflow: hidden;
    width: 100%;
}

/* 播放队列面板 */

#queue-content {
    padding: 8px;
    overflow-y: auto;
    max-height: 280px;
}
/* 播放器歌词跑马灯 */

/* 播放器歌词跑马灯 */
#player-lyrics-marquee {
    font-size: 11px;
    color: var(--muted);
    height: 16px;
    line-height: 16px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    max-width: 100%;
}
#player-lyrics-marquee.playing {
    animation: marquee-scroll 12s linear infinite;
}
@keyframes marquee-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* 播放队列面板 */
#player-queue-panel {
    display: none;
    position: fixed;
    bottom: 60px;
    left: 260px;
    width: 320px;
    max-height: 340px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    z-index: 899;
    overflow: hidden;
}
/* 全屏模式: 从全屏底部滑出, 占下半屏 (z-index 高于全屏 100000) */
#player-queue-panel.fs-mode {
    bottom: 0; left: 0; right: 0;
    width: auto;
    max-width: 100vw;
    max-height: 60vh;
    border-radius: 16px 16px 0 0;
    z-index: 100100;
    background: rgba(20, 20, 35, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.1);
    border-bottom: none;
    animation: queueFsSlideUp 0.25s ease;
}
@keyframes queueFsSlideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}
#queue-content {
    padding: 8px;
    overflow-y: auto;
    max-height: 280px;
}
#player-lyrics-panel {
    display: none;
    position: fixed;
    bottom: 60px;
    right: 264px;
    width: 300px;
    max-height: 340px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
    z-index: 899;
    overflow: hidden;
}
#player-lyrics-content {
    padding: 12px;
    max-height: 300px;
    overflow-y: auto;
    font-size: 13px;
    line-height: 1.8;
}

/* 个人设置页 */
.lastfm-status { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--bg); border-radius: 8px; margin-bottom: 12px; }
.lastfm-status.linked { border: 1px solid rgba(48,209,88,0.3); }
.lastfm-status.unlinked { border: 1px solid var(--border); }
.lastfm-badge { font-size: 20px; }
.lastfm-info { flex: 1; }
.lastfm-name { font-weight: 600; font-size: 15px; color: var(--text); }
.lastfm-desc { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* 管理员专属菜单项 - 隐藏状态 */
/* 2026-06-13: 管理员菜单分组 (默认收缩) */
.admin-group { display: none; margin: 8px 0; }
body.user-admin .admin-group { display: block; }
.admin-group > .nav-summary {
    list-style: none;
    cursor: pointer;
    padding: 10px 16px;
    color: var(--muted);
    font-size: 13px;
    user-select: none;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.admin-group > .nav-summary::-webkit-details-marker { display: none; }
.admin-group > .nav-summary:hover { background: var(--hover, rgba(255,255,255,0.05)); color: var(--text); }
.admin-group > .nav-summary .admin-arrow { transition: transform 0.2s; font-size: 11px; }
.admin-group[open] > .nav-summary .admin-arrow { transform: rotate(90deg); }
.admin-group .admin-sub { padding-left: 0; margin-top: 2px; }
.admin-group .admin-sub .nav-item { padding-left: 28px; font-size: 13px; }

.nav-item.admin-only { display: none; }
/* 2026-06-12: 任何带 admin-only class 的元素默认隐藏 (不只是 nav-item) */
.admin-only { display: none !important; }
/* 2026-06-12: 管理员用户时, body.user-admin 下的 admin-only 恢复为 inline-flex (覆盖 !important) */
body.user-admin .admin-only { display: flex !important; }

/* === 2026-06-09: 服务与接口 settings 卡片布局 === */
/* 桌面: 2 列网格, Last.fm 跨 2 行 (左大), LRC + Discogs 上下堆 (右小) */
.svc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: stretch;
}
.svc-cell-tall { grid-row: span 2; }
@media (max-width: 720px) {
    /* 窄屏 fallback: 单列堆叠 */
    .svc-grid { grid-template-columns: 1fr; }
    .svc-cell-tall { grid-row: auto; }
}

/* ===== 移动端 stat-card 兑底 (文件末尾覆盖上面 .stat-card 块) ===== */
@media (max-width: 768px) {
    .stats-bar {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
        margin-bottom: 16px !important;
    }
    .stat-card {
        padding: 10px 8px !important;
        min-width: 0;
    }
    .stat-card .num {
        font-size: 18px !important;
    }
    .stat-card .label {
        font-size: 11px !important;
    }
}

/* ===== 响应式网格断点总表 (从大到小) =====
 *  PC      (>=1280px)  : 容器最大 1100px 居中, auto-fill minmax(180px)
 *  小PC     (>=1024px)  : 容器 100%, auto-fill minmax(170px)
 *  平板横屏 (768-1024)  : auto-fill minmax(150px)
 *  平板竖屏 (481-768)   : auto-fill minmax(130px)
 *  手机横屏 (<=480px)   : auto-fill minmax(110px)
 *  手机竖屏 (<=360px)   : auto-fill minmax(90px)
 *  上一套是 < 768px 固定 3 列, 列数不随宽度变; 现在改 auto-fill 自动增减
 */

/* 大屏 PC: 限制最大宽度, 别让 4K 屏塞 10 列 */
@media (min-width: 1280px) {
    .album-grid,
    .artist-grid {
        max-width: 1240px;
        margin-left: auto;
        margin-right: auto;
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
    }
}

/* 平板横屏 / iPad Pro 11" (768-1024): 比之前 140px 略大 */
@media (min-width: 768px) and (max-width: 1024px) {
    .album-grid,
    .artist-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
        gap: 12px !important;
    }
}

/* 平板竖屏 / 手机横屏 (481-768) */
@media (min-width: 481px) and (max-width: 768px) {
    .album-grid,
    .artist-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)) !important;
        gap: 10px !important;
    }
    .artist-grid .artist-card-body { padding: 8px 10px !important; }
    .artist-grid .artist-card-body h3 { font-size: 12px !important; }
    .artist-grid .artist-card-body p { font-size: 10px !important; }
    .album-grid .album-card .info { padding: 8px !important; }
    .album-grid .album-card h4 { font-size: 12px !important; }
    .album-grid .album-card p { font-size: 10px !important; }
    .album-grid .album-card .cover { font-size: 32px !important; }
}

/* 手机竖屏 (<=480px) — 之前固定 3 列, 现在 auto-fill */
@media (max-width: 480px) {
    .album-grid,
    .artist-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)) !important;
        gap: 8px !important;
    }
    .artist-grid .artist-card-avatar { font-size: 28px !important; }
    .artist-grid .artist-card-body { padding: 8px !important; }
    .artist-grid .artist-card-body h3 { font-size: 11px !important; }
    .artist-grid .artist-card-body p { font-size: 9px !important; }
    .album-grid .album-card .cover { font-size: 28px !important; }
    .album-grid .album-card .info { padding: 6px !important; }
    .album-grid .album-card h4 { font-size: 11px !important; }
    .album-grid .album-card p { font-size: 9px !important; }
}

/* 超小屏 (<=360px) - 旧小屏机/分割屏 */
@media (max-width: 360px) {
    .album-grid,
    .artist-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)) !important;
        gap: 6px !important;
    }
    .album-grid .album-card .info { padding: 4px !important; }
    .album-grid .album-card h4 { font-size: 10px !important; }
    .album-grid .album-card p { font-size: 8px !important; }
}

/* ===== 歌手页 (flex wrap, 不用 .artist-grid) =====
   .artist-tag 是按歌手专辑数分级的圆形 (JS 动态设 width/height 56-120px),
   不是响应式 grid. JS 里 .artist-tag.style.width/height 会覆盖这里的 flex,
   所以这里只调 gap, 不动尺寸.
   原 33vw 计算是给 flex 容器的兑底, 保留. */
#artist-list-content {
    gap: 10px;
    justify-content: space-between;
}
@media (max-width: 768px) {
    #artist-list-content { gap: 8px !important; justify-content: center !important; }
}

/* ===== 移动端 theme-grid 3 列 (兑底) ===== */
@media (max-width: 768px) {
    .theme-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
    }
    .theme-card {
        padding: 8px !important;
    }
    .theme-name {
        font-size: 11px !important;
        margin-bottom: 6px !important;
    }
    .theme-swatch {
        width: 12px !important;
        height: 12px !important;
    }
}

/* ===== 移动端 theme-card 内子框 (兑底) ===== */
@media (max-width: 768px) {
    .theme-card {
        overflow: hidden;
    }
    .theme-name {
        font-size: 10px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    .theme-swatches {
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 3px !important;
    }
    .theme-swatch {
        width: 10px !important;
        height: 10px !important;
    }
}

/* ===== 歌手详情页移动端适配 ===== */
@media (max-width: 768px) {
    /* header 改成上下结构 */
    .artist-detail-header {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 16px !important;
        padding: 16px 0 !important;
    }
    .artist-avatar {
        width: 96px !important;
        height: 96px !important;
        font-size: 38px !important;
    }
    .artist-type-label {
        display: none;
    }
    .artist-name {
        font-size: 22px !important;
    }
    .artist-meta {
        justify-content: center !important;
        font-size: 13px !important;
    }
    .artist-genres {
        justify-content: center !important;
    }

    /* 热门歌曲表格 - 移动端处理 */
    .track-list-table {
        font-size: 13px;
    }
    .track-list-table th,
    .track-list-table td {
        padding: 8px 10px !important;
    }
    /* 隐藏专辑列（标题下已显示） */
    .track-list-table th:nth-child(3),
    .track-list-table td.track-album {
        display: none !important;
    }
    .track-list-table th:nth-child(1),
    .track-list-table td.track-num {
        width: 32px !important;
    }
    .track-list-table th:nth-child(4),
    .track-list-table td.track-dur {
        width: 50px !important;
        text-align: right !important;
    }
    .track-list-table .track-info .track-sub {
        font-size: 11px !important;
    }

    /* 专辑grid已统一处理 */
}

/* ===== 歌手列表页移动端优化 ===== */
@media (max-width: 768px) {
    /* 搜索框全宽 */
    .search-bar { flex-wrap: wrap !important; }
    .search-bar input[type="text"] { flex: 1 1 100% !important; min-width: 0 !important; margin-bottom: 8px !important; }
    .search-bar .btn-group { flex-wrap: wrap !important; gap: 4px !important; }

    /* 筛选/排序按钮缩小 */
    .search-bar .btn-group .btn { font-size: 12px !important; padding: 4px 10px !important; }

    /* 字母栏固定，不横滚 */
    .artist-letter-bar { flex-wrap: wrap !important; overflow-x: visible !important; justify-content: center !important; gap: 2px !important; }
    .letter-item { min-width: 24px !important; height: 26px !important; font-size: 11px !important; padding: 0 4px !important; }

    /* 歌手列表 3 列 + 圆头大小统一为 30vw 左右（容纳名字 tooltip 视觉对齐） */
    #artist-list-content { gap: 10px !important; padding: 12px 0 !important; }
    .artist-tag {
        width: calc((100vw - 60px) / 3) !important;
        height: calc((100vw - 60px) / 3) !important;
        font-size: 16px !important;
    }

    /* 圆头下的文字 label（如果加了） */
    .artist-tag-label {
        margin-top: 4px;
        font-size: 11px;
        text-align: center;
        color: var(--text);
        line-height: 1.2;
        max-width: calc((100vw - 60px) / 3);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* ===== 专辑列表页移动端适配 ===== */
@media (max-width: 768px) {
    /* 专辑列表 2 列 */
    .album-list {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    .album-list .album-card .cover { font-size: 32px !important; }
    .album-list .album-card .info { padding: 8px !important; }
    .album-list .album-card h4 { font-size: 13px !important; }
    .album-list .album-card p { font-size: 11px !important; }
    .album-list .album-card .meta { font-size: 10px !important; }

    /* 排序/每页/分类按钮行紧凑 */
    .search-bar { flex-wrap: wrap !important; }
    .search-bar > input[type="text"] { flex: 1 1 100% !important; min-width: 0 !important; margin-bottom: 8px !important; }

    /* 分类按钮 wrap + 缩小 */
    .search-bar > div[style*="flex-wrap"] { gap: 6px !important; }
    .search-bar .btn { font-size: 12px !important; padding: 5px 10px !important; }

    /* 排序行 wrap */
    .search-bar > div[style*="align-items:center"] { flex-wrap: wrap !important; }

    /* 翻页按钮小一点 */
    .pagination button { font-size: 12px !important; padding: 5px 8px !important; min-width: 28px !important; }
}

/* ===== 专辑详情页移动端适配 ===== */
@media (max-width: 768px) {
    /* 专辑 cover 缩小 + 名字缩 */
    .album-info-panel > div:first-child { gap: 12px !important; margin-bottom: 12px !important; }
    #album-cover-container {
        width: 120px !important;
        height: 120px !important;
    }
    .album-info-panel h2 { font-size: 17px !important; }
    .album-info-panel p { font-size: 12px !important; }

    /* toolbar 紧凑 */
    .album-toolbar { gap: 6px !important; }
    .album-toolbar .btn { font-size: 12px !important; padding: 5px 8px !important; }

    /* ===== 曲目表格：保持表格，只精简列 ===== */
    .track-table-wrap table { min-width: 0; }
    /* 隐藏"格式"列 */
    .track-table-wrap table thead th:nth-child(4),
    .track-table-wrap table tbody tr td:nth-child(4) { display: none !important; }
    /* 缩窄时间列 */
    .track-table-wrap table thead th.tdur,
    .track-table-wrap table tbody tr td.tdur { padding-left: 4px !important; padding-right: 4px !important; font-size: 11px !important; }
    /* 隐藏后三列（播放/收藏/歌单）— 长按弹菜单代替 */
    .track-table-wrap table thead th:nth-child(5),
    .track-table-wrap table thead th:nth-child(6),
    .track-table-wrap table thead th:nth-child(7),
    .track-table-wrap table tbody tr td:nth-child(5),
    .track-table-wrap table tbody tr td:nth-child(6),
    .track-table-wrap table tbody tr td:nth-child(7) { display: none !important; }
    /* 缩小全局 padding 让表格不那么挤 */
    .track-table-wrap table thead th { padding: 8px 6px !important; font-size: 10px !important; }
    .track-table-wrap table tbody tr td { padding: 6px 4px !important; }
}

/* ===== 歌曲列表行内操作按钮（SVG） ===== */
.row-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    vertical-align: middle;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}
.row-action-btn:hover {
    color: var(--accent);
    background: var(--bg);
}
.row-action-btn svg {
    display: block;
    pointer-events: none;
}

/* ===== 歌曲列表移动端简化模式 ===== */
@media (max-width: 768px) {
    /* 表格：紧湩 padding */
    .track-table { font-size: 14px; }
    .track-table thead th { padding: 8px 4px !important; font-size: 10px !important; font-weight: 600; }
    .track-table tbody td { padding: 8px 4px !important; }

    /* 隐藏 # 列 */
    .track-table thead th:nth-child(1),
    .track-table tbody td:nth-child(1) { display: none !important; }

    /* 隐藏操作列（长按弹菜单代替） */
    .track-table thead th:nth-child(4),
    .track-table tbody td:nth-child(4) { display: none !important; }

    /* 标题列：占剩余空间，ellipsis */
    .track-table tbody td:nth-child(2) > div {
        display: flex;
        align-items: center;
        gap: 10px;
    }
    .track-table tbody td:nth-child(2) > div > div {
        min-width: 0;
        flex: 1;
    }
    .track-table tbody td:nth-child(2) > div > div > div {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* 时长列：右对齐 */
    .track-table thead th:nth-child(3),
    .track-table tbody td:nth-child(3) {
        text-align: right;
        font-size: 12px;
        color: var(--muted);
        width: 60px;
    }

    /* 行高：轻点增加，便于触摸 */
    .track-table tbody tr.track-row { height: 56px; }
}

/* ===== ActionSheet 底部弹出菜单 ===== */
.actionsheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.actionsheet-backdrop.show {
    opacity: 1;
}
.actionsheet {
    width: 100%;
    max-width: 480px;
    background: var(--bg-card);
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    padding: 8px 0 16px;
    transform: translateY(100%);
    transition: transform 0.25s ease;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.2);
    margin: 0 auto;
}
.actionsheet-backdrop.show .actionsheet {
    transform: translateY(0);
}
.actionsheet-header {
    padding: 14px 20px 10px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
}
.actionsheet-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.actionsheet-subtitle {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.actionsheet-actions {
    display: flex;
    flex-direction: column;
    padding: 4px 0;
}
.actionsheet-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    background: none;
    border: none;
    color: var(--text);
    font-size: 15px;
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: background 0.15s;
}
.actionsheet-btn:hover,
.actionsheet-btn:active {
    background: var(--bg);
}
.actionsheet-btn svg {
    flex-shrink: 0;
    color: var(--accent);
}
.actionsheet-cancel {
    display: block;
    width: calc(100% - 24px);
    margin: 8px 12px 0;
    padding: 12px;
    background: var(--bg);
    border: none;
    border-radius: 10px;
    color: var(--text);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
}

/* ===== 曲目表格整体间距优化（PC + Mobile 通用） ===== */
.track-table-wrap {
    /* 跟 .main-content 边对齐，不额外加 padding */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.track-table-wrap .track-table {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    table-layout: auto;
    width: 100%;
    min-width: 0;
}
.track-table-wrap .track-table th {
    padding: 12px 20px;
    background: var(--bg);
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
}
.track-table-wrap .track-table td {
    padding: 14px 20px;
    vertical-align: middle;
    border-bottom: 1px solid var(--border);
}
.track-table-wrap .track-row:last-child td {
    border-bottom: none;
}
/* hover 整行高亮 */
.track-table-wrap .track-row {
    transition: background 0.15s;
}
.track-table-wrap .track-row:hover td {
    background: var(--bg);
}

/* 移动端：减少 padding 适配小屏 */
@media (max-width: 768px) {
    .track-table-wrap { padding: 0 8px; }
    .track-table-wrap .track-table th { padding: 10px 14px; font-size: 10px; }
    .track-table-wrap .track-table td { padding: 12px 14px; }
}

/* ===== 专辑曲目卡片化（概览页风格） ===== */
.track-cards-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
/* 2026-06-16: 修复左滑后标题截断
   之前 .track-card 是 grid 32px/1fr/auto, 但 swipe 包装后 .track-card 直接子元素变成了
   .track-card-swipe-wrap 和 .track-card-swipe-actions 两个, grid 列模板失效
   解决: 把 grid 移到 .track-card-swipe-wrap, .track-card 自己只负责布局方向 */
.track-card {
    /* 2026-06-16: 从 grid 改 flex — 修复 albums/artists 详情页 (3 child: num/main/actions) 标题被截断到 36px
       旧 grid-template-columns: 32px 1fr auto 假设 3 列对应 3 child,
       但 mobile media query 用 24px 36px 1fr 0px (4 列, 假设有 cover) 导致 main 落到 36px 列 */
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    min-width: 0;
}
.track-card.swipeable {
    display: block;  /* swipe 卡片, grid 由内部 .track-card-swipe-wrap 提供 */
    position: relative;
    overflow: hidden;
}
.track-card > * {
    min-width: 0;
}

.track-card:hover {
    background: var(--bg);
    border-color: var(--accent);
}
.track-card-num {
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
}
.track-card-main {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
}
.track-card-num {
    flex: 0 0 32px;
    text-align: center;
}
.track-card-cover {
    flex: 0 0 42px;
}
.track-card-actions {
    flex: 0 0 auto;
}
.track-card-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.track-card-sub {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.4;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.track-card-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}
.track-card-actions .row-action-btn {
    padding: 6px;
}

/* 移动端卡片化微调
   2026-06-16: 触摸区域扩到 44x44 (Apple HIG) — 旧版 22px 太小误触率高
   2026-06-16: 原有收藏/加歌单按钮由左滑替代, 移动端隐藏
   2026-06-16: 改 flex 后, track-card-num/cover/main/actions 由 flex 自动布局, 删掉旧 grid-template-columns */
@media (max-width: 768px) {
    .track-card { padding: 10px 12px; gap: 4px; }
    .track-card-num { flex: 0 0 24px; }
    .track-card-cover { flex: 0 0 36px; }
    .track-card-num { font-size: 12px; }
    .track-card-title { font-size: 13px; }
    .track-card-sub { font-size: 10px; }
    .track-card-actions { gap: 2px; }
    .track-card-actions .row-action-btn {
        min-width: 44px;
        min-height: 44px;
        padding: 0;
    }
    .track-card-actions .row-action-btn svg { width: 18px; height: 18px; }
    .track-card-actions .favorite-btn { min-width: 44px; min-height: 44px; padding: 0; }
}

/* 全部歌曲页 卡片封面图 (有封面的版本) */
.track-card-cover {
    width: 42px;
    height: 42px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg);
}
/* 2026-06-16: grid 已移到 .track-card-swipe-wrap, track-card 本身不再需要 grid 列定义 */
/* .track-card:has(.track-card-cover) { grid-template-columns: 32px 42px 1fr 0px; } */
@media (max-width: 768px) {
    .track-card-cover { width: 36px; height: 36px; }
}

/* ===== 全部歌曲页 搜索/筛选行 移动端 2 列紧凑布局 ===== */
@media (max-width: 768px) {
    /* 容器允许 wrap */
    #page-tracks > div:nth-of-type(2) {
        gap: 6px !important;
    }
    /* input/select 2 列布局, 各占 50% 减 gap */
    #track-search,
    #track-artist-filter,
    #track-genre-filter,
    #track-year-filter {
        flex: 1 1 calc(50% - 3px) !important;
        min-width: 0 !important;
        width: auto !important;
        padding: 6px 8px !important;
        font-size: 12px !important;
        box-sizing: border-box;
    }
    /* 搜索框独占一行, 更醒目 */
    #track-search {
        flex: 1 1 100% !important;
    }
    /* 总数自己占一行 */
    #track-total-count {
        flex: 1 1 100% !important;
        margin-left: 0 !important;
        font-size: 11px !important;
        text-align: right;
        margin-top: 2px;
    }
}

/* 折叠 section 通用样式 (系统设置 + 个人设置) */
.sec-header {
    cursor: pointer;
    user-select: none;
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 6px;
}
.sec-arrow {
    font-size: 10px;
    transition: transform 0.2s ease;
}
.sec-body {
    padding: 16px;
}
/* 个人设置页 - 移动端适配 */
@media (max-width: 600px) {
    .sec-header {
        padding: 10px 12px;
        font-size: 10px;
    }
    .sec-body {
        padding: 12px;
    }
}

/* ===== 2026-06-16: 左滑操作 + 骨架屏 + 下拉刷新 ===== */

/* 左滑操作: track-card 加 .swipeable class 后支持左滑
   背后露出的快捷按钮在 .track-card-swipe-actions */
.track-card.swipeable {
    position: relative;
    overflow: hidden;
    touch-action: pan-y;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}
/* 2026-06-16: Swipe wrap 包裹在 track-card 内部但不参与 grid
   用 position: relative + width: 0 + overflow: visible 让子元素 
   (track-card-num / main / actions) 不占 grid 空间, 而是作为 track-card 的 grid 子元素
    
   实际子元素在 HTML 里真正顺序是: track-card > swipe-wrap + swipe-actions
   swipe-wrap: 透明的 flex 容器, 没 width 限制, 内容自然堆叠在 grid cell 里 */
/* 2026-06-16: swipe-wrap 占满 track-card grid 所有列
   内部用 flex 排列子元素, translateX 做左滑动画 */
.track-card-swipe-wrap {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    transition: transform 0.18s ease-out;
    background: var(--bg-card);
    /* 不需要 z-index: actions 默认 transform 推到右边屏幕外, 看不见 */
}
.track-card-swipe-wrap > .track-card-num {
    flex: 0 0 32px;
    text-align: center;
}
.track-card-swipe-wrap > .track-card-cover {
    flex: 0 0 42px;
}
.track-card-swipe-wrap > .track-card-main {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    }
.track-card-swipe-wrap > .track-card-actions {
    width: 0 !important;  /* 强制 0 宽, 不让 button 撑开 (mobile) */
    min-width: 0 !important;
    max-width: 0 !important;
    overflow: hidden;
    pointer-events: none;
}
/* 2026-06-16: desktop 端 admin 也要能编辑, 所以 desktop 显示 admin-only button */
@media (hover: hover) and (pointer: fine) {
    .track-card-swipe-wrap > .track-card-actions {
        width: auto !important;
        min-width: auto !important;
        max-width: none !important;
        overflow: visible;
        pointer-events: auto;
    }
}
.track-card-swipe-wrap.swiping {
    transition: none;  /* 拖动中无动画 */
}
.track-card-swipe-actions {
    position: absolute;
    top: 0; bottom: 0; right: 0;
    display: flex;
    transform: translateX(100%);  /* 推到 card 右边屏幕外, 默认看不见 */
    transition: transform 0.18s ease-out;
    z-index: 1;
}
/* swipe 展开时, wrap 左滑露出 actions. 此时 actions 也跟着 transform 拉回 */
.track-card.swipeable.swiping .track-card-swipe-actions,
.track-card.swipeable.swipe-open .track-card-swipe-actions {
    transform: translateX(0);
}
/* 2026-06-16: button 宽度限制 — 之前 min-width: 72px 但内容多了就被撑到 ~130px
   现在 width: 80px flex-shrink: 0 固定宽度, 不论中英文都一致 */
.track-card-swipe-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 80px;
    flex-shrink: 0;
    padding: 0 8px;
    border: none;
    color: white;
    font-size: 12px;
    cursor: pointer;
    font-weight: 500;
    gap: 2px;
    white-space: nowrap;
}
.track-card-swipe-btn.fav { background: #e74c3c; }
.track-card-swipe-btn.playlist { background: var(--accent); }
.track-card-swipe-btn svg { display: block; }
.track-card-swipe-btn:active { opacity: 0.85; }

/* 桌面端禁用左滑 (有 hover 菜单 / 鼠标右键 / actionsheet 够用了) */
@media (hover: hover) and (pointer: fine) {
    .track-card-swipe-actions { display: none; }
}

/* ===== 骨架屏 (Skeleton) ===== */
.skeleton {
    background: linear-gradient(90deg,
        var(--bg-card) 0%,
        var(--bg) 50%,
        var(--bg-card) 100%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s infinite;
    border-radius: 6px;
    color: transparent !important;
    user-select: none;
    pointer-events: none;
}
@keyframes skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-text { height: 12px; margin: 4px 0; }
.skeleton-text-lg { height: 16px; margin: 6px 0; }
.skeleton-circle { width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; }
.skeleton-card { padding: 12px; }
.skeleton-card .skeleton-line {
    display: block;
    height: 12px;
    background: linear-gradient(90deg,
        var(--bg-card) 0%,
        var(--bg) 50%,
        var(--bg-card) 100%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s infinite;
    border-radius: 4px;
    margin: 6px 0;
}

/* ===== 下拉刷新 ===== */
/* 2026-06-16 修复: JS 改用 scrollContainer.insertBefore(indicator, scrollContainer.firstChild)
   现在 indicator 是 .main-content 的第一个 child, 不在 .app-layout flex 容器中占空间
   CSS 保持 height: 0 + overflow: hidden, 默认 0 高度, 不影响布局 */
.pull-to-refresh-indicator {
    height: 0;
    overflow: hidden;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    transition: height 0.2s ease-out;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.pull-to-refresh-indicator.pulling { height: 50px; }
.pull-to-refresh-indicator.refreshing { height: 50px; }
.pull-to-refresh-spinner {
    display: inline-block;
    width: 18px; height: 18px;
    border: 2px solid var(--muted);
    border-top-color: transparent;
    border-radius: 50%;
    animation: ptr-spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}
@keyframes ptr-spin {
    to { transform: rotate(360deg); }
}

/* ===== 2026-06-16: iOS 视觉震动反馈 (vibrate-feedback) =====
   iOS WebView 不支持 navigator.vibrate, 但用户期望按按钮时有"触觉感"。
   用 CSS 缩放 + 半透明白色脉冲模拟, 仅触摸设备生效。
   - 普通按钮: 缩放 0.94 + 亮度降 8% (100ms)
   - 主操作按钮 (.btn-primary): 额外加半透明白脉冲 (ripple 效果)
   桌面 hover 不受影响 (因为整段在触摸设备媒体查询内) */
@media (hover: none) and (pointer: coarse) {
    .btn:active,
    button:active:not(:disabled),
    .row-action-btn:active,
    .actionsheet-btn:active,
    .track-card:active,
    .nav-item:active {
        transform: scale(0.94);
        transition: transform 0.08s ease-out;
        filter: brightness(0.92);
    }
    /* ripple 仅对主操作按钮 + actionsheet 项 (避免每个按钮都闪, 太嘈杂) */
    .btn-primary,
    .actionsheet-btn {
        position: relative;
        overflow: hidden;
    }
    .btn-primary:active::after,
    .actionsheet-btn:active::after {
        content: '';
        position: absolute;
        inset: 0;
        background: rgba(255, 255, 255, 0.25);
        border-radius: inherit;
        pointer-events: none;
        animation: vibrate-pulse 0.18s ease-out;
    }
    @keyframes vibrate-pulse {
        0%   { opacity: 1; transform: scale(1); }
        100% { opacity: 0; transform: scale(1.15); }
    }
}

/* ===== 2026-06-17 v4.1.1: 歌单页批量选择 - 移动端适配 ===== */
.pl-mobile-hint { display: none; }

@media (max-width: 768px) {
    /* 移动端显示长按提示 */
    .pl-mobile-hint { display: block; }

    /* 操作栏: 桌面端顶部, 移动端固定在 mobile-nav 上方 (避免与底部导航重叠)
       --mobile-nav-height = 50px + safe-area (在 mobile-nav 块定义)
       额外 + 8px 间隙 */
    .pl-action-bar {
        position: fixed !important;
        bottom: calc(var(--mobile-nav-height, 50px) + 8px) !important;
        left: 12px !important;
        right: 12px !important;
        width: auto !important;
        background: var(--bg-card) !important;
        padding: 10px 12px !important;
        border-radius: 12px !important;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2) !important;
        z-index: 970 !important;  /* 高于 player-bar (960) 跟 mobile-nav (949), 始终可见 */
        border: 1px solid var(--border) !important;
        gap: 6px !important;
    }
    .pl-action-bar > .pl-action-label { display: none; }
    .pl-action-bar > .pl-action-btn,
    .pl-action-bar > #pl-batch-delete-btn {
        flex: 1 !important;
        padding: 12px 8px !important;
        font-size: 14px !important;
        min-height: 44px;  /* 手指最小点击区 */
    }
    /* 给 page-playlists 底部留 padding, 避免被操作栏 + 底部 nav 遮 */
    #page-playlists { padding-bottom: calc(140px + var(--mobile-nav-height, 50px)) !important; }
    /* AI 歌单区同理 */
    #ai-pl-section { padding-bottom: 24px; }
}

@media (min-width: 769px) {
    .pl-action-bar { background: transparent; padding: 0; }
}

/* ===================================================================
   2026-06-17 v4.2: admin 3 个 tab (操作日志/系统日志/仪表盘) - 9 主题适配 + 移动端
   页面 ID: page-admin-logs / page-admin-syslog / page-admin-dashboard
   =================================================================== */

/* 移动端: input/select 全宽堆叠 */
@media (max-width: 768px) {
    /* logs/syslog 顶部筛选器 — 2x2 grid 紧凑布局 */
    #page-admin-logs > div:first-child,
    #page-admin-syslog > div:first-child {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
        align-items: center !important;
    }
    #page-admin-logs > div:first-child > label,
    #page-admin-syslog > div:first-child > label {
        display: none !important;
    }
    #page-admin-logs select,
    #page-admin-logs input,
    #page-admin-syslog select,
    #page-admin-syslog input {
        width: 100% !important;
        min-width: 0 !important;
        flex: none !important;
        font-size: 12px;
        padding: 2px 5px !important;
        height: 28px !important;
        box-sizing: border-box;
    }
    /* 按钮占满整行 */
    #page-admin-logs > div:first-child > button,
    #page-admin-syslog > div:first-child > button {
        grid-column: 1 / -1;
        font-size: 12px;
        padding: 4px 8px;
        height: 30px;
    }
    /* 天数输入放第二列, 级别+天数放第一列 */
    #page-admin-syslog > div:first-child > input:last-of-type {
        grid-column: 1 / -1;
    }
    /* 系统日志标题下的说明文字隐藏, 移动端浪费空间 */
    #page-admin-syslog > p {
        display: none;
    }
    /* 操作日志页面的 label 和标题缩小 */
    #page-admin-logs h3,
    #page-admin-syslog h3 {
        font-size: 14px;
        margin: 8px 0 6px !important;
    }
    #page-admin-syslog h3 {
        margin: 2px 0 4px !important;
        font-size: 14px;
    }
    /* 系统日志页面容器整体 padding 缩小 */
    #page-admin-syslog > div:first-child {
        margin-bottom: 6px !important;
    }
    #page-admin-syslog select,
    #page-admin-syslog input {
        font-size: 11px;
        padding: 2px 4px !important;
        height: 26px !important;
        border-radius: 4px !important;
    }

    /* 仪表盘 stat-card 单列 */
    #page-admin-dashboard > div:first-child {
        grid-template-columns: 1fr !important;
    }
    #page-admin-dashboard .stat-card {
        padding: 14px !important;
    }
    #page-admin-dashboard .stat-card .stat-value {
        font-size: 1.5em !important;
    }
    #page-admin-dashboard > h3 {
        font-size: 14px;
        margin: 12px 0 6px !important;
    }

    /* log-item 移动端: flex-column, metadata 一行, content 一行, 单行省略 */
    #page-admin-logs .log-item[style*="display:flex"],
    #page-admin-syslog .log-item[style*="display:flex"] {
        flex-direction: column !important;
        gap: 2px !important;
        padding: 6px 8px !important;
        font-size: 11px !important;
        align-items: flex-start !important;
    }
    /* 时间戳 span */
    #page-admin-logs .log-item > span:first-child,
    #page-admin-syslog .log-item > span:first-child {
        min-width: 0 !important;
        width: auto !important;
        font-size: 10px !important;
    }
    /* 操作日志: badge + action + username 一行, target 单独一行 */
    #page-admin-logs .log-item > span:nth-child(2),
    #page-admin-logs .log-item > span:nth-child(3),
    #page-admin-logs .log-item > span:nth-child(4) {
        display: inline-block !important;
    }
    /* target (5) 行: 单独一行, 截断 */
    #page-admin-logs .log-item > span:nth-child(5) {
        width: 100% !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        margin-top: 2px;
        color: var(--text-secondary);
    }
    /* 系统日志: time + level + component 一行, message 单独一行 */
    #page-admin-syslog .log-item > span:nth-child(1),
    #page-admin-syslog .log-item > span:nth-child(2),
    #page-admin-syslog .log-item > span:nth-child(3) {
        display: inline-block !important;
    }
    /* message (4) 行: 单独一行, 截断 */
    #page-admin-syslog .log-item > span:nth-child(4) {
        width: 100% !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        margin-top: 2px;
    }
    /* 系统日志 request_path (5) 行隐藏 */
    #page-admin-syslog .log-item > span:nth-child(5) {
        display: none !important;
    }

    /* 24h timeline 在 mobile 高度调整 */
    #page-admin-dashboard > div[style*="height:140px"] {
        height: 100px !important;
    }
    #page-admin-dashboard > div[style*="height:140px"] > div > div:first-child {
        max-height: 70px !important;
    }
    #page-admin-dashboard > div[style*="height:140px"] > div > div:last-child {
        font-size: 7px !important;
    }
}

/* ===================================================================
   2026-06-17 v4.2 任务9: PC 端体验升级 - 批次 A (Hover 缩放 + input focus)
   所有规则都在 @media (min-width: 1025px) 内, 移动端不生效
   =================================================================== */

@media (min-width: 1025px) {
    /* 卡片 hover 缩放 + 阴影 (专辑/歌单/艺术家/搜索结果) */
    .album-card,
    .artist-card,
    .playlist-card,
    .search-result-card,
    [class*="-card"]:not(.stat-card):not(.log-item) {
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        cursor: pointer;
    }
    .album-card:hover,
    .artist-card:hover,
    .playlist-card:hover,
    .search-result-card:hover,
    .album-grid .album-card:hover,
    .album-list .album-card:hover,
    .artist-grid .artist-card:hover,
    .artist-list .artist-card:hover,
    .playlist-grid .playlist-card:hover {
        transform: scale(1.03) !important;
        box-shadow: 0 8px 24px rgba(0,0,0,0.15) !important;
        z-index: 2;
        position: relative;
    }

    /* input / select / textarea focus 时 accent 边框 */
    input:focus,
    select:focus,
    textarea:focus,
    button:focus {
        outline: none;
        border-color: var(--accent) !important;
        box-shadow: 0 0 0 3px var(--accent-glow);
    }
    /* 暗色主题 focus 时阴影用更亮的 glow */
    [data-theme="dark"] input:focus,
    [data-theme="dark"] select:focus,
    [data-theme="dark"] textarea:focus {
        box-shadow: 0 0 0 3px var(--accent-glow);
    }
}
