/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #333;
    line-height: 1.4;
    background-color: #fff;
    padding-bottom: 65px; /* 为底部导航栏留出空间 */
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 顶部栏 */
.top-bar {
    background-color: #f8f8f8;
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px solid #e0e0e0;
}

.top-bar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.top-bar-left {
    display: flex;
    gap: 20px;
    align-items: center;
}

.currency {
    color: #666;
}

.top-bar-right {
    display: flex;
    gap: 20px;
    align-items: center;
}

.top-bar-right a {
    color: #666;
    transition: color 0.3s;
    font-size: 12px;
}

.top-bar-right a:hover {
    color: #d32f2f;
}

/* 导航栏 */
.header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #e0e0e0;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #d32f2f;
    flex: 1;
    text-align: center;
}

.header-actions {
    display: flex;
    gap: 20px;
    align-items: center;
}

.cart-icon, .inquiry-cart {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
}

.cart-text {
    display: inline;
}

.cart-icon-mobile {
    display: none;
    font-size: 20px;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #d32f2f;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
}

/* 移动端菜单切换按钮 */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: #333;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* 主导航 */
.main-nav {
    display: flex;
    gap: 30px;
    padding: 15px 0;
    transition: max-height 0.3s ease;
}

.main-nav a {
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
    white-space: nowrap;
}

.main-nav a:hover,
.main-nav a.active {
    color: #d32f2f;
}

.main-nav a.active::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #d32f2f;
}

/* 搜索栏 */
.search-bar {
    background-color: #f5f5f5;
    padding: 20px 0;
}

.search-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: 100%;
}

.search-btn {
    padding: 12px 30px;
    background-color: #d32f2f;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s;
    white-space: nowrap;
}

.search-btn:hover {
    background-color: #b71c1c;
}

/* 分类菜单 */
.categories-section {
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
}

.categories-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 15px;
}

.categories-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.category-item {
    cursor: pointer;
    transition: transform 0.3s;
}

.category-item:hover {
    transform: translateY(-2px);
}

.category-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.category-name::after {
    content: '›';
    color: #999;
}

.subcategories {
    margin-top: 8px;
    padding-left: 15px;
}

.subcategory-item {
    font-size: 13px;
    color: #666;
    margin: 5px 0;
}

.subcategory-item:hover {
    color: #d32f2f;
}

/* 主要内容区域 */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 15px;
    width: 100%;
}

/* 轮播图区域 */
.banner-section {
    margin-bottom: 9px;
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 15px;
}

.banner-slider {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    border-radius: 8px;
}

.banner-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

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

.banner-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* 服务介绍 */
.services-section {
    background-color: #fff;
    padding: 50px 0;
    margin: 15px 0;
}

.services-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 5 15px;
    width: 100%;
    box-sizing: border-box;
}

.section-header {
    text-align: center;
    margin-bottom: 12px;
}

.section-arrow {
    font-size: 20px;
    color: #0066cc;
    margin-bottom: 15px;
}

.section-title {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 12px;
}

.title-part1 {
    color: #666;
}

.title-part2 {
    color: #0066cc;
}

.section-subtitle {
    font-size: 16px;
    color: #666;
    max-width: 600px;
    margin: 0 auto;
}

/* 电脑版：横向滚动卡片 */
.services-carousel {
    display: block;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.services-slider {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    padding: 20px 0 30px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

.services-slider::-webkit-scrollbar {
    display: none;
}

.service-card {
    flex: 0 0 280px;
    flex-shrink: 0;
    width: 280px;
    min-width: 280px;
    max-width: 280px;
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    scroll-snap-align: start;
    transition: transform 0.3s, box-shadow 0.3s;
}

.service-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.service-card-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background-color: #f5f5f5;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.service-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.service-card-image:empty::after {
    content: 'No Image';
    color: #999;
    font-size: 14px;
}

.service-card-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin: 15px 20px 8px;
    text-transform: uppercase;
    line-height: 1.3;
}

.service-card-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin: 0 20px 15px;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 100px;
}

.services-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    padding: 0 20px;
}

.pagination-dot {
    width: 40px;
    height: 4px;
    background-color: #ddd;
    border-radius: 2px;
    cursor: pointer;
    transition: background-color 0.3s, width 0.3s;
}

.pagination-dot:hover {
    background-color: #bbb;
}

.pagination-dot.active {
    background-color: #0066cc;
    width: 50px;
}

/* 手机版：3x3网格 */
.services-grid-mobile {
    display: none;
    margin-bottom: 6px;
}

/* 产品列表 */
.products-section {
    margin: 20px 0;
}

/* 热门产品区域（第一个产品区域）与服务介绍之间的距离 */
.main-content > .products-section:first-child {
    margin-top: 15;
}

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.products-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.view-more {
    color: #d32f2f;
    font-weight: 500;
    transition: color 0.3s;
}

.view-more:hover {
    color: #b71c1c;
}

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

.product-card {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.product-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background-color: #f5f5f5;
}

.product-info {
    padding: 12px;
}

.product-name {
    font-size: 14px;
    color: #333;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 40px;
}

.product-price {
    font-size: 18px;
    font-weight: bold;
    color: #d32f2f;
    margin-bottom: 5px;
}

.product-moq {
    font-size: 12px;
    color: #999;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 40px 0;
}

.page-link {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    transition: all 0.3s;
}

.page-link:hover {
    background-color: #d32f2f;
    color: white;
    border-color: #d32f2f;
}

.page-link.active {
    background-color: #d32f2f;
    color: white;
    border-color: #d32f2f;
}

/* 页脚 */
.footer {
    background-color: #2c2c2c;
    color: #fff;
    padding: 60px 0 20px;
    margin-top: 18px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 20px;
}

.footer-section h3 {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 20px;
}

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

.footer-section a {
    color: #ccc;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: #fff;
}

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

/* 统计信息 */
.stats-section {
    background-color: #f8f8f8;
    padding: 40px 0;
    margin-bottom: 12px;
}

.stats-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 36px;
    font-weight: bold;
    color: #d32f2f;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 16px;
    color: #666;
}

/* 响应式设计 */
@media (max-width: 768px) {
    /* 顶部栏隐藏部分内容 */
    .top-bar {
        padding: 6px 0;
        font-size: 11px;
    }
    
    .top-bar-left {
        gap: 10px;
    }
    
    .top-bar-right {
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .top-bar-right a {
        font-size: 11px;
    }
    
    /* 头部导航 */
    .header-top {
        padding: 12px 0;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .logo {
        font-size: 20px;
        text-align: left;
        margin-left: 15px;
    }
    
    .cart-text {
        display: none;
    }
    
    .cart-icon-mobile {
        display: inline-block;
    }
    
    .cart-count {
        top: -5px;
        right: -5px;
        width: 16px;
        height: 16px;
        font-size: 10px;
    }
    
    /* 主导航菜单 - 移动端折叠 */
    .main-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #fff;
        flex-direction: column;
        gap: 0;
        padding: 0;
        max-height: 0;
        overflow: hidden;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }
    
    .main-nav.active {
        max-height: 500px;
        padding: 10px 0;
    }
    
    .main-nav a {
        padding: 12px 20px;
        border-bottom: 1px solid #f0f0f0;
        display: block;
    }
    
    .main-nav a.active::after {
        display: none;
    }
    
    .main-nav a.active {
        background-color: #f8f8f8;
        color: #d32f2f;
    }
    
    /* 搜索栏 */
    .search-bar {
        padding: 15px 0;
    }
    
    .search-input {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .search-btn {
        padding: 10px 20px;
        font-size: 13px;
    }
    
    /* 分类菜单 */
    .categories-section {
        padding: 15px 0;
    }
    
    .categories-title {
        font-size: 14px;
        margin-bottom: 10px;
        padding: 0 15px;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 0 15px;
    }
    
    .category-name {
        font-size: 13px;
        padding: 8px 0;
    }
    
    .subcategories {
        margin-top: 5px;
        padding-left: 10px;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .category-item.active .subcategories {
        max-height: 500px;
    }
    
    .subcategory-item {
        font-size: 12px;
        margin: 3px 0;
    }
    
    /* 产品网格 */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .product-image {
        height: 180px;
    }
    
    .product-info {
        padding: 12px;
    }
    
    .product-name {
        font-size: 13px;
        margin-bottom: 8px;
    }
    
    .product-price {
        font-size: 16px;
    }
    
    .product-moq {
        font-size: 11px;
    }
    
    /* 轮播图 */
    .banner-section {
        padding: 0 15px;
        margin-bottom: 7.5px;
    }
    
    .banner-slider {
        height: 280px;
        border-radius: 4px;
    }
    
    /* 服务介绍 - 手机版 */
    .services-section {
        padding: 0px 0;
        margin: 5px 0;
    }
    
    /* 手机版：3x3网格与热门产品之间的距离 */
    .services-grid-mobile {
        margin-bottom: 6px;
    }
    
    .section-header {
        margin-bottom: 9px;
        padding: 0 15px;
    }
    
    .section-arrow {
        font-size: 18px;
        margin-bottom: 5px;
    }
    
    .section-title {
        font-size: 28px;
        margin-bottom: 10px;
    }
    
    .section-subtitle {
        font-size: 14px;
        padding: 0 15px;
    }
    
    /* 隐藏电脑版横向滚动 */
    .services-carousel {
        display: none;
    }
    
    /* 显示手机版3x3网格 */
    .services-grid-mobile {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        padding: 0 15px;
        margin-bottom: 20px; /* 与下方内容的间距 */
    }
    
    .service-grid-item {
        aspect-ratio: 1.2; /* 从1改为1.2，使高度变小 */
        position: relative;
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
        border-radius: 4px;
        overflow: hidden;
        background-color: #0066cc; /* 默认背景色，当图片加载失败时显示 */
    }
    
    .service-grid-item::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 102, 204, 0.7);
        z-index: 1;
    }
    
    .service-grid-label {
        position: absolute;
        bottom: 8px; /* 从10px改为8px */
        left: 8px; /* 从10px改为8px */
        right: 8px; /* 从10px改为8px */
        color: #fff;
        font-size: 12px; /* 从14px改为12px */
        font-weight: 500;
        z-index: 2;
        text-align: center;
        line-height: 1.2;
    }
    
    /* 主要内容 */
    .main-content {
        padding: 25px 15px;
    }
    
    .products-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        margin-bottom: 20px;
    }
    
    .products-title {
        font-size: 20px;
    }
    
    /* 页脚 */
    .footer {
        padding: 20px 0 5px;
        margin-top: 12px;
    }
    
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
        padding: 0 15px;
    }
    
    .footer-section h3 {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    .footer-section ul li {
        margin-bottom: 8px;
        font-size: 13px;
    }
    
    .stats-section {
        padding: 10px 0;
        margin-bottom: 5px;
    }
    
    .stats-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        padding: 0 15px;
    }
    
    .stat-number {
        font-size: 28px;
    }
    
    .stat-label {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    /* 更小屏幕优化 */
    .top-bar {
        display: none;
    }
    
    .logo {
        font-size: 18px;
    }
    
    .search-bar {
        padding: 12px 0;
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .product-image {
        height: 160px;
    }
    
    .banner-section {
        padding: 0;
        margin-bottom: 0px;
    }
    
    .banner-slider {
        height: 240px;
        border-radius: 0;
    }
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .main-content {
        padding: 0px 10px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .stats-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
    
    .stat-number {
        font-size: 24px;
    }
    
    .stat-label {
        font-size: 12px;
    }
}

/* 产品详情页移动端优化 */
@media (max-width: 768px) {
    .product-detail-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    .product-detail-image {
        width: 100% !important;
    }
    
    .product-detail-info h1 {
        font-size: 20px !important;
    }
    
    .product-detail-info .price {
        font-size: 24px !important;
    }
    
    .add-to-cart-btn {
        width: 100% !important;
        padding: 12px !important;
        font-size: 14px !important;
    }
    
    /* 面包屑导航优化 */
    .main-content > div:first-child {
        font-size: 12px !important;
        margin-bottom: 15px !important;
        overflow-x: auto;
        white-space: nowrap;
    }
}