<!DOCTYPE html>
<html lang="cn">

<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="description" content="">
<title>Topcare - Your Needs, Our Focus.</title>
<!-- Favicon -->

<!--********************************** 
        all css files 
    *************************************-->

<!--*************************************************** 
       fontawesome,bootstrap,plugins and main style css
     ***************************************************-->
<!-- cdn links -->

<link rel="preload" as="style" onload="this.onload=null;this.rel='stylesheet'" href="/css/bootstrap.min.css">
<link rel="preload" as="style" onload="this.onload=null;this.rel='stylesheet'" href="/css/simple-line-icons.css">
<link rel="preload" as="style" onload="this.onload=null;this.rel='stylesheet'" href="/css/jquery-ui.min.css">
<link rel="preload" as="style" onload="this.onload=null;this.rel='stylesheet'" href="/css/fontawesome.min.css">
<link rel="preload" as="style" onload="this.onload=null;this.rel='stylesheet'" href="/css/ionicons.min.css">
<link rel="preload" as="style" onload="this.onload=null;this.rel='stylesheet'" href="/css/plugins.css">
<link rel="preload" as="style" onload="this.onload=null;this.rel='stylesheet'" href="/css/style.min.css">

<!-- <link rel="stylesheet" th:href="@{/mycss/header.css}"> -->
<link rel="preload" as="style" onload="this.onload=null;this.rel='stylesheet'" href="/mycss/style.main.css">

<!-- 引入Bootstrap 5 CSS -->
<!-- <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet"> -->
<!-- 引入Font Awesome图标（可选，增强视觉） -->
<!-- <link href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css" rel="stylesheet"> -->

<!-- Use the minified version files listed below for better performance and remove the files listed above -->

<!--****************************
       Minified  css
  ****************************-->

<!--***********************************************
     vendor min css,plugins min css,style min css
   ***********************************************-->

  <link rel="stylesheet" href="/mycss/error/404.css">
</head>

<body>


    <!--*********************** 
    all js files
  ***********************-->

  <!--****************************************************** 
    jquery,modernizr ,poppe,bootstrap,plugins and main js
  ******************************************************-->
<script src="/js/jquery-3.6.0.min.js"></script>
<script src="/js/jquery-migrate-3.3.2.min.js"></script>
<script src="/js/modernizr-3.7.1.min.js"></script>
<script src="/js/jquery-ui.min.js"></script>
<script src="/js/bootstrap.bundle.min.js"></script>
<script src="/js/plugins.js"></script>

  <!--offcanvas开始-->
  <!-- offcanvas-overlay start -->
<div class="offcanvas-overlay"></div>
<!-- offcanvas-overlay end -->

<!-- offcanvas-mobile-menu start -->
<div id="offcanvas-mobile-menu" class="offcanvas offcanvas-mobile-menu-right theme1">
    <div class="inner">
        <div class="border-bottom mb-4 pb-4 text-start">
            <button class="offcanvas-close">×</button>
        </div>
        <div class="offcanvas-head mb-4">
            <nav class="offcanvas-top-nav">
                <ul class="d-flex flex-wrap">
                    <li class="my-2 mx-2" id="chat-badge">
                        <a class="action" href="#" data-bs-toggle="modal" data-bs-target="#chat">
                            <i class="icon-bubble"></i> Chat
                            <!-- <span id="mobile-chat-count">(0)</span>-->
                        </a>
                    </li>
                    <li class="my-2 mx-2">
                        <a href="/cart">
                            <i class="icon-bag"></i> Cart
                            <span id="mobile-cart-count">(0)</span>
                        </a>
                    </li>
                    <li class="my-2 mx-2">
                        <a href="/wishlist">
                            <i class="ion-android-favorite-outline"></i> Wishlist
                            <span id="mobile-wishlist-count">(3)</span>
                        </a>
                    </li>
                    <li class="my-2 mx-2">
                        <a href="/compare">
                            <i class="ion-ios-loop-strong"></i> Compare
                            <span id="mobile-compare-count">(2)</span>
                        </a>
                    </li>
                    <li class="my-2 mx-2">
                        <a class="search search-toggle" href="javascript:void(0)">
                            <i class="icon-magnifier"></i> Search</a>
                    </li>
                </ul>
            </nav>
        </div>
        <nav class="offcanvas-menu">
            <ul>
                <li>
                    <a href="/">HOME</a>
                </li>
                <li>
                    <a href="/product"><span class="menu-text">PRODUCTS</span></a>
                    

                    <ul class="offcanvas-submenu">
                        <li>
                            <a href="/product/130">
                                <span class="menu-text">Tube</span>
                            </a>
                            <ul class="offcanvas-submenu">
                                <li>
                                    <a href="/product/131/131">Aluminum Tube</a>
                                </li>
                                <li>
                                    <a href="/product/132/132">Sugarcane Tube</a>
                                </li>
                                <li>
                                    <a href="/product/133/133">PCR Tube</a>
                                </li>
                                <li>
                                    <a href="/product/134/134">OBP Tube</a>
                                </li>
                                <li>
                                    <a href="/product/141/141">PLA Tube</a>
                                </li>
                                <li>
                                    <a href="/product/142/142">PBL Tube</a>
                                </li>
                                <li>
                                    <a href="/product/143/143">ABL Tube</a>
                                </li>
                                <li>
                                    <a href="/product/144/144">PE Tube</a>
                                </li>
                                <li>
                                    <a href="/product/155/155">Kraft Paper Tube</a>
                                </li>
                            </ul>
                        </li>
                        <li>
                            <a href="/product/135">
                                <span class="menu-text">Color Package</span>
                            </a>
                            <ul class="offcanvas-submenu">
                                <li>
                                    <a href="/product/156/156">Mascara</a>
                                </li>
                                <li>
                                    <a href="/product/157/157">Eyeliner</a>
                                </li>
                                <li>
                                    <a href="/product/158/158">Compact &amp; Loose Powder Case</a>
                                </li>
                                <li>
                                    <a href="/product/173/173">Eyebrow</a>
                                </li>
                                <li>
                                    <a href="/product/180/180">Lip Gloss</a>
                                </li>
                                <li>
                                    <a href="/product/183/183">Roller Bottle</a>
                                </li>
                                <li>
                                    <a href="/product/184/184">A Series of Sets</a>
                                </li>
                            </ul>
                        </li>
                        <li>
                            <a href="/product/138">
                                <span class="menu-text">Closure</span>
                            </a>
                            <ul class="offcanvas-submenu">
                                <li>
                                    <a href="/product/145/145">Foaming Pump</a>
                                </li>
                                <li>
                                    <a href="/product/146/146">Lotion Pump</a>
                                </li>
                                <li>
                                    <a href="/product/147/147">Sprayer</a>
                                </li>
                                <li>
                                    <a href="/product/148/148">Trigger Sprayer</a>
                                </li>
                                <li>
                                    <a href="/product/159/159">Cap</a>
                                </li>
                                <li>
                                    <a href="/product/172/172">Cream Pump</a>
                                </li>
                                <li>
                                    <a href="/product/174/174">Cleaning Pump</a>
                                </li>
                            </ul>
                        </li>
                        <li>
                            <a href="/product/139">
                                <span class="menu-text">Bottle</span>
                            </a>
                            <ul class="offcanvas-submenu">
                                <li>
                                    <a href="/product/149/149">PET Bottle</a>
                                </li>
                                <li>
                                    <a href="/product/150/150">PE Bottle</a>
                                </li>
                                <li>
                                    <a href="/product/151/151">PP Bottle</a>
                                </li>
                                <li>
                                    <a href="/product/152/152">PS Bottle</a>
                                </li>
                                <li>
                                    <a href="/product/160/160">Aluminum Bottle</a>
                                </li>
                                <li>
                                    <a href="/product/161/161">PETG Bottle</a>
                                </li>
                                <li>
                                    <a href="/product/162/162">Acrylic Bottle</a>
                                </li>
                                <li>
                                    <a href="/product/163/163">Glass Bottle</a>
                                </li>
                                <li>
                                    <a href="/product/176/176">PLA Bottle</a>
                                </li>
                                <li>
                                    <a href="/product/181/181">PVC Bottle</a>
                                </li>
                                <li>
                                    <a href="/product/182/182">AS Bottle</a>
                                </li>
                                <li>
                                    <a href="/product/185/185">ABS Bottle</a>
                                </li>
                            </ul>
                        </li>
                        <li>
                            <a href="/product/140">
                                <span class="menu-text">Stick</span>
                            </a>
                            <ul class="offcanvas-submenu">
                                <li>
                                    <a href="/product/153/153">Lip Stick</a>
                                </li>
                                <li>
                                    <a href="/product/154/154">Sun Stick</a>
                                </li>
                                <li>
                                    <a href="/product/165/165">Facial Stick</a>
                                </li>
                                <li>
                                    <a href="/product/166/166">Deodorant Stick</a>
                                </li>
                            </ul>
                        </li>
                        <li>
                            <a href="/product/164">
                                <span class="menu-text">Jar</span>
                            </a>
                            <ul class="offcanvas-submenu">
                                <li>
                                    <a href="/product/167/167">PP Jar</a>
                                </li>
                                <li>
                                    <a href="/product/168/168">PET Jar</a>
                                </li>
                                <li>
                                    <a href="/product/169/169">PETG Jar</a>
                                </li>
                                <li>
                                    <a href="/product/170/170">PS Jar</a>
                                </li>
                                <li>
                                    <a href="/product/171/171">Acrylic Jar</a>
                                </li>
                                <li>
                                    <a href="/product/175/175">PLA Jar</a>
                                </li>
                                <li>
                                    <a href="/product/186/186">AS Jar</a>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </li>

                <li>
                    <a href="/activity">ACTIVITY</a>
                </li>

                <li>
                    <a href="/news">NEWS</a>
                </li>

                <li>
                    <a href="/about">ABOUT US</a>
                </li>

                <li>
                    <a href="/contact">CONTACT US</a>
                </li>

                <li>
                    <a href="#"><span class="menu-text">SETTING</span></a>
                    <ul class="offcanvas-submenu">
                        <li>
                            <a href="/account">My Account</a>
                        </li>
                        <li>
                            <a href="/account/login">Sign In</a>
                        </li>
                        <li>
                            <a href="#" id="singOut">Sign Out</a>
                        </li>
                    </ul>
                </li>
            </ul>
        </nav>
        <div class="offcanvas-social py-30">
            <ul>
                <li>
                    <a href="#"><i class="icon-social-facebook"></i></a>
                </li>
                <li>
                    <a href="#"><i class="icon-social-twitter"></i></a>
                </li>
                <li>
                    <a href="#"><i class="icon-social-youtube"></i></a>
                </li>
                <li>
                    <a href="#"><i class="icon-social-google"></i></a>
                </li>
                <li>
                    <a href="#"><i class="icon-social-instagram"></i></a>
                </li>
            </ul>
        </div>
        <div class="offcanvas-foot p-3">
            <div>If you have any questions or encounter any issues while browsing the website, you can provide us with feedback in a timely manner.</div>
            <div class="media static-media ms-4 d-flex align-items-center pt-5">
                <div class="media-body">
                    <div class="phone">
                        <a rel="nofollow" target="_blank" class="text-dark alert-link"
                            href="mailto:lynn@gtcpackaging.com">Email :
                            lynn@gtcpackaging.com</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- offcanvas-mobile-menu end -->

<!-- OffCanvas Wishlist Start -->
<div id="offcanvas-wishlist" class="offcanvas offcanvas-wishlist theme1">
    <div class="inner overflow-scroll">
        <div class="head d-flex flex-wrap justify-content-between">
            <span class="title">Wishlist</span>
            <button class="offcanvas-close">×</button>
        </div>
        <ul class="minicart-product-list" id="product-wishlsit-list">
            
        </ul>
        <a href="/wishlist" class="btn btn-secondary btn--lg d-block d-sm-inline-block mt-30">view wishlist</a>
    </div>
</div>
<!-- OffCanvas Wishlist End -->

<!-- OffCanvas Cart Start -->
<div id="offcanvas-cart" class="offcanvas offcanvas-cart theme1">
    <div class="inner overflow-scroll">
        <div class="head d-flex flex-wrap justify-content-between">
            <span class="title">Cart</span>
            <button class="offcanvas-close">×</button>
        </div>
        <ul class="minicart-product-list" id="product-cart-list">
            
        </ul>
        
        <a href="/cart" class="btn btn-secondary btn--lg d-block d-sm-inline-block me-sm-2">view cart</a>
        
    </div>
</div>
<!-- OffCanvas Cart End -->

<!-- search-box and overlay start -->
<div id="overlay" class="overlay">
    <div class="scale"></div>
    <form class="search-box" action="/product">
        <input type="text" name="key" placeholder="Search products...">
        <button id="close" type="submit">
            <i class="ion-ios-search-strong"></i>
        </button>
    </form>
    <button class="close"><i class="ion-android-close"></i></button>
</div>
<!-- search-box and overlay end -->
  <!--offcanvas结束-->

  <!--header开始-->
  <header id="fragment-header">
  <!-- header top start -->
  <div class="header-top theme1 bg-6 py-15">
    <div class="container">
      <div class="row align-items-center">
        <div class="col-lg-6 col-sm-6 order-last order-sm-first">
          <div class="d-flex justify-content-center justify-content-sm-start align-items-center">

            <div class="social-network2">
              <ul class="d-flex">
                <li>
                  <a href="javascript:;" target="_blank"><span class="icon-social-facebook"></span></a>
                </li>
                <li>
                  <a href="javascript:;" target="_blank"><span class="icon-social-twitter"></span></a>
                </li>
                <li>
                  <a href="javascript:;" target="_blank"><span class="icon-social-youtube"></span></a>
                </li>
                <li>
                  <a href="javascript:;"  target="_blank"><span class="icon-social-google"></span></a>
                </li>
                <li class="mr-0">
                  <a href="javascript:;" target="_blank"><span class="icon-social-instagram"></span></a>
                </li>
              </ul>
            </div>
            <div class="media static-media ms-4 d-flex align-items-center">
              <div class="media-body">
                <div class="phone">
                  <a rel="nofollow" target="_blank" class="text-white"
                    href="mailto:lynn@gtcpackaging.com">Email :
                    lynn@gtcpackaging.com</a>
                </div>
              </div>
            </div>
          </div>
        </div>
        <div class="col-lg-6 col-sm-6">
          <nav class="navbar-top pb-2 pb-sm-0 position-relative">
            <ul class="d-flex justify-content-center justify-content-md-end align-items-center">
              <li>
                <a href="#" id="dropdown1" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span
                    id="userInfoName">Setting</span> <i class="ion ion-ios-arrow-down"></i></a>
                <ul class="topnav-submenu dropdown-menu" aria-labelledby="dropdown1">
                  <li><a href="/account">My account</a></li>
                  <li><a href="/account/login">Sign in</a></li>
                  <li><a id="singOut">Sign out</a></li>
                </ul>
              </li>
              <li class="english">
                <a href="#" id="dropdown3" class="pe-0" data-bs-toggle="dropdown" aria-haspopup="true"
                  aria-expanded="false">
                  <img src="/picture/us-flag.jpg" alt="us flag">
                  English
                  <i class="ion ion-ios-arrow-down"></i>
                </a>
                <ul class="topnav-submenu dropdown-menu" aria-labelledby="dropdown3">
                  <li class="active">
                    <a href="#"><img src="/picture/us-flag.jpg" alt="us flag">English</a>
                  </li>
                </ul>
              </li>
            </ul>
          </nav>
        </div>
      </div>
    </div>
  </div>
  <!-- header top end -->
  <!-- header-middle satrt -->
  <div id="sticky" class="header-middle theme1 py-15 py-lg-0">
    <div class="container position-relative">
      <div class="row align-items-center">
        <div class="col-6 col-lg-2 col-xl-2">
          <div class="logo">
            <a href=""><img src="/svg/logo.svg" alt="logo"></a>
          </div>
        </div>

        <div class="col-xl-8 col-lg-7 d-none d-lg-block">
          <ul class="main-menu d-flex justify-content-center">
            <li>
              <a href="/">Home</a>
            </li>
            <li class="position-static">
              <a href="/product">PRODUCTS <i class="ion-ios-arrow-down"></i></a>
              <ul class="mega-menu row">
                <li class="col-2">
                  <ul>
                    <li class="mega-menu-title">
                      
                      <a href="/product/130">Tube</a>
                    </li>
                    
                      <li>
                        
                        <a href="/product/130/131">Aluminum Tube</a>
                      </li>
                      <li>
                        
                        <a href="/product/130/132">Sugarcane Tube</a>
                      </li>
                      <li>
                        
                        <a href="/product/130/133">PCR Tube</a>
                      </li>
                      <li>
                        
                        <a href="/product/130/134">OBP Tube</a>
                      </li>
                      <li>
                        
                        <a href="/product/130/141">PLA Tube</a>
                      </li>
                      <li>
                        
                        <a href="/product/130/142">PBL Tube</a>
                      </li>
                      <li>
                        
                        <a href="/product/130/143">ABL Tube</a>
                      </li>
                      <li>
                        
                        <a href="/product/130/144">PE Tube</a>
                      </li>
                      <li>
                        
                        <a href="/product/130/155">Kraft Paper Tube</a>
                      </li>
                    
                  </ul>
                </li>
                <li class="col-2">
                  <ul>
                    <li class="mega-menu-title">
                      
                      <a href="/product/135">Color Package</a>
                    </li>
                    
                      <li>
                        
                        <a href="/product/135/156">Mascara</a>
                      </li>
                      <li>
                        
                        <a href="/product/135/157">Eyeliner</a>
                      </li>
                      <li>
                        
                        <a href="/product/135/158">Compact &amp; Loose Powder Case</a>
                      </li>
                      <li>
                        
                        <a href="/product/135/173">Eyebrow</a>
                      </li>
                      <li>
                        
                        <a href="/product/135/180">Lip Gloss</a>
                      </li>
                      <li>
                        
                        <a href="/product/135/183">Roller Bottle</a>
                      </li>
                      <li>
                        
                        <a href="/product/135/184">A Series of Sets</a>
                      </li>
                    
                  </ul>
                </li>
                <li class="col-2">
                  <ul>
                    <li class="mega-menu-title">
                      
                      <a href="/product/138">Closure</a>
                    </li>
                    
                      <li>
                        
                        <a href="/product/138/145">Foaming Pump</a>
                      </li>
                      <li>
                        
                        <a href="/product/138/146">Lotion Pump</a>
                      </li>
                      <li>
                        
                        <a href="/product/138/147">Sprayer</a>
                      </li>
                      <li>
                        
                        <a href="/product/138/148">Trigger Sprayer</a>
                      </li>
                      <li>
                        
                        <a href="/product/138/159">Cap</a>
                      </li>
                      <li>
                        
                        <a href="/product/138/172">Cream Pump</a>
                      </li>
                      <li>
                        
                        <a href="/product/138/174">Cleaning Pump</a>
                      </li>
                    
                  </ul>
                </li>
                <li class="col-2">
                  <ul>
                    <li class="mega-menu-title">
                      
                      <a href="/product/139">Bottle</a>
                    </li>
                    
                      <li>
                        
                        <a href="/product/139/149">PET Bottle</a>
                      </li>
                      <li>
                        
                        <a href="/product/139/150">PE Bottle</a>
                      </li>
                      <li>
                        
                        <a href="/product/139/151">PP Bottle</a>
                      </li>
                      <li>
                        
                        <a href="/product/139/152">PS Bottle</a>
                      </li>
                      <li>
                        
                        <a href="/product/139/160">Aluminum Bottle</a>
                      </li>
                      <li>
                        
                        <a href="/product/139/161">PETG Bottle</a>
                      </li>
                      <li>
                        
                        <a href="/product/139/162">Acrylic Bottle</a>
                      </li>
                      <li>
                        
                        <a href="/product/139/163">Glass Bottle</a>
                      </li>
                      <li>
                        
                        <a href="/product/139/176">PLA Bottle</a>
                      </li>
                      <li>
                        
                        <a href="/product/139/181">PVC Bottle</a>
                      </li>
                      <li>
                        
                        <a href="/product/139/182">AS Bottle</a>
                      </li>
                      <li>
                        
                        <a href="/product/139/185">ABS Bottle</a>
                      </li>
                    
                  </ul>
                </li>
                <li class="col-2">
                  <ul>
                    <li class="mega-menu-title">
                      
                      <a href="/product/140">Stick</a>
                    </li>
                    
                      <li>
                        
                        <a href="/product/140/153">Lip Stick</a>
                      </li>
                      <li>
                        
                        <a href="/product/140/154">Sun Stick</a>
                      </li>
                      <li>
                        
                        <a href="/product/140/165">Facial Stick</a>
                      </li>
                      <li>
                        
                        <a href="/product/140/166">Deodorant Stick</a>
                      </li>
                    
                  </ul>
                </li>
                <li class="col-2">
                  <ul>
                    <li class="mega-menu-title">
                      
                      <a href="/product/164">Jar</a>
                    </li>
                    
                      <li>
                        
                        <a href="/product/164/167">PP Jar</a>
                      </li>
                      <li>
                        
                        <a href="/product/164/168">PET Jar</a>
                      </li>
                      <li>
                        
                        <a href="/product/164/169">PETG Jar</a>
                      </li>
                      <li>
                        
                        <a href="/product/164/170">PS Jar</a>
                      </li>
                      <li>
                        
                        <a href="/product/164/171">Acrylic Jar</a>
                      </li>
                      <li>
                        
                        <a href="/product/164/175">PLA Jar</a>
                      </li>
                      <li>
                        
                        <a href="/product/164/186">AS Jar</a>
                      </li>
                    
                  </ul>
                </li>
              </ul>
              
            
            </li>
            <li>
              <a href="/about">ABOUT US</a>
            </li>
            <li>
              <a href="/news">NEWS</a>
            </li>
            <li>
              <a href="/activity">ACTIVITY</a>
            </li>
            <li>
              <a href="/contact">CONTACT US</a>
            </li>
          </ul>
        </div>
        <div class="col-6 col-lg-3 col-xl-2">
          <!-- search-form end -->
          <div class="d-flex align-items-center justify-content-end">
            <!-- static-media end -->
            <div class="cart-block-links theme1 d-none d-sm-block">
              <ul class="d-flex">
                <li>
                  <a href="javascript:void(0)" class="search search-toggle">
                    <i class="icon-magnifier"></i>
                  </a>
                </li>
                <li class="mr-xl-0 cart-block position-relative display-none" id="chat-badge">
                  <a class="action" href="#" data-bs-toggle="modal" data-bs-target="#chat">
                    <span class="position-relative">
                      <i class="icon-bubble"></i>
                      <span class="badge cbdg1" id="chat-count"></span>
                    </span>
                  </a>
                </li>
                <li>
                  <a href="/compare">
                    <span class="position-relative">
                      <i class="icon-shuffle"></i>
                      <span class="badge cbdg1" id="compare-count"></span>
                    </span>
                  </a>
                </li>
                <li>
                  <a class="offcanvas-toggle" href="#offcanvas-wishlist">
                    <span class="position-relative">
                      <i class="icon-heart"></i>
                      <span class="badge cbdg1" id="wishlist-count"></span>
                    </span>
                  </a>
                </li>
                <li class="mr-xl-0 cart-block position-relative">
                  <a class="offcanvas-toggle" href="#offcanvas-cart">
                    <span class="position-relative">
                      <i class="icon-bag"></i>
                      <span class="badge cbdg1" id="cart-count"></span>
                    </span>
                  </a>
                </li>
                <!-- cart block end -->
              </ul>
            </div>
            <div class="mobile-menu-toggle theme1 d-lg-none">
              <a href="#offcanvas-mobile-menu" class="offcanvas-toggle">
                <svg viewbox="0 0 700 550">
                  <path d="M300,220 C300,220 520,220 540,220 C740,220 640,540 520,420 C440,340 300,200 300,200"
                    id="top"></path>
                  <path d="M300,320 L540,320" id="middle"></path>
                  <path d="M300,210 C300,210 520,210 540,210 C740,210 640,530 520,410 C440,330 300,190 300,190"
                    id="bottom" transform="translate(480, 320) scale(1, -1) translate(-480, -318)">
                  </path>
                </svg>
              </a>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <!-- header-middle end -->
  <script type="text/javascript">
    $(function () {
      // 重写 setItem 方法并触发自定义事件
      const originalSetItem = localStorage.setItem;
      localStorage.setItem = function (key, value) {
        let data = localStorage.getItem(key);
        if (!data) {
          data = '[]';
        }
        const event = new CustomEvent('localStorageUpdated', { detail: { key, value, data } });
        window.dispatchEvent(event);
        originalSetItem.apply(this, arguments);
      };
    })
  </script>
  <script type="text/javascript">

    function updateFunctionalityByCookie(key, listValue) {
      if (navigator.cookieEnabled) {
        const cookieStr = document.cookie;
        const cookieObj = {};

        if (!cookieStr) {
          return cookieObj;
        }

        const cookies = cookieStr.split(";");

        for (let i = 0; i < cookies.length; i++) {
          const cookieItem = cookies[i].trim();
          if (!cookieItem) continue;

          const equalIndex = cookieItem.indexOf("=");
          if (equalIndex === -1) continue;

          const key = cookieItem.substring(0, equalIndex).trim();
          const value = cookieItem.substring(equalIndex + 1).trim();

          cookieObj[key] = decodeURIComponent(value);
        }

        if (cookieObj['loginStatus'] === 'true') {
          let url = null;
          if (key === 'productCompare') {
            url = '/functionality/compare';
          } else if (key === 'productWishlist') {
            url = '/functionality/wishlist';
          } else if (key === 'productCart') {
            url = '/functionality/cart';
          }

          const data = JSON.parse(listValue).map(item => {
            return {
              spuId: item.id,
              skuIds: null,
            }
          })
          if (url !== null) {
            $.ajax({
              type: 'POST',
              url: url,
              data: { str: JSON.stringify(data) },
            }).done(response => {
            }).fail(error => { })
          }
        }
      }
    }
    function countInit() {
      const compareIcon = document.getElementById("compare-count");
      const cartIcon = document.getElementById("cart-count");
      const wishlistIcon = document.getElementById("wishlist-count");
      const mobileCartCount = document.getElementById("mobile-cart-count");
      const mobileWishlistCount = document.getElementById("mobile-wishlist-count");
      const mobileCompareCount = document.getElementById("mobile-compare-count");

      // 获取 localStorage 中的 productCompare 数据
      const compareData = localStorage.getItem("productCompare");
      const cartData = localStorage.getItem("productCart");
      const wishlistData = localStorage.getItem("productWishlist");

      let compareList = [];
      let cartList = [];
      let wishlistList = [];
      if (compareData) {
        compareList = JSON.parse(compareData);
      }
      if (cartData) {
        cartList = JSON.parse(cartData);
      }
      if (wishlistData) {
        wishlistList = JSON.parse(wishlistData);
      }
      compareIcon.textContent = compareList.length;
      mobileCompareCount.textContent = `(${compareList.length})`;
      cartIcon.textContent = cartList.length;
      mobileCartCount.textContent = `(${cartList.length})`;
      wishlistIcon.textContent = wishlistList.length;
      mobileWishlistCount.textContent = `(${wishlistList.length})`;
      // 监听自定义事件
      window.addEventListener('localStorageUpdated', function (event) {
        // console.log(`${event.detail.key} 更新为 ${event.detail.value}`);
        if (event.detail.key === 'productCompare') {
          const compareList = JSON.parse(event.detail.value);
          compareIcon.textContent = compareList.length;
          mobileCompareCount.textContent = `(${compareList.length})`;
          updateFunctionalityByCookie(event.detail.key, event.detail.value);
        } else if (event.detail.key === 'productCart') {
          const cartList = JSON.parse(event.detail.value);
          cartIcon.textContent = cartList.length;
          mobileCartCount.textContent = `(${cartList.length})`;
          updateFunctionalityByCookie(event.detail.key, event.detail.value);
        } else if (event.detail.key === 'productWishlist') {
          const wishlistList = JSON.parse(event.detail.value);
          wishlistIcon.textContent = wishlistList.length;
          mobileWishlistCount.textContent = `(${wishlistList.length})`;
          updateFunctionalityByCookie(event.detail.key, event.detail.value);
        }
        // const compareList = JSON.parse(localStorage.getItem("productCompare"));
        // compareIcon.textContent = compareList.length;           
      });
    }
    countInit();       
  </script>

  <script>
    // 1. 选择所有目标元素（列表项）
    const targetElements = document.querySelectorAll('.offcanvas');
    const domain = "https:\/\/topcarepackaging.com:8080";

    // 2. 定义通用的回调函数（处理所有元素的 class 变化）
    const handleClassChange = (mutationsList, observer) => {
      for (const mutation of mutationsList) {
        if (mutation.type === 'attributes' && mutation.attributeName === 'class') {
          const changedElement = mutation.target; // 发生变化的具体元素
          // console.log(`=== 元素 "${changedElement.textContent}" 的 class 变化 ===`);
          // console.log('旧 class：', mutation.oldValue);
          // console.log('新 class：', changedElement.className);
          if (changedElement.classList.contains('offcanvas-open')) {
            if (changedElement.id === 'offcanvas-wishlist') {
              //         const getUrl = "\/functionality\/wishlist";
              //     $.ajax({
              //         type: 'GET',
              //         url: getUrl,
              //     }).done((resp) => {
              //         const data = resp.data;
              //         const element = document.getElementById('product-wishlsit-list');
              //         if (data) {
              //             element.innerHTML = '';
              //             data.forEach(item => {
              //                 const li = document.createElement('li');
              //                 const context = `
              //   <a href="${"\/ product \/"+item.id}" class="image">
              //     <img src="${domain + '/upload/product/images/' + item.spuDetail.imagesList.split(",")[0]}" alt="Cart product Image">
              //   </a>
              //   <div class="content">
              //       <a href="${"\/ product \/"+item.id}" class="title">${item.title}</a>
              //       <!--<span class="quantity-price">1 x <span class="amount">$100.00</span></span>-->
              //       <!--<a href="#" class="remove wishlist-remove" data-product-id="${item.id}">×</a>-->
              //   </div>`;
              //                 li.innerHTML = context;
              //                 element.appendChild(li);
              //             });
              //             // $('.wishlist-remove').on('click',function(event){
              //             //     event.relatedTarget;
              //             //     $.ajax({
              //             //         type:"DELETE",
              //             //         url:"\/functionality\/wishlist",
              //             //     }).done(resp=>{

              //             //     })
              //             // })
              //         }
              //     }).fail(error => {

              //     })
              const element = document.getElementById('product-wishlsit-list');
              const productWishlist = localStorage.getItem("productWishlist");
              let wishlistList = [];
              if (productWishlist) {
                wishlistList = JSON.parse(productWishlist);
              }
              element.innerHTML = '';
              if (wishlistList.length > 0) {
                wishlistList.forEach(item => {
                  const li = document.createElement('li');
                  /*******************************************************
                  const context = `
                      <a href="${"\/product\/detail\/"+item.id}" class="image">
                          <img src="${}" alt="Cart product Image">
                      </a>
                      <div class="content">
                          <a href="${"\/product\/detail\/"+item.id}" class="title">${item.title}</a>
                          <!--<span class="quantity-price">1 x <span class="amount">$100.00</span></span>-->
                          <div class="action">
                              <a href="#" class="btn btn-dark" data-product-id="${item.id}">Add to Cart</a>
                              <a href="#" class="btn btn-dark" data-product-id="${item.id}">Remove</a>
                          </div>
                      </div>`;
                  li.innerHTML = context;
                  *********************************************************/
                  //使用JavaScript动态创建DOM元素
                  const a_image = document.createElement('a');
                  a_image.classList.add('image');
                  a_image.href = "\/product\/detail\/" + item.id;
                  const img = document.createElement('img');
                  img.src = domain + '/upload/product/images/' + item.images[0];
                  img.alt = 'Cart product Image';
                  a_image.appendChild(img);

                  const div_content = document.createElement('div');
                  div_content.classList.add('content');
                  const a_title = document.createElement('a');
                  a_title.classList.add('title');
                  a_title.href = "\/product\/detail\/" + item.id;
                  a_title.textContent = item.title;
                  div_content.appendChild(a_title);

                  const div_action = document.createElement('div');
                  div_action.classList.add('action');
                  const a_addToCart = document.createElement('a');
                  a_addToCart.classList.add('btn', 'btn-dark');
                  a_addToCart.textContent = 'Add to Cart';
                  a_addToCart.dataset.bsToggle = 'modal';
                  a_addToCart.dataset.bsTarget = '#add-to-cart';
                  a_addToCart.dataset.productId = item.id;
                  a_addToCart.dataset.productTitle = item.title;
                  a_addToCart.dataset.productSubtitle = item.subTitle;
                  a_addToCart.dataset.productImages = item.images;
                  /*
                  a_addToCart.addEventListener('click', function (event) {
                    event.preventDefault();
                    const id = this.getAttribute('data-product-id');
                    const title = this.getAttribute('data-product-title');
                    const subTitle = this.getAttribute('data-product-sub-title');
                    const images = this.getAttribute('data-product-images');
                    let cartList = [];
                    const data = localStorage.getItem("productCart");
                    if (data) {
                      cartList = JSON.parse(data);
                    }
                    const index = cartList.findIndex(child => child.id == id);
                    if (index === -1) {
                      const cart = {
                        id: id,
                        title: title,
                        images: images.split(','),
                      }
                      cartList.push(cart);
                      localStorage.setItem('productCart', JSON.stringify(cartList));
                    }
                  })*/
                  div_action.appendChild(a_addToCart);

                  const a_remove = document.createElement('a');
                  a_remove.classList.add('btn', 'btn-dark', 'mg-10');
                  a_remove.textContent = 'Remove';
                  a_remove.dataset.productId = item.id;
                  a_remove.addEventListener('click', function (event) {
                    event.preventDefault();
                    const id = this.getAttribute('data-product-id');
                    const index = wishlistList.findIndex(item => item.id == id);
                    if (index >= 0 && index <= wishlistList.length - 1) {
                      const target = element.children;
                      element.removeChild(target[index]);
                      wishlistList.splice(index, 1);
                      localStorage.setItem('productWishlist', JSON.stringify(wishlistList));
                    }
                  })
                  div_action.appendChild(a_remove);
                  div_content.appendChild(div_action);

                  li.appendChild(a_image);
                  li.appendChild(div_content);
                  element.appendChild(li);
                })
              }


            } else if (changedElement.id === 'offcanvas-cart') {
              // const getUrl = "\/functionality\/cart";
              // $.ajax({
              //     type: 'GET',
              //     url: getUrl,
              // }).done((resp) => {
              //     const data = resp.data;
              //     const element = document.getElementById('product-cart-list');
              //     if (data) {
              //         element.innerHTML = '';
              //         data.forEach(item => {
              //             const li = document.createElement('li');
              //             const context = `
              //                 <a href="${"\/product\/" + item.id}" class="image">
              //                 <img src="${domain + '/upload/product/images/' + item.spuDetail.imagesList.split(",")[0]}" alt="Cart product Image">
              //                 </a>
              //                 <div class="content">
              //                     <a href="${"\/product\/" + item.id}" class="title">${item.title}</a>
              //                     <!--<span class="quantity-price">1 x <span class="amount">$100.00</span></span>-->
              //                     <!--<a href="#" class="remove" data-product-id="${item.id}">×</a>-->
              //                 </div>`;
              //             li.innerHTML = context;
              //             element.appendChild(li);
              //         });
              //     }
              // }).fail(error => {

              // })
              const element = document.getElementById('product-cart-list');
              const productCart = localStorage.getItem("productCart");
              let cartList = [];
              if (productCart) {
                cartList = JSON.parse(productCart);
              }
              element.innerHTML = '';
              if (cartList.length > 0) {
                cartList.forEach(item => {
                  const li = document.createElement('li');
                  const a_image = document.createElement('a');
                  a_image.classList.add('image');
                  a_image.href = "\/product\/detail\/" + item.id;
                  const img = document.createElement('img');
                  img.src = domain + '/upload/product/images/' + item.images[0];
                  img.alt = 'Cart product Image';
                  a_image.appendChild(img);

                  const div_content = document.createElement('div');
                  div_content.classList.add('content');
                  const a_title = document.createElement('a');
                  a_title.classList.add('title');
                  a_title.href = "\/product\/detail\/" + item.id;
                  a_title.textContent = item.title;
                  div_content.appendChild(a_title);

                  const div_action = document.createElement('div');
                  div_action.classList.add('action');

                  const a_remove = document.createElement('a');
                  a_remove.classList.add('btn', 'btn-dark', 'mg-10');
                  a_remove.textContent = 'Remove';
                  a_remove.dataset.productId = item.id;
                  a_remove.addEventListener('click', function (event) {
                    event.preventDefault();
                    const id = this.getAttribute('data-product-id');
                    const index = cartList.findIndex(item => item.id == id);
                    if (index >= 0 && index <= cartList.length - 1) {
                      const target = element.children;
                      element.removeChild(target[index]);
                      cartList.splice(index, 1);
                      localStorage.setItem('productCart', JSON.stringify(cartList));
                    }
                  })
                  div_action.appendChild(a_remove);
                  div_content.appendChild(div_action);

                  li.appendChild(a_image);
                  li.appendChild(div_content);
                  element.appendChild(li);
                })
              }

            }
          }
        }
      }
    };

    // 3. 循环为每个元素创建观察器并启动监听
    targetElements.forEach(element => {
      const observer = new MutationObserver(handleClassChange);
      const observerOptions = {
        attributes: true,
        attributeFilter: ['class'],
        attributeOldValue: true
      }
      observer.observe(element, observerOptions);
    });

    // // 4. 测试：给第一个元素添加 active 类
    // document.getElementById('addActiveBtn').addEventListener('click', () => {
    //   targetElements[0].classList.add('active');
    // });
  </script>
</header>
  <!--header结束-->


  <section class="error-section pt-80">
    <div class="container">
      <div class="row">
        <div class="col-lg-12">
          <div class="error-text text-center">
            <!-- 404数字动画 -->
            <div class="error-number">
              <h2>404</h2>
              <div class="decor decor-left hidden md:block">
                <i class="fa fa-code"></i>
              </div>
              <div class="decor decor-right hidden md:block">
                <i class="fa fa-link"></i>
              </div>
            </div>

            <!-- 标题与描述 -->
            <h1 class="title">Not Found</h1>
            <p class="description">
              Sorry, the page you are trying to access does not exist,<br>
              has been deleted, or is temporarily unavailable.
            </p>

            <!-- 功能按钮组 -->
            <!-- <div class="button-group"> -->
            <!-- 返回首页 -->
            <!-- <a href="/" class="btn btn-primary">
              <i class="fa fa-home"></i>
              <span>Home</span>
            </a>
          </div> -->
          </div>
        </div>
      </div>
    </div>
  </section>
  <script>
    // 页面加载动画
    window.addEventListener('load', () => {
      document.body.style.opacity = '1';
    });
  </script>


  <!--尾部开始-->
  <footer class="bg-light theme1 position-relative" id="fragment-footer">
    <!-- footer bottom start -->
    <div class="footer-bottom pt-80 pb-30">
        <div class="container">
            <div class="row">
                <div class="col-12 col-sm-6 col-lg-4 mb-30 mobile-col">
                    <div class="footer-widget mx-w-400 max-width">
                        <div class="footer-logo mb-25">
                            <a href="">
                                <img src="/svg/logo.svg" alt="footer logo">
                            </a>
                        </div>
                        <p class="text mb-30">
                            We have a professional sales team . With our strong sense of
                            the enterprise cohesion, professional and fast customers’ service,
                            we have won high praise from our valued clients in Europe, America
                            and Southeast Asia.
                        </p>
                        
                    </div>
                </div>
                <div class="col-12 col-sm-6 col-lg-2 mb-30 mobile-row">
                    <div class="footer-widget">
                        <div class="border-bottom cbb1 mb-25">
                            <div class="section-title">
                                <h2 class="title">Information</h2>
                            </div>
                        </div>
                        <!-- footer-menu start -->
                        <ul class="footer-menu">
                            <li><a href="/news">News</a></li>
                            <li><a href="/activity">Activity</a></li>
                            <li><a href="/about">About us</a></li>
                            <li><a href="/contact">Contact us</a></li>
                        </ul>
                        <!-- footer-menu end -->
                    </div>
                </div>
                <div class="col-12 col-sm-6 col-lg-2 mb-30 mobile-row">
                    <div class="footer-widget">
                        <div class="border-bottom cbb1 mb-25">
                            <div class="section-title">
                                <h2 class="title">Quick Links</h2>
                            </div>
                        </div>
                        <ul class="footer-menu">
                            <li><a href="/product">products</a></li>
                            <li><a href="/account/login">Login</a></li>
                            <li><a href="/account">My Account</a></li>
                            <li><a href="/quotation">Need Not in Website?</a></li>
                        </ul>
                    </div>
                </div>
                <div class="col-12 col-sm-6 col-lg-4 mb-30 mobile-col">
                    <div class="footer-widget">
                        <div class="border-bottom cbb1 mb-25">
                            <div class="section-title">
                                <h2 class="title">Newsletter</h2>
                            </div>
                        </div>
                        <p class="text mb-20">
                            Subcribe to the mailing list to receive update on mnew
                            arrivals, special offers and other discount information.
                        </p>
                        <div class="nletter-form mb-35">
                            <form class="form-inline position-relative" id="subscribeForm"
                                action="/contact/subscribe">
                                <input class="form-control" type="text" name="email" placeholder="Your email address">
                                <button class="btn news-letter-btn text-capitalize" type="submit">
                                    Sign up
                                </button>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- footer bottom end -->

    <!-- coppy-right start -->
    <div class="coppy-right bg-dark py-15">
        <div class="container">
            <div class="row">
                <div class="col-12 order-last order-md-first">
                    <div class="text-md-start text-center mt-3 mt-md-0">
                        <p>Copyright © 2022-2025 Guangzhou Hongzhi Chucheng Packaging Products Co., Ltd. All rights reserved.</p>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- coppy-right end -->

    <script type="text/javascript">
        $(function () {
            var subscribeForm = $('#subscribeForm');

            // subscribeForm.on('submit',function(e){
            //     e.preventDefault();
            //     var formData=$(this).serialize();
            //     ajaxRequest("/contact/subscribe","POST",formData,{},function(data){
            //         // window.location.href = "/";
            //       },function(error){
            //         window.location.href = "/";
            //         alert(error.msg)
            //       },false
            //     );
            // });


            $(subscribeForm).submit(function (e) {
                e.preventDefault();
                var formData = $(subscribeForm).serialize();
                $.ajax({
                    type: 'POST',
                    url: $(subscribeForm).attr('action'),
                    data: formData
                })
                    .done(function (response) {
                        alert(response.msg);
                        $('#subscribeForm input').val('');
                    })
                    .fail(function (data) {
                        if (data.msg !== '') {
                            alert(data.msg)
                        } else {
                            alert('Oops! An error occured and your message could not be sent.');
                        }
                    });
            });
        })
    </script>
    <!-- 可选：如果需要更精细控制，补充JS触发加载 -->
    <script>
        document.addEventListener('DOMContentLoaded', function() {
            const lazyImgs = document.querySelectorAll('.lazy-img');
            lazyImgs.forEach(img => {
                img.src = img.getAttribute('data-src'); // 替换为真实地址
            });
        });
    </script>
</footer>
  <!--尾部结束-->


<!-- modals start -->
<!-- first modal -->
<div class="modal fade theme1 style1" id="quick-view" tabindex="-1" role="dialog">
    <div class="modal-dialog modal-dialog-centered" role="document">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
        </div>
        <div class="modal-body">
          <div class="row">
            <div class="col-md-8 mx-auto col-lg-5 mb-5 mb-lg-0">
              <div class="product-sync-init mb-20" id="product-sync-init">
              </div>

              <div class="product-sync-nav" id="product-sync-nav">
              </div>
            </div>
            <div class="col-lg-7">
              <div class="modal-product-info">
                <div class="product-head">
                  <h2 class="title" id="productTitle"></h2>
                  <h4 class="sub-title" id="productSubTitle"></h4>
                  
                </div>
                <div class="product-body">
                  <!--
                  <span class="product-price text-center">
                    <span class="new-price">$29.00</span>
                  </span>
                  <p>
                    Break old records and make new goals in the New Balance®
                    Arishi Sport v1.
                  </p>
                  <ul>
                    <li>Predecessor: None.</li>
                    <li>Support Type: Neutral.</li>
                    <li>Cushioning: High energizing cushioning.</li>
                  </ul>
                  <div id="productDescription"></div>
                 */-->
                  <ul class="spec-card" id="genericSpec">
                  </ul>
                  <ul class="spec-card" id="specialSpec">
                  </ul>
                </div>
                
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
<!-- second modal -->
<div class="modal fade style2" id="compare" tabindex="-1" role="dialog">
    <div class="modal-dialog modal-dialog-centered" role="document">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
        </div>
        <div class="modal-body">
          <h5 class="title" id="compare-message">
            <!-- <i class="fa fa-check"></i> Product added to compare. -->
            <!-- <i class="fa fa-times"></i> Product added to compare. -->
          </h5>
        </div>
      </div>
    </div>
  </div>
<!-- second modal -->
<div class="modal fade style2" id="wishlist" tabindex="-1" role="dialog">
    <div class="modal-dialog modal-dialog-centered" role="document">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
        </div>
        <div class="modal-body">
          <h5 class="title" id="wishlist-message">
            <!-- <i class="fa fa-check"></i> Product added to compare. -->
            <!-- <i class="fa fa-times"></i> Product added to compare. -->
          </h5>
        </div>
      </div>
    </div>
  </div>
<!-- second modal -->
<div class="modal fade style3" id="add-to-cart" tabindex="-1" role="dialog">
    <div class="modal-dialog modal-dialog-centered" role="document">
      <div class="modal-content">
        <div class="modal-header justify-content-center bg-dark">
          <h5 class="modal-title" id="add-to-cartCenterTitle">
            Product successfully added to your enquiry cart
          </h5>
          <button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span>
          </button>
        </div>
        <div class="modal-body">
          <div class="row">
            <div class="col-lg-5 divide-right">
              <div class="row">
                <div class="col-md-6">
                  <img src="/picture/14.jpg" alt="img" id="add-to-cart-product-img">
                </div>
                <div class="col-md-6 mb-2 mb-md-0">
                  <h4 class="product-name" id="add-to-cart-product-title">
                    <!-- New Balance Running Arishi trainers in triple -->
                  </h4>
                  
                </div>
              </div>
            </div>
            <div class="col-lg-7">
              <div class="modal-cart-content">
                <p class="cart-products-count">There is 1 item in your cart.</p>
                
                <div class="cart-content-btn">
                  <button type="button" class="btn btn-dark btn--md mt-4" data-bs-dismiss="modal">
                    Continue visiting
                  </button>
                  <button class="btn btn-dark btn--md mt-4">
                    Proceed to checkout
                  </button>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
<!-- second modal -->
<style>
  #chat .modal-body {
    padding: 30px 30px !important;
  }

  .chat-container {
    display: flex;
    flex-direction: column;
    height: 600px;
    border: 1px solid #ddd;
    border-radius: 5px;
  }

  .chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 15px;
    background-color: #f8f9fa;
  }

  .message {
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    max-width: 100%;
  }

  .message-wrap {
    display: flex;
  }

  .message-received .message-wrap {
    flex-direction: row;
  }

  .message-sent .message-wrap {
    flex-direction: row-reverse;
  }


  .message-avatar {
    font-size: 20px;
  }

  .message-info {
    display: flex;
    flex-direction: column;
  }

  .message-received .message-info {
    justify-items: start;
    margin-left: 10px;
  }

  .message-sent .message-info {
    justify-items: end;
    margin-right: 10px;
  }

  .message-nickname {
    display: flex;
    margin-bottom: 5px;
  }

  .message-received .message-nickname {
    justify-content: left;
  }

  .message-sent .message-nickname {
    justify-content: right;
  }

  /* .message-received {
    align-items: flex-start;
  }

  .message-sent {
    align-items: flex-end;
  }  */


  .message-content {
    padding: 8px 12px;
    border-radius: 15px;
    word-wrap: break-word;
  }

  .message-sent .message-content {
    background-color: #00A032 !important;
    color: white;
    border-top-right-radius: 4px;
    justify-content: right;
  }

  .message-received .message-content {
    background-color: #e9ecef;
    color: #333;
    border-top-left-radius: 4px;
    justify-content: left;
  }

  .message-time {
    font-size: 0.7rem;
    color: #6c757d;
    margin-top: 3px;
    text-align: center;
  }

  .chat-input {
    padding: 10px;
    border-top: 1px solid #ddd;
    display: flex;
    flex-direction: column;
  }


  .input-group {
    display: flex;
    flex-direction: row-reverse;
    width: 100%;
  }

  .message-area {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 18px;
    resize: none;
    font-size: 14px;
    outline: none;
    transition: border-color 0.3s;
    min-height: 100px;
  }

  .input-group .send-button {
    margin: 12px 0;
    padding: 12px 24px;
    background-color: #00A032;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
  }
</style>

<!-- <div class="modal fade style3" id="chat-dialog" tabindex="-1" role="dialog"> -->
<div class="modal fade style1" id="chat" tabindex="-1" role="dialog">
  <div class="modal-dialog modal-dialog-centered modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header justify-content-center mt-20">
        <h5 class="modal-title" id="chat-dialog-title">Chat</h5>
        <button type="button" class="close" data-bs-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body">
        <div class="chat-container">
          <div class="chat-messages" id="chat-messages">
            <!-- 聊天消息将在这里动态添加 -->
          </div>
          <div class="chat-input">
            <textarea class="form-control message-area" id="chat-message-input" rows="5"
              placeholder="Enter message..."></textarea>
            <div class="input-group">
              <button class="btn btn-dark send-button" type="button" id="send-message-btn">Send</button>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
<script>

  const chatMessages = document.getElementById('chat-messages');
  const chatMessageInput = document.getElementById('chat-message-input');
  const sendButton = document.getElementById('send-message-btn');
  let messageList = [];

  //WebSocket封装对象
  const socket = {
    ws: null,
    init(chatId) {
      if (chatId !== null && chatId !== '') {
        const host = window.location.host;
        const url = `ws://${host}/websocket?chatId=${chatId}`;
        this.ws = new WebSocket(url);

        try {
          this.ws.onopen = () => {
            console.log('connecting...')
          };

          this.ws.onmessage = (event) => {
            const message = event.data;
            const messageEvent = new CustomEvent('wsMessage', { detail: { message: message } });
            window.dispatchEvent(messageEvent);

          }

          this.ws.onerror = (event) => {
            console.log('error...');
          }

          this.ws.onclose = () => {
            console.log('closing...');
            setTimeout(() => {
              if (localStorage.getItem("chatId")) {
                this.init(localStorage.getItem("chatId"));
              }
            }, 3000);
          }
        } catch (error) {
          console.error('connecting fail...')
        }
      }
    },
    send(data) {
      if (this.ws && this.ws.readyState === WebSocket.OPEN) {
        this.ws.send(JSON.stringify(data));
      } else {
        console.warn('disconnecting...')
      }
    },
    close() {
      if (this.ws) {
        this.ws.close();
        this.ws = null;
      }
    }
  }

  // 发送消息功能
  function sendMessage() {
    const message = chatMessageInput.value.trim();
    if (message) {
      appendMessage('我', message, true);
      chatMessageInput.value = '';
      // 发送消息到服务器
      const messageData = {
        spaceId: null,
        saleId: null,
        saleName: null,
        customerId: null,
        customerName: null,
        content: message,
        messageType: 1,
      };
      socket.send(messageData);
    }
  }

  //创建元素
  function createMessageElement(sender, message, isSent) {

    /**
    <div class="message message-received">
      <div class="message-content">hello this</div>
      <div class="message-time">16:52</div>
    </div>*/

    /**
    <div class="message message-received">
      <div class="message-wrap">
        <div class="message-avtar"><i class="icon-user"></i></div>
        <div class="message-info">
          <div class="message-nickname">hello</div>
          <div class="message-content">hello this</div>
        </div>
      </div>
      <div class="message-time">16:52</div>
    </div>*/

    const messageDiv = document.createElement('div');
    messageDiv.className = `message ${isSent ? 'message-sent' : 'message-received'}`;

    const messageWrap = document.createElement('div');
    messageWrap.classList.add('message-wrap')

    ///
    const messageAvatar = document.createElement('div');
    messageAvatar.className = 'message-avtar';
    const i = document.createElement('i');
    i.className = 'icon-user';
    messageAvatar.append(i);


    ///
    const messageInfo = document.createElement('div');
    messageInfo.className = 'message-info';

    const messageNickName = document.createElement('div');
    messageNickName.className = 'message-nickname';
    messageNickName.textContent = sender;


    const messageContent = document.createElement('div');
    messageContent.className = 'message-content';
    messageContent.textContent = message;

    messageInfo.appendChild(messageNickName);
    messageInfo.appendChild(messageContent);


    const messageTime = document.createElement('div');
    messageTime.className = 'message-time';

    // const now = new Date();
    // messageTime.textContent = `${now.getHours().toString().padStart(2, '0')}:${now.getMinutes().toString().padStart(2, '0')}`;


    //
    messageWrap.appendChild(messageAvatar);
    messageWrap.appendChild(messageInfo);


    //
    messageDiv.appendChild(messageWrap);
    // messageDiv.appendChild(messageTime);
    return messageDiv;
  }

  // 添加消息到聊天窗口
  function appendMessage(sender, message, isSent) {
    const messageDiv = createMessageElement(sender, message, isSent);
    chatMessages.appendChild(messageDiv);
    chatMessages.scrollTop = chatMessages.scrollHeight;
  }

  //插入消息到聊天窗口
  function prependMessage(sender, message, isSent) {
    const messageDiv = createMessageElement(sender, message, isSent);
    chatMessages.prepend(messageDiv);
  }

  document.addEventListener('DOMContentLoaded', function () {
    const chat = document.getElementById('chat-badge');
    chatId = localStorage.getItem("chatId");
    if (chatId && chatId !== '') {
      socket.init(chatId);
      chat.classList.remove('display-none')
    } else {
      socket.close();
      chat.classList.add('display-none');
    }

    window.addEventListener('localStorageUpdated', (event) => {
      if (event.detail.key === 'chatId') {
        chatId = localStorage.getItem("chatId");
        if (chatId && chatId !== '') {
          socket.init(chatId);
          chat.classList.remove('display-none')
        } else {
          socket.close();
          chat.classList.add('display-none');
        }
      }
    })




    // 绑定发送按钮点击事件
    sendButton.addEventListener('click', sendMessage);

    // 绑定输入框回车事件
    chatMessageInput.addEventListener('keypress', function (e) {
      if (e.key === 'Enter') {
        sendMessage();
      }
    });
  });

  window.addEventListener('wsMessage', (event) => {
    const message = JSON.parse(event.detail.message);
    const saleName = message.saleName;
    appendMessage(saleName, message.content, false);
  })

  const productModel = document.getElementById('chat');
  productModel.addEventListener("show.bs.modal", function (event) {
    $.ajax({
      type: 'POST',
      url: '/api/inquiry/chat',
      data: { chatId: localStorage.getItem("chatId") }
    }).done(resp => {
      const data = resp.data;
      messageList = data;
      data.forEach(element => {
        appendMessage(element.messageType === 1 ? 'Me' : element.saleName, element.content, isSent = element.messageType === 1 ? true : false);
      });
    })

    /*
    // 插入元素后，先强制触发重排
    container.appendChild(newDiv);
    // 读取offsetHeight/offsetWidth等布局属性，强制更新布局
    container.offsetHeight; // 仅读取，无需赋值，触发重排
    */
    /*
     // 2. 在下一帧渲染前获取scrollHeight
     requestAnimationFrame(() => {
       // 此时布局已更新，能拿到准确值
       chatMessages.scrollTop = chatMessages.scrollHeight;
       console.log('准确的scrollHeight：', chatMessages.scrollTop);
     });
     console.log(chatMessages.scrollHeight)
     chatMessages.scrollTop = chatMessages.scrollHeight;
     */
    /*
    const observer = new MutationObserver(() => {
      // 变化触发后，获取最新scrollHeight
      const realScrollHeight = chatMessages.scrollHeight;
      console.log('DOM变化后scrollHeight：', realScrollHeight);
    })

    // 配置观察选项：监听子节点添加/移除
    observer.observe(chatMessages, { childList: true });
    */


  })

  productModel.addEventListener('shown.bs.modal', function (event) {
    chatMessages.scrollTop = chatMessages.scrollHeight;
  })


  productModel.addEventListener("hide.bs.modal", function (event) {

  })

  productModel.addEventListener('hidden.bs.modal', function (event) {
    messageList = [];
    chatMessages.innerHTML = '';
  })

  chatMessages.addEventListener('scroll', () => {
    if (chatMessages.scrollTop === 0) {
      if (messageList.length === 0) {
        return;
      }
      const messageItem = messageList[0];
      if (messageItem.sort === 0) {
        return;
      }

      $.ajax({
        type: 'POST',
        url: '/api/inquiry/chat',
        data: { chatId: localStorage.getItem("chatId"), sort: messageItem.sort }
      }).done(resp => {
        if (resp.data.length > 0) {
          const data = resp.data;
          messageList = [...data, messageList];
          data.reverse();
          data.forEach(element => {
            prependMessage(element.messageType === 1 ? 'Me' : element.saleName, element.content, isSent = element.messageType === 1 ? true : false);
          })
          const offset = chatMessages.offsetHeight;
          chatMessages.scrollTop = offset;
        }
      })
    }
  })
</script>
<!-- modals end -->
<!-- Cookie授权弹框 -->
<div class="cookie-consent-modal p-4" id="cookieConsentModal">
  <div class="container">
    <div class="row align-items-center">
      <div class="col-md-8 mb-3 mb-md-0">
        <div class="d-flex justify-content-between align-items-center mb-2">
          <h5 class="mb-0"><i class="fa fa-cookie-bite text-warning me-2"></i>Cookie Policy Tips</h5>
          <button type="button" class="btn-close" id="closeCookieConsentModalBtn" aria-label="关闭弹框"></button>
        </div>
        <p class="mb-3 small">We use cookies to enhance your experience, including<span
            class="text-primary fw-bold">Necessary Cookie</span>Ensure the operation of the core functions
          of the website (no authorization required)，<span class="text-secondary fw-bold">Not necessary
            Cookie</span>For data analysis/personalized recommendation (with your authorization).</p>

        <!-- Cookie分类说明 -->
        <div class="cookie-category">
          <h6>📌 Necessary Cookie</h6>
          <p>It is used for core functions such as login status, shopping cart, and form submission. Disabling
            it will cause the website to be unusable. It can be used without your authorization.</p>
        </div>
        <div class="cookie-category">
          <h6>📊 Not necessary Cookie</h6>
          <p>It is used for user behavior analysis, personalized advertising recommendation, and website
            experience optimization. You can choose whether to authorize or not. Disabling it will not
            affect the use of core functions.</p>
        </div>
      </div>

      <div class="col-md-4 d-flex flex-column gap-2">
        <!-- 详细设置按钮 -->
        <button class="btn btn-outline-secondary btn-sm" type="button" data-bs-toggle="collapse"
          data-bs-target="#cookieSettingsCollapse" aria-expanded="false" aria-controls="cookieSettingsCollapse">
          <i class="fa fa-cog me-1"></i> Detailed Settings
        </button>

        <!-- 详细设置面板 -->
        <div class="collapse mt-2" id="cookieSettingsCollapse">
          <div class="form-check mb-2">
            <input class="form-check-input" type="checkbox" id="necessaryCookie" checked disabled>
            <label class="form-check-label" for="necessaryCookie">
              Essential Cookie (cannot be disabled)
            </label>
          </div>
          <div class="form-check mb-2">
            <input class="form-check-input" type="checkbox" id="analyticsCookie" checked>
            <label class="form-check-label" for="analyticsCookie">
              Analytical Cookie
            </label>
          </div>
          <div class="form-check mb-2">
            <input class="form-check-input" type="checkbox" id="marketingCookie" checked>
            <label class="form-check-label" for="marketingCookie">
              Marketing/Advertising Cookie
            </label>
          </div>
          <button class="btn btn-primary flex-1" id="acceptCustomCookies">
            Accept customization Cookie
          </button>
        </div>

        <!-- 操作按钮组 -->
        <div class="d-flex gap-2 mt-2">
          <button class="btn btn-outline-primary flex-1" id="acceptNecessaryOnly">
            Only accept necessary Cookie
          </button>
          <button class="btn btn-primary flex-1" id="acceptAllCookies">
            Accept everything Cookie
          </button>
        </div>

        <!-- 隐私政策链接 -->
        <a href="#" class="small text-decoration-none mt-2 text-center" data-bs-toggle="modal"
          data-bs-target="#privacyPolicyModal">View the full privacy policy</a>

        <!-- 隐私政策弹窗 -->
        <div class="modal fade" id="privacyPolicyModal" tabindex="-1" aria-labelledby="privacyPolicyModalLabel"
          aria-hidden="true">
          <div class="modal-dialog modal-dialog-scrollable">
            <div class="modal-content">
              <div class="modal-header">
                <h5 class="modal-title" id="privacyPolicyModalLabel">Privacy Policy</h5>
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
              </div>
              <div class="modal-body">
                <h6>1. Information Collection</h6>
                <p>The types of information we collect and the ways we use it are as follows:</p>
                <ul>
                  <li><strong>Necessary Cookie: </strong>These cookies are essential for the basic
                    functions of the website, including security features, preference Settings, and
                    language Settings, etc. These cookies do not collect your personal identifiable
                    information.</li>
                  <li><strong>Analysis Cookie: </strong>These cookies help us understand how the
                    website is used, which pages are the most popular, and how users navigate
                    between different pages. This information helps us improve the user experience
                    of the website.
                  </li>
                  <li><strong>Marketing/Advertising Cookie: </strong>These cookies are used to display
                    relevant advertisements based on your browsing habits and interests. They can
                    also limit the frequency of advertisement displays and help measure the
                    effectiveness of advertising campaigns.
                  </li>
                </ul>

                <h6>2. Information Usage</h6>
                <p>We use the collected information to:</p>
                <ul>
                  <li>Maintain and improve our services</li>
                  <li>Process your transactions and send relevant information</li>
                  <li>Send news, marketing and promotional information (with your consent)</li>
                  <li>Determine the usage trends of the website</li>
                  <li>Protect us from fraud and abuse</li>
                </ul>

                <h6>3. Information Sharing</h6>
                <p>We will not sell, trade or transfer your personal information to any third party
                  without your consent. We may share information with the following types of entities:
                </p>
                <ul>
                  <li>Service provider: Helps us operate our website and business</li>
                  <li>Business partner: For joint marketing activities</li>
                  <li>Under legal requirements: such as abiding by the law, protecting our rights or
                    safeguarding the safety of others</li>
                </ul>

                <h6>4. Cookie Management</h6>
                <p>You can manage your Cookie preferences through browser Settings. Please note that if
                  cookies are disabled, some website functions may not work properly.</p>

                <h6>5. Data Security</h6>
                <p>We take appropriate security measures to protect your personal information from
                  unauthorized access, alteration, disclosure or destruction. All sensitive
                  information transmitted through our website is protected by encryption technology.
                </p>

                <h6>6. Policy Update</h6>
                <p>We may update this Privacy Policy from time to time. Any changes will be announced on
                  this page and the "Last Updated" date at the top of the page will be updated.</p>

                <h6>7. Contact Us</h6>
                <p>If you have any questions or suggestions regarding this Privacy Policy, please
                  contact us through the following methods:</p>
                <p>Email: <a href="mailto:lynn@gtcpackaging.com">lynn@gtcpackaging.com</a>
                </p>
              </div>
              <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">关闭</button>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

<!-- 引入Bootstrap 5 JS和Popper -->
<!--<script th:src="@{/js/popper.min.js}"></script>-->

<script>
  // 页面加载后显示Cookie弹框
  document.addEventListener('DOMContentLoaded', function () {
    // 初始化折叠面板
    const cookieSettingsCollapse = new bootstrap.Collapse(document.getElementById('cookieSettingsCollapse'), {
      toggle: false
    });
    const cookieModal = document.getElementById('cookieConsentModal');
    // 检查是否已保存Cookie授权状态，未保存则显示弹框
    if (!localStorage.getItem('cookieConsent')) {
      setTimeout(() => {
        cookieModal.classList.add('show');
      }, 500);
    }

    // 按钮事件处理
    const cookieSettingsBtn = document.querySelector('[data-bs-toggle="collapse"]');
    const acceptAllBtn = document.getElementById('acceptAllCookies');
    const acceptNecessaryBtn = document.getElementById('acceptNecessaryOnly');
    const acceptCustomBtn = document.getElementById('acceptCustomCookies');
    const closeCookieConsentModalBtn = document.getElementById('closeCookieConsentModalBtn');

    // 详细设置按钮点击事件
    cookieSettingsBtn.addEventListener('click', function () {
      // 使用Bootstrap的toggle方法来切换展开/收起状态
      cookieSettingsCollapse.toggle();
      // 更新按钮的aria-expanded状态
      // const isExpanded = cookieSettingsCollapse._isShown() ? 'true' : 'false';
      // this.setAttribute('aria-expanded', isExpanded);
    });

    // 接受所有Cookie
    acceptAllBtn.addEventListener('click', function () {
      saveCookieConsent(true, true, true);
      hideCookieModal();
      // 这里可添加启用所有非必要Cookie的业务逻辑
      console.log('用户已接受所有Cookie');
    });

    // 仅接受必要Cookie
    acceptNecessaryBtn.addEventListener('click', function () {
      saveCookieConsent(true, false, false);
      hideCookieModal();
      // 这里可添加禁用所有非必要Cookie的业务逻辑
      console.log('用户仅接受必要Cookie');
    });

    //接受自定义Cookie
    acceptCustomBtn.addEventListener('click', function () {
      // 获取用户选择的Cookie类型
      const necessary = document.getElementById('necessaryCookie').checked;
      const analytics = document.getElementById('analyticsCookie').checked;
      const marketing = document.getElementById('marketingCookie').checked;
      saveCookieConsent(necessary, analytics, marketing);
      hideCookieModal();
      // 这里可添加启用/禁用相应Cookie的业务逻辑
      console.log('用户已接受自定义Cookie设置');
    })



    closeCookieConsentModalBtn.addEventListener('click', function () {
      hideCookieModal();
    })

    // 保存授权状态到本地存储
    function saveCookieConsent(necessary, analytics, marketing) {
      localStorage.setItem('cookieConsent', JSON.stringify({
        necessary: necessary,
        analytics: analytics,
        marketing: marketing,
        timestamp: new Date().toISOString()
      }));
    }

    // 隐藏Cookie弹框
    function hideCookieModal() {
      cookieModal.classList.remove('show');
      // 可选：添加弹框隐藏动画后移除DOM
      setTimeout(() => {
        cookieModal.style.display = 'none';
      }, 300);
    }
  });
</script>



<script src="/myjs/product/quick-view.js"></script>
<script src="/myjs/product/compare.js"></script>
<script src="/myjs/product/wishlist.js"></script>
<script src="/myjs/product/add-to-cart.js"></script>
<script src="/myjs/utils.js"></script>
<script type="text/javascript">
  $(function () {

    //登录状态检查
    if (typeof navigator.cookieEnabled === 'boolean') {
      setInterval(() => {
        $.ajax({
          type: "POST",
          url: "/check/login",
        }).done(resp => {
          const cookie = document.cookie;
          // 使用示例
          const allCookies = parseCookieToObject(cookie);
          // console.log("所有Cookie:", allCookies);
          if (allCookies['loginStatus'] === 'false') {
          } else if (!allCookies['loginStatus']) {
          }
        })
      }, 1000*30);
    }
  })
</script>


  <!--***********************
    all js files
 ***********************-->

  <!--******************************************************
    jquery,modernizr ,poppe,bootstrap,plugins and main js
 ******************************************************-->


  <script src="/js/main.js"></script>
</body>

</html>