body {
    max-width: 640px;
    margin: 0 auto;
    background-color: #f5f5f5;
    padding: 0;
    box-sizing: border-box;
}

a {
    text-decoration: none;
    color: inherit;
}

a:hover, a:visited, a:active, a:link {
    text-decoration: none;
    color: inherit;
}

/* 顶部导航栏样式 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: #fff;
    display: flex;
    align-items: center;
    padding: 0 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    z-index: 1000;
    max-width: 640px;
    margin: 0 auto;
}

.header-left,
.header-right {
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-left {
    justify-content: flex-start;
}

.header-right {
    justify-content: flex-end;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    font-size: 18px;
    font-weight: bold;
}

/* 搜索框样式 */
.search-container {
    padding: 10px 10px;
    margin-top: 50px;
    background: #f5f5f5;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: #fff;
    border-radius: 10px;
    padding: 12px 15px;
    border: 1px solid #f0f0f0;
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0 10px;
    font-size: 14px;
    outline: none;
    color: #333;
}

.search-icon {
    color: #999;
    font-size: 16px;
}

/* 轮播图样式 */
.banner-container {
    padding: 0;
    margin: 0 10px;
    width: calc(100% - 20px);
    box-sizing: border-box;
    overflow: hidden;
}

.banner-swiper {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.banner-swiper .swiper-slide {
    width: 80% !important;
    height: auto;
    text-align: center;
    font-size: 18px;
    background: #fff;
    display: -webkit-box;
    display: -ms-flexbox;
    display: -webkit-flex;
    display: flex;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    -webkit-box-align: center;
    -ms-flex-align: center;
    -webkit-align-items: center;
    align-items: center;
    transition: 300ms;
    transform: scale(0.85);
    border-radius: 8px;
    overflow: hidden;
    z-index: 1;
    transition: transform 0.3s ease;
}

.banner-swiper .swiper-slide-active,
.banner-swiper .swiper-slide-duplicate-active {
    transform: scale(1);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 2;
}

.banner-swiper .swiper-slide-prev,
.banner-swiper .swiper-slide-next {
    z-index: 1;
}

.banner-swiper img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

.banner-swiper .swiper-pagination {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.banner-swiper .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.6);
    opacity: 1;
    margin: 0 4px;
}

.banner-swiper .swiper-pagination-bullet-active {
    background: #fff;
}

/* 优惠券样式 */
.coupon-slide {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px;
    background: linear-gradient(to right, #f8bbd0, #e1bee7);
    border-radius: 8px;
    color: #fff;
}

.coupon-amount {
    font-size: 24px;
    font-weight: bold;
    color: #d81b60;
}

.coupon-desc {
    font-size: 14px;
    color: #333;
    margin-top: 5px;
}

.coupon-btn {
    background: #fff;
    color: #d81b60;
    border: none;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 公告栏样式 */
.notice-bar {
    display: flex;
    align-items: center;
    background: #fff;
    padding: 10px 12px;
    margin: 10px 10px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.notice-icon {
    margin-right: 10px;
    color: #ff6b6b;
    font-size: 16px;
}

.notice-content {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
}

.notice-text {
    display: inline-block;
    animation: marquee 15s linear infinite;
}

@keyframes marquee {
    0% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* 导航模块样式 */
.nav-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-auto-rows: minmax(min-content, max-content);
    gap: 10px;
    padding: 12px 15px;
    background: #fff;
    margin: 10px 10px;
    border-radius: 8px;
    box-sizing: border-box;
    width: calc(100% - 20px);
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

@media screen and (max-width: 375px) {
    .nav-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 5px;
        padding: 8px 10px;
    }
    
    .nav-icon {
        width: 40px;
        height: 40px;
    }
    
    .nav-text {
        font-size: 10px;
    }
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    width: 100%;
    padding: 5px;
    margin: 0 auto;
    box-sizing: border-box;
}

.nav-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;    
    overflow: hidden;
    margin-bottom: 5px;
}

.nav-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nav-text {
    font-size: 12px;
    color: #333;
    text-align: center;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 秒杀模块样式 */
.seckill-container {
    background: #fff;
    margin: 10px 10px;
    border-radius: 8px;
    padding: 12px;
}

.seckill-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.seckill-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.countdown {
    display: flex;
    align-items: center;
}

.countdown-item {
    background: #ff6b6b;
    color: #fff;
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 12px;
    margin: 0 2px;
}

.countdown-separator {
    color: #333;
    margin: 0 2px;
}

.seckill-swiper {
    width: 100%;
    overflow: hidden;
}

.seckill-swiper .swiper-wrapper {
    display: flex;
}

.seckill-swiper .swiper-slide {
    width: 150px;
    margin-right: 15px;
}

.seckill-product {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid #eee;
    margin: 0 2px;
}

.seckill-product-image {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
}

.seckill-product-info {
    padding: 10px;
}

.seckill-product-title {
    font-size: 14px;
    color: #333;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.seckill-product-price {
    display: flex;
    align-items: center;
}

.current-price {
    color: #ff6b6b;
    font-size: 16px;
    font-weight: bold;
    margin-right: 5px;
}

.original-price {
    color: #999;
    font-size: 12px;
    text-decoration: line-through;
}

/* 商品推荐模块样式 */
.product-section {
    background: #fff;
    margin: 10px 10px;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    line-height: 1.5;
}

.section-title {
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 12px;
}

.section-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 16px;
    background-color: #ef4444;
    border-radius: 1.5px;
}

/* 热门推荐图标 */
.product-section:nth-of-type(1) .section-title::after {
    content: '\f005';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-left: 8px;
    color: #ff9800;
}

/* 热卖单品图标 */
.product-section:nth-of-type(2) .section-title::after {
    content: '\f06b';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-left: 8px;
    color: #e91e63;
}

/* 特色好物图标 */
.product-section:nth-of-type(3) .section-title::after {
    content: '\f06d';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-left: 8px;
    color: #4caf50;
}

.view-more {
    font-size: 12px;
    color: #999;
    text-decoration: none;
    display: flex;
    align-items: center;
    padding: 0;
    height: 100%;
    margin-right: 5px;
    border: none;
    background: transparent;
}

.view-more::after {
    content: '>';
    margin-left: 4px;
}

/* 双列布局模块样式 */
.dual-column-container {
    display: flex;
    gap: 10px;
    margin: 10px 10px;
    aspect-ratio: 1.8/1;
}

.left-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.right-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    overflow: hidden;
    gap: 15px;
}

.right-top,
.right-bottom {
    flex: 1;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
}

.column-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.column-title {
    position: absolute;
    bottom: 10px;
    left: 10px;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.left-column .image-wrapper {
    aspect-ratio: 1/1;
}

.right-column .image-wrapper {
    height: 100%;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 8px;
}

.product-item {
    background: #f9f9f9;
    border-radius: 8px;
    overflow: hidden;
    padding-bottom: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.product-image {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
}

.product-info {
    padding: 6px 6px 2px 6px;
}

.product-title {
    font-size: 14px;
    color: #333;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-price {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    margin-top: 2px;
}

/* 底部间距，为固定导航留出空间 */
.bottom-space {
    height: 60px;
}

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
    z-index: 100;
    max-width: 640px;
    margin: 0 auto;
}

.bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    width: 20%;
}

.bottom-nav .nav-item .nav-icon2 {
    font-size: 20px;
    color: #666;
    margin-bottom: 4px;
    display: block;
    text-align: center;
    width: 100%;
    max-width: 20px;
    max-height: 20px;
    margin: 0 auto 4px;
}

/* 确保所有SVG图标在非激活状态下颜色一致 */
.bottom-nav .nav-item svg path {
    fill: #666;
}

/* 为img类型的SVG图标设置颜色 */
.bottom-nav .nav-item .nav-icon2 {
    color: #666;
    filter: invert(42%) sepia(0%) saturate(0%) hue-rotate(143deg) brightness(95%) contrast(92%);
}

.bottom-nav .nav-item span {
    font-size: 12px;
    color: #666;
    text-align: center;
}

.bottom-nav .nav-item.active .nav-icon2,
.bottom-nav .nav-item.active span {
    color: #ff4d4f;
}

.bottom-nav .nav-item.active .nav-icon2 {
    color: #ff4d4f;
    filter: invert(39%) sepia(79%) saturate(2449%) hue-rotate(328deg) brightness(100%) contrast(98%);
}

.bottom-nav .nav-item.active svg path {
    fill: #ff4d4f;
    /* 确保激活状态下SVG图标颜色覆盖默认颜色 */
    transition: fill 0.2s ease;
}
/* 确保在所有屏幕尺寸下导航栏都可见 */
@media screen and (max-width: 360px) {
    .category-sidebar {
        width: var(--sidebar-small-width);
        max-width: var(--sidebar-small-width);
    }
    
    .category-content {
        margin-left: var(--sidebar-small-width);
    }
    
    .sidebar-item {
        font-size: 12px;
        height: 50px;
    }
}