/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft Yahei", sans-serif;
}

/* 基础样式 */
body {
    color: #333;
    background-color: #f9f9f9;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* 头部导航 - 公共样式 */
header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    /* 左对齐logo */
    flex: 0 0 auto;
}

.logo img {
    height: 40px;
}

/* 右上角导航样式 */
.nav-wrapper {
    display: flex;
    align-items: center;
    gap: 30px; /* 导航和购物车之间的间距 */
}

.nav-list {
    display: flex;
    gap: 30px;
    margin: 0;
    padding: 0;
}

.nav-list li a {
    font-size: 16px;
    font-weight: 500;
    position: relative;
}

/* 导航选中态 */
.nav-list li a.active {
    color: #8a9c8b;
}

.nav-list li a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #8a9c8b;
}

.nav-list li a:hover {
    color: #8a9c8b;
}

.cart-icon {
    font-size: 20px;
    cursor: pointer;
}

/* 首页轮播图 */
.banner {
    width: 100%;
    height: 600px;
    overflow: hidden;
    position: relative;
    cursor: pointer; /* 点击轮播图可跳转 */
}

.banner-slide {
    width: 100%;
    height: 100%;
    display: none;
    position: absolute;
    top: 0;
    left: 0;
}

.banner-slide.active {
    display: block;
}

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

.banner-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.banner-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.6);
    cursor: pointer;
}

.banner-dot.active {
    background-color: #fff;
}

/* 首页推荐区域 */
.home-recommend {
    padding: 80px 0;
    text-align: center;
}

.section-title {
    font-size: 28px;
    margin-bottom: 40px;
    color: #2c3e50;
}

.recommend-btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: #8a9c8b;
    color: #fff;
    border-radius: 4px;
    font-size: 18px;
    margin-top: 20px;
}

.recommend-btn:hover {
    background-color: #7a8b7b;
}

/* 商品列表页样式 */
.products {
    padding: 80px 0;
}

/* 商品分类筛选栏 */
.product-filter {
    text-align: center;
    margin-bottom: 40px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}

.filter-btn {
    padding: 8px 20px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn.active {
    background-color: #8a9c8b;
    color: #fff;
    border-color: #8a9c8b;
}

.filter-btn:hover:not(.active) {
    border-color: #8a9c8b;
    color: #8a9c8b;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 40px;
}

.product-card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-img {
    width: 100%;
    height: 350px;
    overflow: hidden;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.product-info {
    padding: 20px;
    text-align: center;
}

.product-name {
    font-size: 18px;
    margin-bottom: 10px;
}

.product-price {
    font-size: 16px;
    color: #e74c3c;
    margin-bottom: 15px;
}

.taobao-btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #ff4400;
    color: #fff;
    border-radius: 4px;
    font-size: 14px;
    border: none;
    cursor: pointer;
}

.taobao-btn:hover {
    background-color: #ff6600;
}

/* 商品详情弹窗 */
.product-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.product-modal.active {
    display: flex;
}

.modal-content {
    width: 80%;
    max-width: 900px;
    background-color: #fff;
    border-radius: 8px;
    padding: 30px;
    position: relative;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
}

.product-detail {
    display: flex;
    gap: 30px;
}

.detail-img {
    width: 50%;
}

.detail-img img {
    width: 100%;
    border-radius: 8px;
}

.detail-info {
    width: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.detail-name {
    font-size: 24px;
    margin-bottom: 15px;
}

.detail-desc {
    margin-bottom: 20px;
    color: #666;
}

.detail-price {
    font-size: 22px;
    color: #e74c3c;
    margin-bottom: 30px;
}

.taobao-link {
    display: inline-block;
    padding: 12px 30px;
    background-color: #ff4400;
    color: #fff;
    border-radius: 4px;
    font-size: 18px;
    text-align: center;
}

.taobao-link:hover {
    background-color: #ff6600;
}

/* 页脚 - 公共样式 */
footer {
    background-color: #333;
    color: #fff;
    padding: 60px 0 30px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
}

.footer-col {
    width: 23%;
}

.footer-col h3 {
    font-size: 18px;
    margin-bottom: 20px;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a:hover {
    color: #8a9c8b;
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #444;
    font-size: 14px;
    color: #999;
    padding-bottom: 10px;
}

/* 备案信息样式 */
.beian-info {
    text-align: center;
    font-size: 12px;
    color: #777;
    padding-top: 10px;
    border-top: 1px solid #444;
    margin-top: 10px;
}

.beian-info a {
    color: #777;
    margin: 0 5px;
}

.beian-info a:hover {
    color: #8a9c8b;
    text-decoration: underline;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .nav-wrapper {
        gap: 15px;
    }
    .nav-list {
        gap: 15px;
    }
    .nav-list li a {
        font-size: 14px;
    }
    .banner {
        height: 300px;
    }
    .product-detail {
        flex-direction: column;
    }
    .detail-img, .detail-info {
        width: 100%;
    }
    .footer-content {
        flex-direction: column;
        gap: 30px;
    }
    .footer-col {
        width: 100%;
    }
    
    .beian-info {
        font-size: 11px;
        padding: 10px 0;
    }
}