body {
            font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
            padding-bottom: 120px;
            background-color: #f8f9fa;
            /* 性能优化 */
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
            text-rendering: optimizeSpeed;
        }
        /* 导航和头部样式 */
        header {
            position: sticky;
            top: 0;
            z-index: 1000;
        }
        .navbar {
            background-color: #1e88e5;
            padding: 0.5rem 1rem;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }
        .navbar-brand {
            font-weight: bold;
            font-size: 1.5rem;
        }
        .navbar-brand img {
            height: 50px;
            width: auto;
            object-fit: contain;
        }
        .search-bar {
            background-color: #f1f8fe;
            border-bottom: 1px solid #e3f2fd;
        }
        /* 左侧边栏样式 */
        .sidebar {
            position: sticky;
            top: 80px; /* 根据header高度调整 */
            height: calc(100vh - 80px);
            overflow-y: auto;
            background-color: #f5f5f5;
            border-right: 1px solid #e9ecef;
            padding: 20px 15px;
        }
    
        .category-sidebar {
            margin-top: 20px;
        }
        .sidebar-header h5 {
            color: #333;
            font-weight: 600;
            border-bottom: 2px solid #1e88e5;
            padding-bottom: 10px;
            font-size: 24px;
            text-align: center;
        }
        .category-list .btn {
            border-radius: 8px;
            border: 1px solid #e9ecef;
            color: #333;
            background-color: #fff;
            text-align: left;
            padding: 10px 15px;
            font-size: 0.92rem;
            transition: all 0.2s ease;
        }
        .category-list .btn:hover {
            background-color: #f8f9fa;
            border-color: #1e88e5;
            color: #1e88e5;
        }
        .category-list .btn.active {
            background-color: #1e88e5;
            border-color: #1e88e5;
            color: white;
        }
        .main-content {
            padding: 20px;
        }
        #searchInput {
            border-radius: 4px 0 0 4px;
            border: 1px solid #ced4da;
        }
        #searchButton {
            border-radius: 0 4px 4px 0;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .product-card {
            transition: transform 0.2s;
            border: none;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
            border-radius: 8px;
            overflow: hidden;
        }
        .product-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 10px rgba(0,0,0,0.15);
        }
        .horizontal-card .card-body {
            padding: 20px 15px;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            height: 100%;
            min-height: 140px;
        }
        .product-info {
            flex: 1;
        }
        .product-card .card-title {
            font-size: 1rem;
            margin-bottom: 8px;
            line-height: 1.4;
            font-weight: 500;
            color: #333;
        }
        .product-img-container {
            height: 120px;
            overflow: hidden;
            position: relative;
            background-color: #f8f9fa;
            cursor: pointer;
            border-radius: 8px;
            margin: 8px;
        }
        .horizontal-card .product-img-container {
            height: 100px;
        }
        .product-img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.3s;
            border-radius: 6px;
            /* 性能优化 */
            will-change: transform;
            backface-visibility: hidden;
        }
        .product-img-container:hover .product-img {
            transform: scale(1.05);
        }
        /* 图片查看器样式 */
        .image-viewer {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.9);
            z-index: 2000;
            justify-content: center;
            align-items: center;
            cursor: zoom-out;
        }
        .image-viewer img {
            max-width: 90%;
            max-height: 90%;
            object-fit: contain;
            border-radius: 12px;
        }
        .image-viewer-close {
            position: absolute;
            top: 20px;
            right: 20px;
            color: white;
            font-size: 30px;
            cursor: pointer;
        }
        .product-price {
            color: #e53935;
            font-weight: bold;
            font-size: 1.1rem;
            margin-bottom: 0;
            display: flex;
            align-items: baseline;
        }
        .price-number {
            font-size: 1.3rem;
        }
        .price-unit {
            font-size: 0.9rem;
            color: #666;
            margin-left: 2px;
        }
        .product-category {
            display: inline-block;
            background-color: #e3f2fd;
            color: #1e88e5;
            padding: 2px 8px;
            border-radius: 4px;
            font-size: 0.8rem;
            margin-bottom: 8px;
        }
        .stats-card {
            background-color: #fff;
            border-radius: 8px;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
            padding: 15px;
            margin-bottom: 20px;
        }
        .stats-number {
            font-size: 1.8rem;
            font-weight: bold;
            color: #1e88e5;
        }
        .stats-label {
            color: #757575;
            font-size: 0.9rem;
        }
        .loading {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 200px;
        }
        .spinner-border {
            width: 3rem;
            height: 3rem;
        }
        .no-products {
            text-align: center;
            padding: 50px 0;
            color: #757575;
        }
        #backToTop {
            position: fixed;
            bottom: 20px;
            right: 20px;
            display: none;
            z-index: 1000;
        }
        /* 购物车控制区域样式 */
        .cart-controls {
            display: flex;
            justify-content: flex-end;
            align-items: center;
            margin-top: 10px;
        }
        
        /* 购物车徽章样式 */
        #cartBadge {
            font-size: 0.7rem;
            min-width: 18px;
            height: 18px;
            line-height: 16px;
        }
        
        /* 商品数量控制按钮样式 */
        .quantity-controls {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 10px;
        }
        .quantity-btn {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            border: none;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
            cursor: pointer;
            flex-shrink: 0;
            box-shadow: 0 1px 3px rgba(0,0,0,0.2);
        }
        .quantity-btn .btn-icon {
            font-size: 16px;
            font-weight: bold;
            line-height: 1;
            /* text-shadow: 0 1px 2px rgba(0,0,0,0.3); */
        }
        .quantity-btn:hover {
            transform: scale(1.05);
        }
        .quantity-btn.minus {
            background-color: #dc3545;
            color: white;
        }
        .quantity-btn.minus:hover:not(:disabled) {
            background-color: #c82333;
        }
        .quantity-btn.minus:disabled {
            background-color: #e9ecef;
            color: #6c757d;
            cursor: not-allowed;
            box-shadow: none;
        }
        .quantity-btn.plus {
            background-color: #ff5722;
            color: white;
        }
        .quantity-btn.plus:hover {
            background-color: #e64a19;
        }
        .quantity-display {
            font-weight: bold;
            font-size: 1rem;
            color: #333;
            min-width: 30px;
            text-align: center;
            background-color: transparent;
            flex-shrink: 0;
        }
        
        
        /* 底部固定购物车样式 */
        .fixed-cart {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background-color: #fff;
            border-top: 1px solid #e9ecef;
            box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
            z-index: 1000;
            padding: 10px 0;
        }
        .cart-summary {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 15px;
        }
        .cart-info {
            display: flex;
            align-items: center;
            color: #333;
        }
        .cart-icon {
            font-size: 1.5rem;
            margin-right: 10px;
            color: #1e88e5;
            position: relative;
        }
        .cart-count {
            position: absolute;
            top: -8px;
            right: -8px;
            background-color: #dc3545;
            color: white;
            border-radius: 50%;
            width: 20px;
            height: 20px;
            font-size: 0.7rem;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
        }
        .cart-total {
            font-size: 1.1rem;
            font-weight: bold;
            color: #e53935;
        }
        .checkout-btn {
            background-color: #1e88e5;
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 20px;
            font-weight: bold;
            transition: all 0.2s ease;
        }
        .checkout-btn:hover {
            background-color: #1976d2;
            transform: translateY(-1px);
        }
        .checkout-btn:disabled {
            background-color: #ccc;
            transform: none;
        }
        
        /* 自定义布局优化 */
        .custom-sidebar {
            flex: 0 0 180px;
            max-width: 180px;
        }
        .custom-main-content {
            flex: 1;
            max-width: calc(100% - 180px);
        }
        .container-fluid .row {
            margin-left: 0;
            margin-right: 0;
        }
        
        /* PC和iPad优化 */
        @media (min-width: 769px) {
            .custom-sidebar {
                flex: 0 0 160px;
                max-width: 160px;
            }
            .custom-main-content {
                flex: 1;
                max-width: calc(100% - 160px);
            }
            .main-content {
                padding: 25px 15px 120px 15px;
            }
            .horizontal-card .card-body {
                padding: 25px 20px;
                min-height: 160px;
            }
            .horizontal-card .product-img-container {
                height: 120px;
                margin: 12px;
            }
            .product-card {
                margin-bottom: 4px;
            }
            .product-card .card-title {
                font-size: 1.1rem;
                margin-bottom: 12px;
                line-height: 1.5;
            }
            .product-price {
                font-size: 1.2rem;
            }
            .price-number {
                font-size: 1.4rem;
            }
            .cart-controls {
                margin-top: 15px;
            }
            .quantity-controls {
                gap: 12px;
            }
            .quantity-btn {
                width: 32px;
                height: 32px;
            }
            .quantity-display {
                font-size: 1.1rem;
                min-width: 35px;
            }
            /* 增加商品列表的整体间距 */
            #productList .col-12 {
                margin-bottom: 1.5rem;
            }
        }
        
        /* 大屏幕优化 */
        @media (min-width: 1200px) {
            .custom-sidebar {
                flex: 0 0 180px;
                max-width: 180px;
            }
            .custom-main-content {
                flex: 1;
                max-width: calc(100% - 150px);
            }
            .main-content {
                padding: 25px 20px 120px 20px;
            }
        }
        
        /* 移动端响应式 */
        @media (max-width: 768px) {
            .navbar-brand img {
                height: 40px;
            }
            .custom-sidebar {
                padding-right: 6px;
            }
            .custom-main-content {
                padding-left: 6px;
            }
            .sidebar {
                position: sticky;
                top: 80px;
                width: 120px;
                height: calc(100vh - 80px);
                overflow-y: auto;
                background-color: #f5f5f5;
                border-right: 1px solid #e9ecef;
                padding: 10px 3px;
                padding-right: 6px;
            }
            .sidebar-header h5 {
                font-size: 1.5rem;
                margin-bottom: 15px;
            }
            .category-sidebar {
                margin-top: 10px;
            }
            .category-list .btn {
                margin-bottom: 6px;
                text-align: center;
                font-size: 0.85rem;
                padding: 8px 5px;
                border-radius: 6px;
            }
            .main-content {
                padding: 20px 10px 120px 6px;
                flex: 1;
            }
            .container-fluid .row {
                margin: 0;
            }
            .col-md-2 {
                flex: 0 0 120px;
                max-width: 120px;
                padding: 0;
            }
            .col-md-10 {
                flex: 1;
                max-width: calc(100% - 120px);
                padding: 0;
            }
            /* 放大购物车按钮 */
            .quantity-btn {
                width: 30px;
                height: 30px;
            }
            .quantity-btn .btn-icon {
                font-size: 16px;
            }
            .quantity-display {
                font-size: 1rem;
                min-width: 28px;
            }
        }
        @media (max-width: 576px) {
            .navbar-brand img {
                height: 35px;
            }
            .custom-sidebar {
                padding-right: 4px;
            }
            .custom-main-content {
                padding-left: 4px;
            }
            /* 更窄的侧边栏 */
            .sidebar {
                width: 85px;
                padding: 10px 2px;
                padding-right: 4px;
                background-color: #f5f5f5;

            }
            .sidebar-header h5 {
                font-size: 1rem;
                margin-bottom: 8px;
            }
            .category-list .btn {
                font-size: 0.95rem;
                padding: 5px 2px;
                margin-bottom: 3px;
            }
            .main-content {
                padding: 20px 6px 120px 4px;
            }
            .col-md-2 {
                flex: 0 0 85px;
                max-width: 85px;
            }
            .col-md-10 {
                flex: 1;
                max-width: calc(100% - 85px);
            }
            
            /* 水平卡片样式 */
            .horizontal-card .product-img-container {
                height: 100px;
                margin: 6px;
            }
            .horizontal-card .card-body {
                padding: 10px;
            }
            .product-card .card-title {
                font-size: 0.9rem;
                line-height: 1.3;
                margin-bottom: 6px;
            }
            .product-price {
                font-size: 1rem;
            }
            .price-number {
                font-size: 1.2rem;
            }
            .add-to-cart-btn {
                width: 36px;
                height: 36px;
            }
            .quantity-btn {
                width: 30px;
                height: 30px;
            }
            .quantity-btn .btn-icon {
                font-size: 16px;
            }
            .quantity-display {
                font-size: 1rem;
                min-width: 30px;
                font-weight: 600;
            }
            .stats-number {
                font-size: 1.5rem;
            }
            #cartBadge {
                font-size: 0.6rem;
                min-width: 16px;
                height: 16px;
                line-height: 14px;
            }
            .main-content {
                padding: 20px 6px 120px 4px;
            }
        }