/* 通用基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft Yahei", sans-serif;
    color: #333;
    line-height: 1.6;
}

.container {
    width: 1200px;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    padding: 8px 20px;
    background: #2c82c9;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background 0.3s;
}

.btn:hover {
    background: #1a68b0;
}

/* 头部导航样式 */
.header {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 999;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo a {
    font-size: 24px;
    font-weight: bold;
    color: #2c82c9;
    text-decoration: none;
}

.nav-pc {
    display: flex;
    list-style: none;
}

.nav-pc li {
    margin-left: 30px;
}

.nav-pc li a {
    color: #333;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s;
}

.nav-pc li a.active, .nav-pc li a:hover {
    color: #2c82c9;
}

.nav-mobile-toggle {
    display: none;
    font-size: 24px;
    cursor: pointer;
}

.nav-mobile {
    display: none;
    list-style: none;
    background: #fff;
    padding: 10px 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.nav-mobile li {
    padding: 10px 0;
}

.nav-mobile li a {
    color: #333;
    text-decoration: none;
    font-size: 16px;
}

/* 公司简介样式 */
.about-index {
    padding: 60px 0;
    background: #f9f9f9;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
}

.section-title h2 {
    font-size: 28px;
    color: #333;
    margin-bottom: 10px;
}

.section-title p {
    font-size: 16px;
    color: #666;
}

.about-index-wrapper {
    display: flex;
    align-items: center;
    gap: 40px;
}

.about-index-img {
    flex: 1;
}

.about-index-img img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.about-index-text {
    flex: 1;
}

.about-index-text h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #2c82c9;
}

.about-index-text p {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.8;
}

/* 产品列表样式（修复多数量布局） */
.products-index {
    padding: 60px 0;
    overflow: hidden; /* 防止内容溢出容器 */
}

.products-index-grid {
    display: flex; /* 替换grid为flex，更兼容 */
    flex-wrap: wrap; /* 自动换行 */
    gap: 20px; /* 保留原有间距 */
    justify-content: flex-start; /* 左对齐，避免最后一行居中 */
    margin: 0 -10px; /* 仅新增：抵消内边距 */
    padding: 0 10px; /* 仅新增：防止内容溢出 */
}

.products-index-card {
    width: calc(33.333% - 20px); /* 固定3列，适配多数屏幕 */
    margin-bottom: 20px; /* 仅新增：增加底部间距 */
    box-sizing: border-box; /* 仅新增：宽度包含内边距/边框 */
}

.products-index-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.products-index-card-img {
    width: 100%;
    height: 200px;
    overflow: hidden;
    flex-shrink: 0; /* 图片高度不压缩 */
}

.products-index-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.products-index-card:hover img {
    transform: scale(1.05);
}

.products-index-card-text {
    padding: 15px;
    flex-grow: 1; /* 文字区域自动填充剩余空间 */
    display: flex;
    flex-direction: column;
}

.products-index-card-text h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #333;
}

.products-index-card-text p {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1; /* 文字占满剩余空间，按钮固定底部 */
}
.products-index-card-text .btn {
    align-self: flex-start; /* 按钮左对齐，不被文字挤压 */
    margin-top: auto; /* 强制按钮固定在卡片底部 */
}

/* 新闻列表样式（修复多数量布局） */
.news-index {
    padding: 60px 0;
    background: #f9f9f9;
}

.news-index-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: flex-start;
    margin: 0 -10px;
    padding: 0 10px;
}

.news-index-card {
    width: calc(33.333% - 20px);
    margin-bottom: 20px;
    box-sizing: border-box;
}

.news-index-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.news-index-card-img {
    width: 100%;
    height: 180px;
    overflow: hidden;
    flex-shrink: 0;
}

.news-index-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.news-index-card:hover img {
    transform: scale(1.05);
}

.news-index-card-text {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.news-index-card-text .date {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
    display: block;
}

.news-index-card-text h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #333;
}

.news-index-card-text p {
    flex-grow: 1;
    margin-bottom: 15px;
}

/* 联系方式样式 */
.contact-index {
    padding: 60px 0;
    text-align: center;
}

.contact-index p {
    font-size: 18px;
    margin-bottom: 15px;
    color: #666;
}

/* 页脚样式 */
.footer {
    background: #333;
    color: #fff;
    padding: 60px 0 20px;
}

.footer-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.footer-item h3 {
    font-size: 18px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #555;
}

.footer-item ul {
    list-style: none;
}

.footer-item ul li {
    margin-bottom: 10px;
}

.footer-item ul li a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-item ul li a:hover {
    color: #fff;
}

.footer-contact p {
    margin-bottom: 10px;
    color: #ccc;
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #555;
    color: #999;
    font-size: 14px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .nav-pc {
        display: none;
    }

    .nav-mobile-toggle {
        display: block;
    }

    .nav-mobile {
        display: block;
    }

    .about-index-wrapper {
        flex-direction: column;
        gap: 20px;
    }

    .products-index-grid, .news-index-grid {
        grid-template-columns: 1fr;
    }

    .products-index-card, .news-index-card {
        width: 100%; /* 移动端单列 */
    }
}

/* ========== 仅新增：轮播图核心样式（无冲突，不影响其他元素） ========== */
.banner {
    width: 100%;
    height: 500px;
    position: relative;
    overflow: hidden;
}
.banner-slides {
    width: 100%;
    height: 100%;
    position: relative;
}
.banner-slide {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    display: none;
}
.banner-slide.active {
    display: block;
}
.banner-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.banner-slide-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    text-align: center;
    background: rgba(0, 0, 0, 0.5);
    padding: 20px 40px;
    border-radius: 8px;
    z-index: 10;
}
.banner-slide-text h2 {
    font-size: 32px;
    margin-bottom: 10px;
}
.banner-slide-text p {
    font-size: 16px;
    margin-bottom: 15px;
}
.banner-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    line-height: 50px;
    text-align: center;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    border-radius: 50%;
    z-index: 99;
    transition: background 0.3s;
}
.banner-btn:hover {
    background: rgba(0, 0, 0, 0.6);
}
.banner-btn-prev {
    left: 20px;
}
.banner-btn-next {
    right: 20px;
}
.banner-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 99;
}
.banner-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background 0.3s;
}
.banner-indicator.active {
    background: #fff;
}

/* 轮播图移动端适配（仅新增，不影响其他移动端样式） */
@media (max-width: 768px) {
    .banner {
        height: 300px;
    }
    .banner-slide-text h2 {
        font-size: 24px;
    }
}