/**
 * JazzMore 全局布局公共样式
 * 适用于：热门榜单、精选艺人、全部艺人、精选专辑、全部专辑
 */

/* ===================== 全局重置 ===================== */
/* 覆盖 Astra 主题默认内边距，防止内容区出现多余空白 */
.ast-article-single,
.ast-page-builder-template .entry-content,
.entry-content {
    padding: 0 !important;
    margin: 0 !important;
}

/* 修复 Astra 主题在 922px+ 给 .ast-container 加 display:flex 导致的布局问题 */
@media (min-width: 922px) {
    .site-content .ast-container {
        display: block !important;
    }
}

/* ===================== 页面外层包裹 ===================== */
.jazzmore-page-wrapper {
    background: #F5F5F7;
    min-height: calc(100vh - 80px);
    padding: 1.5rem;
    /* 撑满 Astra 内容区，防止右侧露出主题背景色 */
    margin: 0 -9999px;
    padding-left: calc(9999px + 1.5rem);
    padding-right: calc(9999px + 1.5rem);
    box-sizing: border-box;
}

/* ===================== 主布局 Flex 容器 ===================== */
.jazzmore-global-layout {
    display: flex;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* ===================== 左侧边栏 ===================== */
.jazzmore-global-sidebar {
    width: 220px;
    min-width: 220px;
    flex-shrink: 0;
}

.jazzmore-genre-sidebar {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    height: fit-content;
    position: sticky;
    top: 2rem;
}

/* ===================== 主内容区 ===================== */
.jazzmore-global-main {
    flex: 1;
    min-width: 0;
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    box-sizing: border-box;
    overflow: hidden;
}

/* ===================== 页面标题区 ===================== */
.page-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #E5E7EB;
}
.page-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1F2937;
    margin: 0 0 0.5rem;
}
.page-title .dashicons {
    color: #4F46E5;
}
.page-subtitle {
    font-size: 0.95rem;
    color: #6B7280;
    margin: 0;
}

/* ===================== 侧边栏导航按钮 ===================== */
.nav-buttons {
    list-style: none;
    margin: 0 0 0.5rem 0;
    padding: 0;
}
.nav-buttons li {
    margin-bottom: 0.25rem;
}
.nav-buttons a {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    text-decoration: none;
    color: #374151;
    font-size: 0.875rem;
    transition: all 0.2s;
}
.nav-buttons a:hover {
    background: #EEF2FF;
    color: #4F46E5;
}
.nav-buttons a.active {
    background: #4F46E5;
    color: #fff;
}
.nav-buttons a.active .dashicons,
.nav-buttons a:hover .dashicons {
    color: inherit;
}
.nav-buttons .dashicons {
    font-size: 1.1rem;
    color: #9CA3AF;
}

/* ===================== 侧边栏区块 ===================== */
.sidebar-section {
    margin-bottom: 1.25rem;
}
.sidebar-section:last-child {
    margin-bottom: 0;
}
.sidebar-section + .sidebar-section {
    padding-top: 1.25rem;
    border-top: 1px solid #F3F4F6;
}
.sidebar-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #4F46E5;
    margin: 0 0 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.sidebar-title .dashicons {
    font-size: 1rem;
}

/* ===================== 风格列表 ===================== */
.genre-list,
.album-type-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}
.genre-list li,
.album-type-list li {
    margin-bottom: 0;
}
.genre-list a,
.album-type-list a {
    display: inline-block;
    padding: 1px;
    border-radius: 3px;
    text-decoration: none;
    color: #6B7280;
    font-size: 10px;
    line-height: 1.3;
    background: transparent;
    border: none;
    transition: all 0.15s;
}
.genre-list a:hover,
.album-type-list a:hover {
    background: #EEF2FF;
    color: #4F46E5;
}
.genre-list a.active,
.album-type-list a.active {
    background: #4F46E5;
    color: #fff;
}
/* 隐藏数字计数 */
.genre-list .count,
.album-type-list .count {
    display: none;
}

/* 更多风格 */
.show-more-genres {
    display: block;
    margin-top: 0.375rem;
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
    color: #9CA3AF;
    text-decoration: none;
    text-align: center;
    border-radius: 6px;
    transition: all 0.2s;
}
.show-more-genres:hover {
    background: #F3F4F6;
    color: #4F46E5;
}

/* ===================== 筛选/排序栏 ===================== */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.filter-left {
    display: flex;
    gap: 1.25rem;
    align-items: center;
    flex-wrap: wrap;
}
.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.filter-group label {
    font-size: 0.875rem;
    color: #6B7280;
    white-space: nowrap;
}
.filter-select {
    padding: 0.4rem 2rem 0.4rem 0.625rem;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236B7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E") no-repeat right 0.5rem center;
    background-size: 1rem;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
    appearance: none;
}
.filter-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.clear-filters {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.625rem;
    background: #FEE2E2;
    color: #DC2626;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.8rem;
    transition: background 0.2s;
}
.clear-filters:hover { background: #FECACA; }
.clear-filters .dashicons { font-size: 0.9rem; }
.result-count {
    font-size: 0.875rem;
    color: #9CA3AF;
}

/* 已选筛选标签 */
.active-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    background: #EEF2FF;
    color: #4F46E5;
    border-radius: 20px;
    font-size: 0.8rem;
}
.filter-tag a {
    color: #4F46E5;
    text-decoration: none;
    font-weight: bold;
    line-height: 1;
}
.filter-tag a:hover { color: #3730A3; }

/* 字母排序栏 */
.alphabet-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 1rem;
}
.alpha-btn {
    min-width: 2rem;
    height: 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.25rem;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    text-decoration: none;
    color: #374151;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
}
.alpha-btn:hover {
    border-color: #4F46E5;
    color: #4F46E5;
}
.alpha-btn.active {
    background: #4F46E5;
    border-color: #4F46E5;
    color: #fff;
}

/* 排序按钮组 */
.sort-bar {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.sort-label {
    font-size: 0.875rem;
    color: #6B7280;
}
.sort-btn {
    padding: 0.3rem 0.75rem;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    text-decoration: none;
    color: #374151;
    font-size: 0.8rem;
    transition: all 0.2s;
}
.sort-btn:hover {
    border-color: #4F46E5;
    color: #4F46E5;
}
.sort-btn.active {
    background: #4F46E5;
    border-color: #4F46E5;
    color: #fff;
}

/* ===================== 行式列表（艺人 / 专辑）===================== */
.artists-list,
.albums-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.artist-row,
.album-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: #FAFAFA;
    border: 1px solid #F3F4F6;
    border-radius: 8px;
    transition: all 0.2s ease;
}
.artist-row:hover,
.album-row:hover {
    background: #fff;
    border-color: #E0E7FF;
    box-shadow: 0 2px 8px rgba(79,70,229,0.08);
    transform: translateX(2px);
}
.artist-row-thumb,
.album-row-thumb {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background: #F3F4F6;
}
.artist-row-thumb img,
.album-row-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.artist-no-image,
.album-no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #D1D5DB;
}
.artist-no-image .dashicons,
.album-no-image .dashicons {
    font-size: 1.5rem;
}

/* 艺人行 */
.artist-row-name {
    flex: 2;
    min-width: 0;
}
.artist-row-name a {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1F2937;
    text-decoration: none;
    transition: color 0.2s;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.artist-row-name a:hover { color: #4F46E5; }
.artist-row-albums {
    flex: 1;
    text-align: center;
    font-size: 0.85rem;
    color: #6B7280;
}
.artist-row-albums a {
    color: #6B7280;
    text-decoration: none;
    transition: color 0.2s;
}
.artist-row-albums a:hover { color: #4F46E5; }
.artist-row-years {
    flex: 1;
    text-align: center;
    font-size: 0.85rem;
    color: #9CA3AF;
}

/* 专辑行 */
.album-row-info {
    flex: 1;
    min-width: 0;
}
.album-row-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 0.2rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.album-row-title a {
    color: #1F2937;
    text-decoration: none;
    transition: color 0.2s;
}
.album-row-title a:hover { color: #4F46E5; }
.album-row-artist {
    display: block;
    font-size: 0.82rem;
    color: #6B7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.album-row-year {
    display: block;
    font-size: 0.78rem;
    color: #9CA3AF;
}

/* 右侧操作区 */
.artist-row-action,
.album-row-action {
    flex-shrink: 0;
}
.discogs-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    background: #EEF2FF;
    color: #4F46E5;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s;
}
.discogs-link:hover {
    background: #4F46E5;
    color: #fff;
}
.discogs-link .dashicons { font-size: 0.9rem; }

/* ===================== 分页 ===================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.375rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}
.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.625rem;
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    text-decoration: none;
    color: #374151;
    font-size: 0.875rem;
    transition: all 0.2s;
}
.page-link:hover:not(.disabled):not(.dots) {
    background: #EEF2FF;
    border-color: #4F46E5;
    color: #4F46E5;
}
.page-link.current {
    background: #4F46E5;
    border-color: #4F46E5;
    color: #fff;
}
.page-link.disabled { opacity: 0.4; cursor: not-allowed; }
.page-link.dots { border: none; background: transparent; }
.page-link.prev,
.page-link.next { padding: 0 0.875rem; }

/* ===================== 加载更多按钮 ===================== */
.show-more-container {
    text-align: center;
    margin: 1.5rem 0;
}
.show-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.75rem;
    background: #fff;
    color: #4F46E5;
    border: 2px solid #4F46E5;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}
.show-more-btn:hover {
    background: #4F46E5;
    color: #fff;
}

/* ===================== 无结果状态 ===================== */
.no-results {
    text-align: center;
    padding: 3rem 2rem;
    color: #6B7280;
}
.no-results .dashicons {
    font-size: 3rem;
    color: #D1D5DB;
    display: block;
    margin-bottom: 0.75rem;
}
.no-results p { font-size: 1rem; margin: 0 0 1rem; }
.btn-reset {
    display: inline-block;
    padding: 0.625rem 1.5rem;
    background: #4F46E5;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.2s;
    font-size: 0.9rem;
}
.btn-reset:hover { background: #4338CA; }

/* ===================== 响应式 ===================== */
@media (max-width: 1100px) {
    .artist-row-years,
    .album-row-year { display: none; }
}
@media (max-width: 900px) {
    .jazzmore-page-wrapper {
        padding: 1rem;
        margin: 0 -9999px;
        padding-left: calc(9999px + 1rem);
        padding-right: calc(9999px + 1rem);
    }
    .jazzmore-global-layout { flex-direction: column; }
    .jazzmore-global-sidebar {
        width: 100%;
        min-width: unset;
    }
    .jazzmore-genre-sidebar {
        position: static;
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
        padding: 1rem;
    }
    .sidebar-section { min-width: 180px; }
}
@media (max-width: 700px) {
    .artist-row-albums { display: none; }
}
@media (max-width: 480px) {
    .jazzmore-page-wrapper {
        padding: 0.625rem;
        padding-left: calc(9999px + 0.625rem);
        padding-right: calc(9999px + 0.625rem);
    }
    .jazzmore-global-main { padding: 1rem; }
    .artist-row-action,
    .album-row-action { display: none; }
    .pagination { gap: 0.25rem; }
    .page-link { min-width: 2rem; height: 2rem; font-size: 0.8rem; }
}
