body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}

.bg-image {
    min-height: 100vh;
    background-size: cover;
    background-position: center;
    position: relative;
}

.navbar {
    width: 200px;  /* 减小宽度 */
    /* 修改背景颜色透明度为 70% */
    background-color: rgba(51, 51, 51, 0.7);
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    text-align: center;  /* 添加文本居中 */
}

.nav-brand {
    color: white;
    padding: 20px;
    font-size: 1.5em;
    text-align: center;
    background-color: #222;
}

.nav-item {
    color: white;
    text-decoration: none;
    padding: 12px 15px;
    display: block;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    position: relative;
    overflow: hidden;
}

.nav-item:hover {
    background-color: #444;
    border-left: 4px solid #a1a1a1;
    transform: translateX(5px);
}



.nav-item:hover::after {
    transform: translateX(0);
}

.sub-nav {
    display: none;
    /* 修改背景颜色并设置 50% 透明度 */
    background-color: rgba(68, 68, 68, 0.5); 
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateX(-10px);
}

.nav-item-container:hover .sub-nav {
    display: block;
    opacity: 0.5; /* 保持下拉导航栏透明度为 30% */
    transform: translateX(0);
    animation: slideDown 0.3s ease-out;
}

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

.sub-nav-item {
    color: #ddd;
    text-decoration: none;
    padding: 8px 20px;
    display: block;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.sub-nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #555;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
    z-index: -1;
}

.sub-nav-item:hover::before {
    transform: scaleX(1);
}

.content {
    margin-left: 220px;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}

.product {
    flex: 0 0 calc(25% - 20px);
    max-width: 280px;
    text-align: left;
    padding: 15px;
    box-sizing: border-box;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    justify-content: flex-start;
    min-height: 280px;
}

.product:hover {
    border: 1px solid #ccc;
    transform: translateY(-5px);
}

.product-image {
    width: 50%;
    height: auto;
    margin: 15px 0 10px 0;
    transition: transform 0.3s ease;
    display: block;
    object-fit: contain;
    max-height: 120px;
    min-height: 120px;
    object-position: center;
}

.product-image:hover {
    transform: scale(1.05);
}

.product-thumbnails {
    display: flex;
    justify-content: center;
    margin: 5px 0;
    gap: 10px;
    width: 100%;
}

.product-thumbnails img {
    width: 40px;
    height: 30px;
    border: none;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.product-thumbnails img:nth-child(1):hover {
    outline: 2px solid transparent;
    border-top: 2px solid #ff6b6b;
    border-bottom: 2px solid #ffd93d;
    border-left: 2px dashed #ff6b6b;
    border-right: 2px dashed #ffd93d;
}

.product-thumbnails img:nth-child(2):hover {
    outline: 2px solid transparent;
    border-top: 2px solid #4ecdc4;
    border-bottom: 2px solid #45b7d1;
    border-left: 2px dashed #4ecdc4;
    border-right: 2px dashed #45b7d1;
}

.product-thumbnails img:nth-child(3):hover {
    outline: 2px solid transparent;
    border-top: 2px solid #96e6a1;
    border-bottom: 2px solid #6454f0;
    border-left: 2px dashed #96e6a1;
    border-right: 2px dashed #6454f0;
}

.product-thumbnails img:nth-child(4):hover {
    outline: 2px solid transparent;
    border-top: 2px solid #ff758c;
    border-bottom: 2px solid #ff7eb3;
    border-left: 2px dashed #ff758c;
    border-right: 2px dashed #ff7eb3;
}

.text-container {
    width: 100%;
    padding: 0 10px;
    box-sizing: border-box;
    margin-top: 5px;
}

.product-price {
    color: red;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 5px;
    text-align: left;
    margin-left: 5px;
    width: 100%;
}

.product-price::first-letter {
    font-size: 14px;
    vertical-align: baseline;
}

.product-name {
    font-size: 14px;
    color: white; /* 修改文字颜色为白色 */
    margin-bottom: 5px;
    text-align: left;
    position: relative;
    float: left;
    width: 100%;
    text-decoration: none;
    margin-left: 5px;
}

.product-description {
    font-size: 12px;
    color: white; /* 修改文字颜色为白色 */
    text-decoration: none;
    float: left;
    transition: all 0.3s ease;
    position: relative;
    margin-left: 5px;
    width: 100%;
}

.product-description::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: blue;
    transition: width 0.3s ease;
}

.product-description:hover::after {
    width: 100%;
}

.back-button {
    position: fixed;
    top: 80px;
    left: 20px;
    padding: 15px 35px;
    background: linear-gradient(135deg, #6e8efb, #4a6cf7);
    border-radius: 10px;
    color: white;
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 4px 15px rgba(110, 142, 251, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.back-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(110, 142, 251, 0.6);
    background: linear-gradient(135deg, #4a6cf7, #6e8efb);
}

.back-to-home {
    position: fixed;
    right: 20px;
    bottom: 20px;
    padding: 10px 20px;
    background-color: #747475;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    z-index: 1000; /* 确保按钮显示在其他元素之上 */
}

.back-to-home:hover {
    background-color: #4d4d4d;
}


.white-box-wrapper {
    background-color: #fff; /* 设置白色背景 */
    padding: 20px; /* 内边距 */
    border-radius: 10px; /* 圆角边框 */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); /* 添加阴影 */
    width: 100%; /* 宽度占满父容器 */
    box-sizing: border-box; /* 让内边距和边框包含在宽度内 */
}