:root {
    --primary-color: #3a86ff;
    --secondary-color: #ff9e00;
    --accent-color: #8338ec;
    --discount-color: #e63946;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --text-color: #333;
    --text-light: #666;
    --border-radius: 8px;
    --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f5f7fb;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding:60px 0 20px;
}

/* 头部样式 */
header {
    background-color: white;
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo h1 {
    font-size: 1.8rem;
    color: var(--primary-color);
}

.logo i {
    color: var(--accent-color);
    font-size: 2rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    transition: var(--transition);
    position: relative;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a.active {
    color: var(--primary-color);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
}

/* 页面标题 */
.page-header {
    position: relative;
    background-image: url('../images/banner5.jpg'); /* 将图片设为背景 */
    background-size: cover; /* 背景覆盖整个容器，自适应比例裁剪 */
    background-position: center; /* 背景居中显示 */
    background-repeat: no-repeat; /* 防止背景重复 */
    min-height: 150px; /* 设置最小高度，根据需要调整 */
    display: flex;
    align-items: center; /* 垂直居中内容 */
    justify-content: center; /* 水平居中内容（可选） */
}

/* 可选：添加半透明遮罩层，让文字更清晰 */
.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4); /* 黑色半透明遮罩，0.4是透明度，可调整 */
    z-index: 1;
}

/* 确保文字在遮罩层上方 */
.page-header .container {
    position: relative;
    z-index: 2;
    color: white; /* 文字颜色设为白色，与深色遮罩形成对比 */
    text-align: center; /* 文字居中 */
}

/* 可选：调整标题样式 */
.page-header h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); /* 文字阴影增强可读性 */
}

.page-header p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .page-header {
        min-height: 300px;
    }
    
    .page-header h1 {
        font-size: 2rem;
    }
    
    .page-header p {
        font-size: 1rem;
    }
}

.swiper-slide img{
    width: 100%;
}

/* 筛选和排序 */
.store-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.filter-sort {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-btn, .sort-select {
    padding: 10px 20px;
    border-radius: var(--border-radius);
    border: 1px solid #ddd;
    background-color: white;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
}

.filter-btn:hover, .filter-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.sort-select {
    padding: 10px 15px;
}

.search-box {
    display: flex;
    max-width: 300px;
}

.search-box input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius) 0 0 var(--border-radius);
    font-size: 1rem;
}

.search-box button {
    padding: 0 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    cursor: pointer;
    transition: var(--transition);
}

.search-box button:hover {
    background-color: #2a75ff;
}

/* 产品网格 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}



.price-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.original-price {
    text-decoration: line-through;
    color: var(--text-light);
    font-size: 0.9rem;
}

.discount-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--discount-color);
}

.discount-badge {
    background-color: var(--discount-color);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.btn {
    padding: 8px 16px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: #2a75ff;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background-color: #e68900;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 50px 0 30px;
}

.pagination-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 600;
}

.pagination-btn:hover:not(:disabled) {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 产品详情模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    overflow-y: auto;
}

.modal-content {
    background-color: white;
    margin: 50px auto;
    width: 90%;
    max-width: 1000px;
    border-radius: var(--border-radius);
    overflow: hidden;
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    padding: 20px 30px;
    background-color: var(--light-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.8rem;
    color: var(--dark-color);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--discount-color);
}

.modal-body {
    padding: 30px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.modal-images {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.main-image {
    height: 300px;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnails {
    display: flex;
    gap: 10px;
}

.thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
}

.thumbnail.active {
    border-color: var(--primary-color);
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-info h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: var(--dark-color);
}

.modal-price {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.modal-original-price {
    text-decoration: line-through;
    color: var(--text-light);
    font-size: 1.2rem;
}

.modal-discount-price {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--discount-color);
}

.modal-category {
    display: inline-block;
    background-color: var(--light-color);
    color: var(--primary-color);
    padding: 5px 12px;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.modal-description {
    margin-bottom: 25px;
    line-height: 1.7;
}

.modal-specs {
    margin-bottom: 25px;
}

.modal-specs h4 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--dark-color);
}

.specs-list {
    list-style: none;
}

.specs-list li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
}

.specs-list li:last-child {
    border-bottom: none;
}

.spec-name {
    font-weight: 600;
    color: var(--text-color);
}

.spec-value {
    color: var(--text-light);
}

.modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.qrcode-container {
    text-align: center;
    margin-top: 20px;
    padding: 20px;
    background-color: var(--light-color);
    border-radius: var(--border-radius);
}

.qrcode {
    width: 200px;
    height: 200px;
    margin: 0 auto 15px;
    background-color: white;
    padding: 10px;
    border-radius: var(--border-radius);
}

.qrcode img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.qrcode-note {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* 页脚样式 */
footer {
    background-color: var(--dark-color);
    color: white;
    padding: 60px 0 30px;
    margin-top: 50px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-column h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: white;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #ddd;
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--secondary-color);
    padding-left: 5px;
}

.contact-info {
    list-style: none;
}

.contact-info li {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
    color: #ddd;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    transition: var(--transition);
}

.social-links a:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

.copyright {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #aaa;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .modal-body {
        grid-template-columns: 1fr;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: white;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    }
    
    .nav-links.active {
        display: flex;
    }
    
    .mobile-menu-btn {
        display: block;
    }
    
    .page-title h1 {
        font-size: 2rem;
    }
    
    .store-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .search-box {
        max-width: 100%;
        width: 100%;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px auto;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
}

@media (max-width: 576px) {
    .page-title h1 {
        font-size: 1.8rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .product-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn {
        width: 100%;
        text-align: center;
    }
    
    .modal-actions {
        flex-direction: column;
    }
}