/* ==================== 市场页面样式 ==================== */

/* 市场主容器 */
.market-main {
    padding-top: 120px;
    min-height: calc(100vh - 200px);
}

/* ==================== 市场头部 ==================== */
.market-header {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.search-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 2rem;
}

.search-box {
    flex: 1;
    position: relative;
    max-width: 600px;
}

.search-box i {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.25rem;
}

.search-box input {
    width: 100%;
    padding: 1rem 1rem 1rem 4rem;
    font-size: 1rem;
    border: 2px solid rgba(108, 92, 231, 0.2);
    border-radius: 30px;
    background: white;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.1);
}

.search-box input::placeholder {
    color: var(--text-secondary);
}

.view-toggle {
    display: flex;
    gap: 0.5rem;
    background: white;
    padding: 0.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.view-btn {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1.25rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-btn:hover,
.view-btn.active {
    background: var(--primary-color);
    color: white;
}

/* ==================== 筛选栏 ==================== */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    background: white;
    border: 2px solid rgba(108, 92, 231, 0.2);
    border-radius: 30px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.filter-btn i {
    font-size: 1rem;
    color: var(--primary-color);
}

.filter-btn .count {
    background: rgba(108, 92, 231, 0.1);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-color);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.filter-btn:hover i,
.filter-btn.active i {
    color: white;
}

.filter-btn:hover .count,
.filter-btn.active .count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.sort-group {
    display: flex;
    gap: 0.75rem;
}

.sort-btn {
    padding: 0.75rem 1.25rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.sort-btn:hover,
.sort-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.sort-btn i {
    font-size: 0.85rem;
}

/* ==================== 市场内容区域 ==================== */
.market-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 2rem;
}

/* ==================== 侧边栏 ==================== */
.sidebar {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.filter-section h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.filter-section h3 i {
    color: var(--primary-color);
}

.filter-item {
    margin-bottom: 2rem;
}

.filter-item h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* 价格范围 */
.price-range {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.price-range input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.95rem;
    text-align: center;
    transition: all 0.3s ease;
}

.price-range input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.price-range span {
    color: var(--text-secondary);
    font-weight: 600;
}

.price-slider {
    width: 100%;
    -webkit-appearance: none;
    height: 8px;
    border-radius: 4px;
    background: var(--light-bg);
    outline: none;
}

.price-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(108, 92, 231, 0.3);
    transition: transform 0.2s ease;
}

.price-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

/* 复选框组 */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkbox-label input {
    display: none;
}

.checkmark {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.checkmark::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.8rem;
    color: white;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
}

.checkbox-label input:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input:checked + .checkmark::after {
    opacity: 1;
    transform: scale(1);
}

.checkbox-label:hover {
    color: var(--primary-color);
}

/* 创作者列表 */
.creator-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.creator-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.creator-label input {
    display: none;
}

.creator-label img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.creator-label span {
    flex: 1;
    font-weight: 500;
}

.creator-label .creator-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.creator-label:hover {
    background: rgba(108, 92, 231, 0.05);
    border-radius: 10px;
    padding: 0.5rem;
    margin: -0.5rem;
}

/* 区块链列表 */
.chain-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chain-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chain-label input {
    display: none;
}

.chain-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.7rem;
    color: white;
}

.chain-icon.eth {
    background: linear-gradient(135deg, #627eea 0%, #9963f7 100%);
}

.chain-icon.polygon {
    background: linear-gradient(135deg, #8247e5 0%, #c54f8d 100%);
}

.chain-icon.bsc {
    background: linear-gradient(135deg, #f3ba2f 0%, #f0b90b 100%);
}

.chain-label:hover {
    background: rgba(108, 92, 231, 0.05);
    border-radius: 10px;
    padding: 0.5rem;
    margin: -0.5rem;
}

/* 筛选按钮 */
.btn-apply-filters,
.btn-reset-filters {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.75rem;
}

.btn-apply-filters {
    background: var(--gradient-1);
    color: white;
    border: none;
}

.btn-apply-filters:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 92, 231, 0.3);
}

.btn-reset-filters {
    background: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
}

.btn-reset-filters:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* ==================== NFT 容器 ==================== */
.nft-container {
    flex: 1;
}

.results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--light-bg);
}

.results-count {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.btn-filters-toggle {
    display: none;
    padding: 0.75rem 1.5rem;
    background: var(--gradient-1);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-filters-toggle:hover {
    transform: translateY(-2px);
}

/* ==================== NFT 卡片（市场样式） ==================== */
.market-content .nft-card {
    position: relative;
}

.nft-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    color: white;
    z-index: 2;
}

.nft-badge.new {
    background: var(--success-color);
}

.nft-badge.rare {
    background: var(--accent-color);
}

.nft-badge.hot {
    background: var(--warning-color);
}

.btn-favorite {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    z-index: 2;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-favorite:hover {
    background: white;
    color: var(--danger-color);
    transform: scale(1.1);
}

.btn-favorite.active {
    color: var(--danger-color);
}

.nft-creator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.nft-creator img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.nft-creator span {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.nft-creator .verified {
    color: var(--success-color);
    font-size: 0.85rem;
}

.nft-price {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.nft-price > div:first-child {
    flex: 1;
}

.nft-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-action {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(108, 92, 231, 0.1);
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-action:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

/* ==================== 分页 ==================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--light-bg);
}

.page-btn {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    background: white;
    border: 1px solid var(--border-color);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-btn:hover:not(:disabled) {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.page-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-ellipsis {
    padding: 0 0.5rem;
    color: var(--text-secondary);
}

/* ==================== 列表视图 ==================== */
.nft-grid.list-view {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.nft-grid.list-view .nft-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2rem;
}

.nft-grid.list-view .nft-image {
    width: 280px;
    height: 280px;
    flex-shrink: 0;
}

.nft-grid.list-view .nft-info {
    flex: 1;
    padding: 2rem;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 1200px) {
    .market-content {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .sidebar.active {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1000;
        overflow-y: auto;
        border-radius: 0;
    }

    .btn-filters-toggle {
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
}

@media (max-width: 768px) {
    .search-container {
        flex-direction: column;
    }

    .search-box {
        max-width: 100%;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group,
    .sort-group {
        justify-content: flex-start;
    }

    .market-content {
        padding: 1rem;
    }

    .nft-grid.list-view .nft-card {
        flex-direction: column;
    }

    .nft-grid.list-view .nft-image {
        width: 100%;
        height: 280px;
    }
}

/* ==================== 动画效果 ==================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nft-card {
    animation: fadeInUp 0.5s ease;
}
