* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #f8f9fa;
    color: #333;
    overflow-x: hidden;
    justify-items: center;
    padding-top: 0;
}

header {
    position: relative;
    z-index: 1000;
}

/* 顶部导航和Banner区域 */
.top-section {
    color: white;
    position: relative;
    overflow-x: hidden;
    width: 100%;
}

.title-container {
    max-width: 1280px;
    margin: 0 auto;
    position: relative;
    display: flex;
    flex-direction: row;
}

.product-search {
    flex: 1;
    height: 80px!important;
}

.category-title {
    color: var(--color);
    width: 250px;
    background: rgba(238, 238, 238, 0.9);
    padding: 30px 0 0;
    position: relative;
    text-align: center;
}

.category-title h2 {
    font-size: 1.3rem;
}

.top-container {
    max-width: 1280px;
    margin: 0 auto;
    position: relative;
}

/* Banner区域 - 作为分类区域的背景 */
.banner-container {
    width: 100%;
    max-width: 1280px; /* 新增最大宽度限制 */
    margin: 0 auto; /* 新增居中 */
    z-index: 1;
}

.banner-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.banner-slide img {
    height: 500px;
    width: 100%;
    object-fit: cover;
}

.banner-slide.active {
    opacity: 1;
}

.banner-content {
    position: absolute;
    top: 50%;
    left: 10%;
    transform: translateY(-50%);
    max-width: 500px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
    z-index: 10;
}

.banner-content h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    color: white;
}

.banner-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: rgba(255,255,255,0.9);
}

.banner-btn {
    background: #ff6b6b;
    color: white;
    padding: 12px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    transition: all 0.3s;
}

.banner-btn:hover {
    background: #ff5252;
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

/* 分类区域 - 悬浮在Banner之上 */
.category-section {
    width: 100%;
    left: 0;
    transform: none;
    height: 500px;
    margin: 0; /* 负边距使其覆盖在banner上 */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    position: relative;
    z-index: 20;
}

.category-list {
    width: 250px;
    padding: 0;
    position: relative;
    list-style: none;
    height: 490px;
    overflow-y: auto;
    scrollbar-width: none;
}

.category-list h2 {
    color: var(--color);
    padding: 0 20px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 1.3rem;
    text-align: center;
}
.category-list h3 {
    color: var(--color);
    padding: 0 20px 15px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 1.3rem;
    text-align: center;
}

.category-container {
    height: 500px;
    width: 250px;
    background: rgba(238, 238, 238, 0.9);
}

.category-item {
    padding: 15px 20px;
    color: rgb(0, 0, 0);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.category-item.active {
    background: white;
    color: var(--color);
}

.category-item img {
    margin-right: 10px;
    width: 30px!important;
    margin-left: 20px;
}

.sub-categories {
    display: none;
    position: absolute;
    top: 0;
    left: 250px;
    flex: 1;
    padding: 25px;
    background: white;
    height: 500px;
    min-height: 350px;
    width: 1030px;
    background: rgba(255, 255, 255, 0.95);
}

.sub-categories.active {
    display: block;
}

.category-item:hover .sub-categories {
    display: block;
    animation: fadeIn 0.5s ease;
}


@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.sub-category-header {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: #2c3e50;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.sub-category-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.sub-container {
    height: 390px;
    width: 100%;
    overflow: auto;
    scrollbar-width: none;
}

.sub-category-card {
    background: #f8f9fa;
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: 0 3px 5px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    padding: 10px;

}

.sub-category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.05);
}

.sub-category-title {
    font-size: 1.2rem;
    padding: 10px;
    color: #2c3e50;
    font-weight: 600;
    display: flex;
    width: 150px;
}

.sub-category-title i {
    color: var(--color);
}

.sub-category-list {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    align-items: center;
    padding-bottom: 20px;
}

.sub-category-list li {
    padding: 8px 15px;   /* 内边距（可选）*/
}

.sub-category-list li:last-child {
    border-bottom: none;
}

.sub-category-list a {
    color: #555;
    text-decoration: none;
    transition: color 0.3s;
}

.sub-category-list a:hover {
    color: var(--color);
}

/* 品牌合作区 */
.brand-section {
    max-width: 1280px;
    margin: 80px auto 50px;
    padding: 0 20px;
    width: 100%;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
    color: #2c3e50;
    position: relative;
    font-size: 2.2rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: #ff6b6b;
    border-radius: 2px;
}

.brand-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
}

.brand-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: all 0.3s;
    text-align: center;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.brand-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

.brand-logo {
    width: 100px;
    height: 100px;
    background: #f8f9fa;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 2.5rem;
}

.brand-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.brand-desc {
    color: #777;
    font-size: 0.95rem;
}

/* 产品展示区 */
.product-section {
    margin: 50px auto;
    display: flex;
    justify-content: flex-end;
}

.nav-tags {
    width: 200px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    position: sticky;
    top: 80px;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.nav-tags h3 {
    color: var(--color);
    margin: 20px 0 0;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
    text-align: center; /* 标题文本居中 */
    width: 100%; /* 保证标题宽度与容器一致 */
}

.tag-list {
    list-style: none;
    width: 100%;
}

.tag-item {
    padding: 12px 15px;
    cursor: pointer;
    transition: all 0.3s;
    color: #555;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 65px;
}

.tag-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 75%;
    height: 1px;
    background-color: #f0f0f0;
}

/* 移除最后一个元素的底边线 */
.tag-item:last-child::after {
    background-color: transparent;
}

.tag-item:hover {
    color: var(--color);
}

.tag-item:hover::before {
    background: var(--color);
}

.tag-item.active {
    font-weight: 600;
    background-color: var(--color);
    position: relative;
    color: transparent; /* 隐藏原始文字 */
}

.tag-item.active::before {
    background: var(--color);
    width: 10px;
    height: 10px;
}

.tag-item.active::after {
    content: attr(data-index) "L"; /* 覆盖原有伪元素 */
    width: auto; /* 移除横线宽度 */
    height: auto; /* 移除横线高度 */
    background-color: transparent; /* 清除背景色 */
    bottom: auto; /* 重置定位 */
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
}

.product-container {
    flex: 1;
    margin-left: 30px;
    max-width: 1280px;
    width: 100%;
}

.product-category {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: auto 1fr 1fr;
    gap: 10px; /* 元素间距 */
    padding: 10px 10px 0 0;
    background-color: #f0f0f0;
    min-height: 300px; /* 容器最小高度 */
    margin-top: 20px;
    scroll-margin-top: 80px;
}

.cat-title {
    grid-column: 1 / span 5; /* 占据全部5列 */
    grid-row: 1; /* 在第1行 */
    padding: 10px;
    text-align: center;
    color: var(--color);
}

.cat-pic {
    grid-column: 1; /* 第1列 */
    grid-row: 2 / span 2; /* 从第2行开始，跨越2行 */
    background-color: #c7ceea;
    text-align: center;
}

.cat-pic img {
    height: 100%;
}

.product-grid {
    grid-column: 2 / span 4; /* 从第2列开始，跨越4列 */
    grid-row: 2 / span 2; /* 从第2行开始，跨越2行 */
    /*background-color: #e2f0cb;*/
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(5, 2fr);
    grid-auto-rows: 0.8fr;
    gap: 10px;
}

.product-card {
    background: #f8f9fa;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.product-img {
    height: 80px;
    background-size: cover;
    background-position: center;
    position: relative;
    text-align: center;
}

.product-img img {
    margin: 10px;
    height: 60px;
    transition: transform 0.3s;
}

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 107, 107, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.quick-view {
    background: white;
    color: #ff6b6b;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
}

.product-info {
    padding: 0;
}

.product-name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #2c3e50;
    text-align: center;
}

.product-price {
    color: #ff6b6b;
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.product-rating {
    color: #ffc107;
    margin-bottom: 15px;
}

.add-to-cart {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    font-weight: 600;
    transition: background 0.3s;
}

.add-to-cart:hover {
    background: #ff5252;
}

/* 页脚 */
.footer {
    background: #2c3e50;
    color: rgba(255,255,255,0.7);
    padding: 60px 0 30px;
    margin-top: 50px;
}

.footer-content {
    max-width: 1280px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    padding: 0 20px;
}

.footer-column h3 {
    color: white;
    margin-bottom: 25px;
    font-size: 1.3rem;
    position: relative;
    padding-bottom: 10px;
}

.footer-column h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: #ff6b6b;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #ff6b6b;
}

.contact-info {
    list-style: none;
}

.contact-info li {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
}

.contact-info i {
    margin-right: 10px;
    color: #ff6b6b;
    margin-top: 4px;
}

.social-icons {
    display: flex;
    margin-top: 20px;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    color: white;
    border-radius: 50%;
    margin-right: 10px;
    transition: all 0.3s;
}

.social-icons a:hover {
    background: #ff6b6b;
    transform: translateY(-3px);
}

.product-box {
    display: flex;
    flex-direction: row;
}

.sub-category img {
    display: none;
}

.product-search {
    background-color: #f8f9fa!important;
}

.hot-products {
  display: none;
}

.product-search {
    background: #ffffff;
    height: 100px;
}

.product-search form {
    display: flex;
    align-items: center;
    height: 100%;
    justify-content: center;
}

.search {
    position: relative;
    display: inline-block;
    width: 50%;
}

.search input {
    border-radius: 20px;  /* 输入框整体圆角 */
    padding-right: 90px;  /* 右侧留出按钮空间 */
    width: 100%;
    height: 40px;
    border: 1px solid #ddd;
    padding-left: 20px;
    box-sizing: border-box; /* 新增盒子模型 */
}

.search button {
    border-radius: 20px;  /* 按钮整体圆角 */
    width: 80px;
    font-size: 16px;
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 40px;
    padding: 0 20px;
    background: #0887cf;
    color: white;
    border: none;
    border-top-left-radius: 0;    /* 去除按钮左侧圆角 */
    border-bottom-left-radius: 0;
}

.search button:hover {
    background: #0271bb;
}

.search button:active {
    transform: translateY(-50%) scale(0.98);
}

.search input:focus {
    outline: none;
    border-color: #0887cf;
    box-shadow: 0 0 5px rgba(0,123,255,0.3);
}


/* 响应式设计 */
@media (max-width: 1024px) {

    .banner-container, .nav-tags, .brand-section, .cat-pic, .category-title, .sub-cat, .category-item img {
        display: none;
    }

    .top-section {
       padding: 0;
    }

    .category-section {
        flex-direction: row;
        height: unset;
    }

    .category-container {
        height: auto;
    }

    .category-list {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        padding: 0 5px;
        scrollbar-width: none;
        height: 50px;
        width: 100vw;
        background: white;

    }

    .category-item {
        font-size: 14px;
    }

    .category-title {
        width: 110px;
    }

    .category-title h2 {
        font-size: 16px;
    }

    .sub-container {
        height: 500px;
    }

    .sub-cat {
        flex: 1;
    }

    .sub-categories {
        left: 110px;
        padding: 0 10px;
        width: unset;
    }

    .category-item.active {
        background-color: white;
        color: var(--color);
    }

    .sub-categories h3 {
        display: none;
    }

    .sub-category-title {
        font-size: 14px;
        padding: 10px 0 0;
    }

    .sub-category-list a {
        font-size: 12px;
    }

    .sub-category-list{
        padding-bottom: 0;
        display: flex;
        flex-wrap: wrap;
        width: 100%;
        margin: 0 -5px;
    }


    .sub-category-card {
        flex-direction: column;
        background-color: white;
        padding: 0 10px 0 15px;
        width: 100%;
        margin-top: 10px;
    }

    .sub-category-list li {
        flex: 0 0 auto;
        max-width: calc(50% - 10px);
        margin: 0 5px;
        padding: 5px;
        box-sizing: border-box;
    }


    .product-container {
        margin-left: 0;
        padding: 0 10px;
    }

    .product-grid {
        grid-template-columns: repeat(4, 1fr);
        grid-template-rows: repeat(2, 1fr);
        grid-column: 1 / span 5;
        grid-auto-rows: 0;
        overflow: hidden;
        padding: 0;
        gap: 5px;
    }

    .product-name {
        font-size: 12px;
    }

    .search {
        width: 80%;
    }

    .product-search {
        height: auto;
        padding: 20px;
    }

    .product-search form {
        width: 100%;
    }

    .search input {
        border-radius: 20px;  /* 输入框整体圆角 */
        padding-right: 90px;  /* 右侧留出按钮空间 */
        width: 80%;
        height: 40px;
        border: 1px solid #ddd;
        padding-left: 20px;
    }

    .hot-products {
        display: block;
        margin: 0;
        padding: 0 10px;
    }

    .sidebar-item.related {
        padding: 10px 5px;
    }

    .scroll-indicator-dots {
        display: none;
    }

    .related-list {
        display: flex;
        flex-wrap: wrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 10px 5px;
        background: white;
    }

    .sidebar-title {
        font-size: 14px;
        margin: 10px 16px;
        color: red;
        font-weight: 500;
    }

    .related-item {
        flex: 0 0 auto;
        max-width: calc(25% - 10px);
        margin: 0 5px;
        padding: 5px;
        box-sizing: border-box;
    }

   .related-item img {
       height: 80px;
       width: 80px;
       object-fit: cover;
   }

   .related-title {
       font-size: 11px;
   }

    .product-section {
       margin: 10px auto;
   }

    .product-category {
        margin-top: 10px;
        padding: 10px;
    }

    .product-category:first-child {
        background-image: url(../images/app1.jpg);
    }

    .product-category:nth-child(2) {
        background-image: url(../images/app2.jpg);
    }

    .product-category:nth-child(3) {
        background-image: url(../images/app3.jpg);
    }

    .product-category:nth-child(4) {
        background-image: url(../images/app4.jpg);
    }

    .product-category:nth-child(5) {
        background-image: url(../images/app5.jpg);
    }

    .product-category:nth-child(6) {
        background-image: url(../images/app6.jpg);
    }

    .product-category:nth-child(7) {
        background-image: url(../images/app7.jpg);
    }

    .product-card {
        padding: 0 10px;
    }

    .product-img {
        height: auto;
    }

    .product-img img {
        margin: 10px 0 0 0;
    }

}
