/* ============================================================
   MusicHub · 精准筛选页 + 专辑列表页 + 导航「复合」角标
   逐条取自 dsding.com 源码：app/filter/FilterClient.tsx、app/albums/[category]/page.tsx、
   components/CategoryTabs.tsx / AlbumGrid.tsx / Header.tsx
   尺寸换算：gap-4=16 gap-6=24 px-2 py-1=4/8 text-xs=12 text-[10px]=10 text-sm=14 text-base=16
             面板 280（桌面 sticky top-76）/ 抽屉 88%~380 / sm640 md768 lg1024 xl1280
   仅覆盖这两张新页面与导航角标，不改任何既有选择器，便于单独回滚。
   ============================================================ */

/* ---- 页面容器：与 dsding 主容器同宽同距（max-w-1150 / px-16 / pt-25 / pb-24），且不占侧栏轨道 ---- */
body.mh-filter-page .main-container,
body.mh-albums-page .main-container {
    display: block;
    max-width: var(--mh-site-width);
    margin: 0 auto;
    padding: 25px var(--mh-site-padding) 24px;
    box-sizing: border-box;
}
body.mh-filter-page .content-area,
body.mh-albums-page .content-area {
    width: 100%;
    max-width: none;
    min-width: 0;
    padding: 0;
}

/* ============================================================
   一、/filter 精准筛选
   ============================================================ */
.mh-fp-wrap { display: flex; flex-direction: column; gap: 16px; align-items: stretch; }
.mh-fp-results { flex: 1 1 auto; min-width: 0; }

/* ---- 手机端触发栏（md:hidden）---- */
.mh-fp-mobilebar {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--mh-border);
    background: var(--mh-surface);
    padding: 10px 12px;
}
.mh-fp-open {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: none;
    border: 1px solid rgba(240, 192, 64, 0.5);
    background: rgba(240, 192, 64, 0.10);
    color: var(--mh-gold-600, #d4a017);
    padding: 6px 12px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}
.mh-fp-open:hover { background: var(--mh-gold-500, #f0c040); color: #ffffff; }
.mh-fp-open svg { width: 16px; height: 16px; }
.mh-fp-open-n {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 20px;
    min-width: 20px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--mh-gold-500, #f0c040);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
}
[data-theme='dark'] .mh-fp-open { color: var(--mh-gold-400, #f2c94c); }
.mh-fp-mchips {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
}
.mh-fp-mchips::-webkit-scrollbar { display: none; }
.mh-fp-mempty { font-size: 12px; color: var(--mh-text-muted); }
.mh-fp-mchip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex: none;
    border: 1px solid rgba(240, 192, 64, 0.4);
    background: rgba(240, 192, 64, 0.10);
    padding: 2px 8px;
    font-size: 12px;
    color: var(--mh-gold-600, #d4a017);
    text-decoration: none;
}
[data-theme='dark'] .mh-fp-mchip { color: var(--mh-gold-400, #f2c94c); }
.mh-fp-mchip-x { color: rgba(240, 192, 64, 0.7); }

/* ---- 抽屉遮罩 ---- */
.mh-fp-overlay {
    position: fixed;
    inset: 0;
    z-index: 400;
    background: rgba(0, 0, 0, 0.5);
}
.mh-fp-overlay[hidden] { display: none; }

/* ---- 面板：手机端右侧滑入抽屉 ---- */
.mh-fp-panel {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    z-index: 500;
    display: flex;
    flex-direction: column;
    width: 88%;
    max-width: 380px;
    background: var(--mh-surface);
    border-left: 1px solid var(--mh-border);
    transform: translateX(100%);
    transition: transform 0.3s ease-out;
    box-sizing: border-box;
}
body.mh-fp-open .mh-fp-panel { transform: translateX(0); }
body.mh-fp-open { overflow: hidden; }

.mh-fp-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--mh-border-light);
    padding: 12px 16px;
    flex: none;
}
.mh-fp-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--mh-text);
}
.mh-fp-title-bar { width: 4px; height: 16px; background: var(--mh-gold-500, #f0c040); flex: none; }
.mh-fp-head-right { display: flex; align-items: center; gap: 8px; }
.mh-fp-clear { font-size: 12px; color: var(--mh-text-muted); text-decoration: none; transition: color 0.2s; }
.mh-fp-clear:hover { color: var(--mh-gold-600, #d4a017); }
[data-theme='dark'] .mh-fp-clear:hover { color: var(--mh-gold-400, #f2c94c); }
.mh-fp-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    padding: 0;
    border: none;
    background: none;
    color: var(--mh-text-muted);
    cursor: pointer;
}
.mh-fp-close:hover { color: var(--mh-text); }
.mh-fp-close svg { width: 20px; height: 20px; }

.mh-fp-panel-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 16px;
}
.mh-fp-dim + .mh-fp-dim { margin-top: 20px; }
.mh-fp-dim-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.mh-fp-dim-title {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--mh-text-secondary);
}
[data-theme='dark'] .mh-fp-dim-title { color: var(--mh-text); }
.mh-fp-dim-icon { color: var(--mh-gold-500, #f0c040); }
.mh-fp-dim-more {
    border: none;
    background: none;
    padding: 0;
    font-size: 11px;
    color: var(--mh-text-muted);
    cursor: pointer;
    transition: color 0.2s;
}
.mh-fp-dim-more:hover { color: var(--mh-gold-600, #d4a017); }
[data-theme='dark'] .mh-fp-dim-more:hover { color: var(--mh-gold-400, #f2c94c); }
.mh-fp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mh-fp-chip {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--mh-border);
    background: var(--mh-surface-hover);
    padding: 4px 8px;
    font-size: 12px;
    color: var(--mh-text-secondary);
    text-decoration: none;
    transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}
.mh-fp-chip:hover { border-color: var(--mh-gold-400, #f2c94c); color: var(--mh-gold-600, #d4a017); }
[data-theme='dark'] .mh-fp-chip:hover { border-color: rgba(242, 201, 76, 0.6); color: var(--mh-gold-400, #f2c94c); }
.mh-fp-chip.is-active {
    border-color: var(--mh-gold-500, #f0c040);
    background: var(--mh-gold-500, #f0c040);
    color: #ffffff;
}
.mh-fp-chip-count { margin-left: 4px; font-size: 10px; color: var(--mh-text-muted); }
.mh-fp-chip.is-active .mh-fp-chip-count { color: rgba(255, 255, 255, 0.8); }
.mh-fp-noopt { font-size: 12px; color: var(--mh-text-muted); }
/* 折叠：超过 10 项的先藏起来，点「全部 N 项」展开 */
.mh-fp-chips.is-folded .mh-fp-chip.is-extra { display: none; }

.mh-fp-panel-foot {
    flex: none;
    border-top: 1px solid var(--mh-border-light);
    padding: 12px;
}
.mh-fp-apply {
    display: block;
    width: 100%;
    border: none;
    background: var(--mh-gold-500, #f0c040);
    color: #a80034;
    padding: 10px 0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}
.mh-fp-apply:hover { background: var(--mh-gold-400, #f2c94c); }

/* ---- 桌面工具条 ---- */
.mh-fp-toolbar { display: none; }
.mh-fp-toolbar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mh-fp-count { font-size: 14px; color: var(--mh-text-secondary); }
.mh-fp-tchip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 1px solid rgba(240, 192, 64, 0.4);
    background: rgba(240, 192, 64, 0.10);
    padding: 2px 8px;
    font-size: 12px;
    color: var(--mh-gold-600, #d4a017);
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}
.mh-fp-tchip:hover { background: var(--mh-gold-500, #f0c040); color: #ffffff; }
[data-theme='dark'] .mh-fp-tchip { color: var(--mh-gold-400, #f2c94c); }
[data-theme='dark'] .mh-fp-tchip:hover { color: #ffffff; }
.mh-fp-tchip-x { color: rgba(240, 192, 64, 0.7); }
.mh-fp-tchip:hover .mh-fp-tchip-x { color: rgba(255, 255, 255, 0.8); }
.mh-fp-hint { font-size: 12px; color: var(--mh-text-muted); }

/* ---- 结果网格（grid-cols-2 sm:3 lg:4）---- */
.mh-fp-list { margin-top: 16px; }
.mh-grid-filter { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

/* ---- 分页（‹ 上一页  N / M  下一页 ›）---- */
.mh-fp-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 32px; }
.mh-fp-page {
    display: inline-block;
    border: 1px solid var(--mh-border);
    background: var(--mh-surface);
    padding: 6px 16px;
    font-size: 14px;
    color: var(--mh-text-secondary);
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
}
.mh-fp-page:hover { border-color: var(--mh-gold-500, #f0c040); color: var(--mh-gold-600, #d4a017); }
.mh-fp-page.is-disabled { opacity: 0.4; pointer-events: none; }
.mh-fp-page-info { font-size: 14px; color: var(--mh-text-muted); }

/* ---- 空态 ---- */
.mh-fp-empty {
    border: 1px solid var(--mh-border);
    background: var(--mh-surface);
    padding: 80px 16px;
    text-align: center;
}
.mh-fp-empty-icon { font-size: 36px; line-height: 1; color: var(--mh-border); }
.mh-fp-empty-text { margin: 12px 0 0; font-size: 14px; color: var(--mh-text-muted); }
.mh-fp-empty-clear {
    display: inline-block;
    margin-top: 16px;
    border: 1px solid rgba(240, 192, 64, 0.5);
    background: rgba(240, 192, 64, 0.10);
    padding: 6px 16px;
    font-size: 14px;
    color: var(--mh-gold-600, #d4a017);
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}
.mh-fp-empty-clear:hover { background: var(--mh-gold-500, #f0c040); color: #ffffff; }
[data-theme='dark'] .mh-fp-empty-clear { color: var(--mh-gold-400, #f2c94c); }

/* ---- 局部刷新骨架（8 块，animate-pulse）---- */
.mh-fp-skeleton { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.mh-fp-skeleton i {
    display: block;
    aspect-ratio: 1 / 1;
    background: var(--mh-border-light);
    animation: mh-fp-pulse 1.6s ease-in-out infinite;
}
@keyframes mh-fp-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }

/* ---- ≥768：左右布局 + 面板转 sticky，抽屉与触发栏退场 ---- */
@media (min-width: 768px) {
    .mh-fp-wrap { flex-direction: row; align-items: flex-start; gap: 24px; }
    .mh-fp-mobilebar,
    .mh-fp-panel-foot,
    .mh-fp-close { display: none; }
    .mh-fp-overlay { display: none !important; }
    .mh-fp-panel {
        position: sticky;
        top: 76px;
        display: block;
        flex: 0 0 280px;
        width: 280px;
        max-width: none;
        transform: none;
        border: 1px solid var(--mh-border);
        border-left: 1px solid var(--mh-border);
        transition: none;
    }
    .mh-fp-panel-body { max-height: calc(100vh - 160px); }
    .mh-fp-toolbar {
        display: block;
        border: 1px solid var(--mh-border);
        background: var(--mh-surface);
        padding: 12px 16px;
    }
    .mh-fp-skeleton,
    .mh-grid-filter { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 640px) {
    .mh-fp-skeleton,
    .mh-grid-filter { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1024px) {
    .mh-fp-skeleton,
    .mh-grid-filter { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ============================================================
   二、/albums/{主分类} 专辑列表
   ============================================================ */
.mh-ap-stack > * + * { margin-top: 24px; }
.mh-ap-head { display: flex; align-items: center; justify-content: space-between; }
.mh-ap-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--mh-text);
}
.mh-ap-title-bar { width: 4px; height: 20px; background: var(--mh-gold-500, #f0c040); flex: none; }
.mh-ap-count { font-size: 14px; color: var(--mh-text-muted); }

.mh-ap-tabs { border: 1px solid var(--mh-border); background: var(--mh-surface); padding: 16px; }
.mh-ap-tabs-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mh-ap-tab {
    display: inline-block;
    border: 1px solid var(--mh-border);
    background: var(--mh-surface-hover);
    padding: 6px 12px;
    font-size: 14px;
    color: var(--mh-text-secondary);
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
}
.mh-ap-tab:hover { border-color: var(--mh-gold-400, #f2c94c); color: var(--mh-gold-600, #d4a017); }
[data-theme='dark'] .mh-ap-tab:hover { border-color: rgba(242, 201, 76, 0.6); color: var(--mh-gold-400, #f2c94c); }
.mh-ap-tab.is-active {
    border-color: var(--mh-gold-500, #f0c040);
    background: var(--mh-gold-500, #f0c040);
    color: #ffffff;
    font-weight: 500;
}
.mh-ap-tab.is-extra { display: none; }
.mh-ap-tabs-row.is-expanded .mh-ap-tab.is-extra { display: inline-block; }
.mh-ap-tab-more {
    border: 1px dashed var(--mh-border);
    background: none;
    padding: 6px 12px;
    font-size: 14px;
    color: var(--mh-text-muted);
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
}
.mh-ap-tab-more:hover { border-color: var(--mh-gold-400, #f2c94c); color: var(--mh-gold-600, #d4a017); }

/* 列表网格：grid-cols-2 sm:3 md:4 lg:5 xl:6 */
.mh-grid-albums { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (min-width: 640px)  { .mh-grid-albums { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 768px)  { .mh-grid-albums { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .mh-grid-albums { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .mh-grid-albums { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* AlbumGrid 的分页按钮是灰底（与 /filter 描边款不同），逐字照搬 */
.mh-ap-page {
    display: inline-block;
    background: var(--mh-surface-hover);
    padding: 6px 16px;
    font-size: 14px;
    color: var(--mh-text-secondary);
    text-decoration: none;
    transition: background-color 0.2s;
}
.mh-ap-page:hover { background: var(--mh-border); }
.mh-ap-page.is-disabled { color: var(--mh-text-muted); cursor: not-allowed; }
.mh-ap-empty { padding: 64px 0; text-align: center; color: var(--mh-text-muted); }
.mh-ap-empty .mh-fp-empty-icon { margin-bottom: 8px; }

/* ============================================================
   三、导航「复合」角标（dsding Header.tsx：金边金字小方块）
   ============================================================ */
.mh-nav-badge {
    display: inline-block;
    margin-left: 6px;
    border: 1px solid rgba(240, 192, 64, 0.7);
    background: rgba(240, 192, 64, 0.15);
    padding: 0 4px;
    font-size: 10px;
    line-height: 1.3;
    color: var(--mh-gold-400, #f2c94c);
}
.mh-header-nav-mobile .mh-nav-badge { margin-left: 4px; }
