/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', 'PingFang SC', 'Helvetica Neue', Arial, sans-serif;
}

/* 页面结构优化 */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* 确保至少占满视口高度 */
}

/* 主内容区域 */
.main-content {
    flex: 1; /* 这会让内容区域自动填充可用空间 */
    padding-bottom: 30px; /* 与页脚保持一定距离 */
}

/* 确保容器样式在各处一致 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

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

.header-menu {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 20px 0;
}

.header-menu li {
    margin: 0 20px;
}

.header-menu li a {
    font-size: 18px;
    font-weight: 500;
    position: relative;
    transition: all 0.3s ease;
    padding-bottom: 5px;
}

.header-menu li a:hover {
    color: #00a1e9;
}

.header-menu li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #00a1e9;
    transition: width 0.3s ease;
}

.header-menu li a:hover::after {
    width: 100%;
}

/* 当前页面高亮 */
.header-menu li a.active {
    color: #00a1e9;
}

.header-menu li a.active::after {
    width: 100%;
}

/* 轮播图样式 */
.slider {
    position: relative;
    height: 300px; /* 从500px减小到400px */
    margin: 20px 0;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.slider-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.8s ease;
}

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

.slider-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
    z-index: 10;
}

.slider-control:hover {
    background-color: rgba(255, 255, 255, 0.9);
}

.slider-control.prev {
    left: 20px;
}

.slider-control.next {
    right: 20px;
}

/* 产品列表样式 */
section {
    background-color: #fff;
    padding: 30px;
    margin: 30px 0;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

section:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

section h2 {
    font-size: 28px;
    margin-bottom: 20px;
    color: #333;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    position: relative;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 80px;
    height: 2px;
    background-color: #00a1e9;
}

/* 产品列表容器 */
.product-list {
    display: grid;
    gap: 30px;
    list-style: none;
}

/* 单产品占满整行 */
.product-list.single-product li {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    background-color: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.product-list.single-product .product-image {
    flex: 0 0 45%; /* 固定宽度比例 */
    min-width: 300px;
    height: 350px; /* 单产品时稍大一些 */
    background-color: #fff; /* 单产品时使用白色背景 */
    display: flex;
    justify-content: center;
    align-items: center;
}

.product-list.single-product .product-content {
    flex: 1;
    min-width: 300px;
    padding: 20px;
}

/* 两个或以上产品的布局 */
.product-list.multi-product {
    grid-template-columns: repeat(2, 1fr);
}

.product-list.multi-product li {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-list li:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* 产品图片容器 */
.product-image {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 300px; /* 固定高度 */
    padding: 15px;
    background-color: #f9f9f9; /* 轻微背景色以区分图片区域 */
    border-radius: 8px;
    overflow: hidden; /* 确保图片不会溢出容器 */
}

/* 产品图片样式 */
.product-list img {
    max-width: 100%;
    height: auto;
    max-height: 270px; /* 略小于容器高度，留出内边距 */
    object-fit: contain; /* 保持图片比例 */
    display: block;
    transition: transform 0.5s ease;
    margin: 0 auto; /* 居中显示 */
}

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

.product-list.single-product img {
    max-height: 320px;
    max-width: 100%;
    object-fit: contain;
}

/* 产品文本内容 */
.product-content {
    padding: 20px;
}

.product-list h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #333;
}

.product-list p {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* 产品详情链接 */
.product-details-link {
    display: inline-block;
    padding: 8px 15px;
    background-color: #00a1e9;
    color: white !important;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.product-details-link:hover {
    background-color: #0086c0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 阅读更多链接 */
.read-more {
    display: inline-block;
    margin-top: 15px;
    color: #00a1e9;
    font-weight: 500;
    transition: all 0.3s ease;
}

.read-more:hover {
    color: #0086c0;
    text-decoration: underline;
}

/* 公司介绍和联系方式样式 */
.about-content, address {
    font-size: 16px;
    line-height: 1.8;
    color: #666;
}

address {
    font-style: normal;
}

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


/* 当内容较少时的样式，让页脚固定在底部 */
@media (min-height: 500px) {
    body.short-content {
        position: relative;
    }

    body.short-content .main-content {
        /* 保持Flex填充但设置最小高度，确保短内容时也有足够空间 */
        min-height: calc(100vh - 80px); /* 减去页脚和header的高度 */
    }

    body.short-content footer {
        /* 不使用fixed或absolute，保持在文档流中 */
        margin-top: auto;
    }
}

/* 错误消息和无产品提示 */
.error-message, .no-products {
    padding: 20px;
    text-align: center;
    background-color: #f8f8f8;
    border-radius: 8px;
    color: #666;
    font-size: 16px;
}

.error-message {
    border-left: 4px solid #f44336;
}

.no-products {
    border-left: 4px solid #9e9e9e;
}

/* 额外的实用工具类 */
.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 20px;
}

.mb-2 {
    margin-bottom: 20px;
}

.p-2 {
    padding: 20px;
}



/* 主内容区域自动填充可用空间 */
.page-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 轮播图和主要内容容器 */
main.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 确保footer不被压缩 */
footer {
    flex-shrink: 0;
    background-color: #333;
    color: #fff;
    padding: 20px 0;
    text-align: center;
    margin-top: 30px;
}

footer a {
    color: #ccc;
    text-decoration: none;
}

footer a:hover {
    color: #fff;
}

/* 调整section样式，确保在短页面上看起来也足够美观 */
section {
    margin: 30px 0;
    padding: 25px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

/* 联系方式页面的样式 */
address {
    font-style: normal;
    line-height: 1.8;
    font-size: 16px;
    color: #333;
}

/* 公司介绍页面的样式 */
#company_intro {
    line-height: 1.8;
    font-size: 16px;
    color: #333;
}

/* 响应式调整 */
@media (max-width: 768px) {
    section {
        padding: 15px;
    }
}
