:root {
    --sidebar-width: 260px;
    --border-color: #e0e0e0;
    --text-primary: #000;
    --hover-bg: #f5f5f5;
}

body {
    background-color: #fff;
}

/* ==========================================================================
   主布局 - 左对齐 & 顶部修复
   ========================================================================== */
/* filter.css */

.main-layout {
    /* 核心修复：必须保留 display: flex，否则侧边栏会跑到上面去 */
    display: flex;
    flex-direction: row; /* 强制让侧边栏和内容区左右排布 */
    align-items: flex-start; /* 顶部对齐 */
    
    /* 宽度控制：实现 Metacritic 效果 */
    max-width: 1280px;       /* 设置最大宽度 */
    width: 95%;              /* 在小屏幕下占 95% 宽，防止贴边 */
    margin: 100px auto 40px; /* 上下保留边距，关键是 'auto' 让左右自动居中 */
    
    /* 布局间距 */
    gap: 40px;               /* 侧边栏和右侧内容的间距 */
    position: relative;
    box-sizing: border-box;
    padding: 0;              /* 内边距清零，由 width 控制留白 */
}

/* ==========================================================================
   左侧边栏 (Sticky + Scrollable)
   ========================================================================== */
.sidebar-container {
    width: var(--sidebar-width);
    flex-shrink: 0;
    position: sticky;
    top: 80px; /* 距离顶部的吸附位置 */
    max-height: calc(100vh - 100px); /* 防止过长无法滚动 */
    overflow-y: auto;
    scrollbar-width: thin; /* Firefox 细滚动条 */
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #000;
}

.sidebar-header h2 {
    font-size: 20px;
    font-weight: 800;
    margin: 0;
    letter-spacing: 0.5px;
    color: var(--text-primary);
}

.reset-link {
    background: none;
    border: none;
    color: #666;
    text-decoration: underline;
    font-size: 11px;
    cursor: pointer;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.reset-link:hover {
    color: #000;
}

/* 筛选组 */
.filter-group {
    margin-bottom: 30px;
}

.group-header {
    font-size: 20px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

/* 列表样式 */
.filter-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-item {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    padding: 4px 0;
    background: none;
    border: none;
    text-align: left;
    width: 100%;
    transition: color 0.2s ease;
}

.filter-item:hover .label {
    text-decoration: underline;
    color: #000;
}

/* 隐藏超出数量的项目 */
.hidden-filter-item {
    display: none !important;
}

/* Show More 按钮 */
.show-more-btn {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    color: #2575fc;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    padding: 8px 0 0 0;
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}

.show-more-btn:hover {
    color: #1a5fc7;
    text-decoration: underline;
}

.show-more-btn span {
    margin-left: 4px;
    font-size: 14px;
    line-height: 1;
}

/* 复选框样式 */
.checkbox-box {
    width: 16px;
    height: 16px;
    border: 1px solid #ccc;
    border-radius: 2px;
    margin-right: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: #fff;
    transition: all 0.2s ease;
}

.filter-item.active .checkbox-box,
.filter-item.selected .checkbox-box {
    background-color: #000;
    border-color: #000;
}

/* 对勾 */
.filter-item.active .checkbox-box::after,
.filter-item.selected .checkbox-box::after {
    content: '';
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.filter-item.active .label,
.filter-item.selected .label {
    font-weight: 700;
    color: #000;
}

/* ==========================================================================
   右侧内容区
   ========================================================================== */
.content-area {
    flex-grow: 1;
    min-width: 0;
}

.content-header {
    margin-bottom: 20px;
}

.content-header h1 {
    margin: 0 0 20px 0;
    font-size: 32px;
    text-align: left;
    transform: none;
    left: auto;
    font-weight: 800;
    position: relative;
}

.content-header h1::after {
    display: none;
}

/* 活动标签 */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 0;
}

.active-filter-tag {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    padding: 6px 12px;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
}

.active-filter-tag:hover {
    background: #e0e0e0;
    border-color: #ccc;
}

.active-filter-tag .remove-filter {
    margin-left: 8px;
    font-size: 16px;
    line-height: 1;
    color: #999;
}

.active-filter-tag:hover .remove-filter {
    color: #000;
}

/* 分页修正 */
.pagination {
    margin-top: 60px;
}

.pagination-controls {
    display: inline-flex;
    gap: 10px;
    flex-wrap: nowrap;
}

.pagination button {
    border-radius: 4px !important;
    padding: 8px 16px !important;
    min-width: auto !important;
    background: #000 !important;
    box-shadow: none !important;
}

.pagination button:hover:not(:disabled) {
    background: #333 !important;
    transform: translateY(-2px);
}

.pagination button:disabled {
    background: #ccc !important;
}

/* ==========================================================================
   移动端适配
   ========================================================================== */
.mobile-filter-trigger {
    display: none;
}

@media (max-width: 900px) {
    .main-layout {
        flex-direction: column;
        gap: 20px;
        margin: 80px 0 30px 0; /* 移动端不需要这么大的上边距 */
        padding: 0 15px;
        width: 100%;
    }

    .sidebar-container {
        width: 100%;
        border-bottom: 1px solid #eee;
        position: static; /* 移动端取消 sticky */
        max-height: none;
        overflow: visible;
    }

    .sidebar-header {
        display: none;
    }

    .mobile-filter-trigger {
        display: flex;
        width: 100%;
        padding: 15px;
        background: #f8f8f8;
        border: 1px solid #eee;
        font-weight: 700;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0;
        cursor: pointer;
        font-size: 14px;
        text-transform: uppercase;
    }

    .filter-panel {
        display: none;
        background: #fff;
        border: 1px solid #eee;
        border-top: none;
        padding: 20px;
    }

    .filter-panel.open {
        display: block;
        animation: slideDown 0.3s ease-out;
    }
    
    .sort-options-list {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .sort-options-list .filter-item {
        width: auto;
        background: #f0f0f0;
        padding: 6px 12px;
        border-radius: 20px;
        margin-right: 5px;
    }
    
    .sort-options-list .checkbox-box {
        display: none;
    }
    
    .sort-options-list .filter-item.selected {
        background: #000;
        color: #fff;
    }
    
    .sort-options-list .filter-item.selected .label {
        color: #fff;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}