/* area.css - 半导体应用页面专用样式 */

/* 全局设置 */
body, html {
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif;
    color: #333;
    background-color: #f8f8f8;
    overflow-x: clip;
}

/* 容器设置 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    box-sizing: border-box;
}

/* 半导体主图区域 */
.semiconductor-hero {
    position: relative;
    height: 400px;
    background-image: url('../images/pv-bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 60px;
    /* 图片建议分辨率：1920x600，文件大小不超过500KB */
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(22, 55, 98, 0.3); /* 蓝色叠加层，透明度30% */
}

/* 产品展示区域 */
.semiconductor-products {
    padding: 40px 0;
    position: relative;
    z-index: 2;
}

.section-title {
    color: #163762; /* 公司主题蓝色 */
    font-size: 32px;
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: #ffcc00; /* 公司主题黄色 */
    display: none;
}

/* 产品组样式 */
.product-group {
    margin-bottom: 40px;
    width: 100%;
}

.product-group-title {
    color: #163762;
    font-size: 24px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #163762;
}

/* 产品网格布局 */
.product-grid {
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin: 0 auto;
    width: 100%;
}

.product-subgrid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* PC端每行4列 */
    gap: 25px;
    width: 100%;
}

/* 产品项样式 - 修改为4:3比例 */
.product-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    aspect-ratio: 4/3; /* 改为4:3比例 */
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.product-item img {
    width: 100%;
    height: 100%;
    object-fit: fill; /* 改为fill，完全拉伸填充容器 */
    transition: transform 0.5s ease;
    /* 产品图片建议分辨率：800x600，文件大小不超过200KB */
}

.product-item:hover img {
    transform: scale(1.05);
}

.product-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    color: white;
    font-size: 16px;
    text-align: center;
    transition: all 0.3s ease;
}

.product-item:hover .product-caption {
    padding-bottom: 20px;
}

/* 渐入动画 */
.fade-in-element {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in-element.fade-in-visible {
    opacity: 1;
    transform: translateY(0);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .product-subgrid {
        grid-template-columns: repeat(3, 1fr); /* 平板端每行3列 */
    }
    
    .semiconductor-hero {
        height: 350px;
    }
}

@media (max-width: 768px) {
    .product-subgrid {
        grid-template-columns: repeat(2, 1fr); /* 移动端每行2列 */
        gap: 15px;
    }
    
    .semiconductor-hero {
        height: 300px;
    }
    
    .section-title {
        font-size: 28px;
        margin-bottom: 30px;
    }
    
    .product-group-title {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .product-subgrid {
        grid-template-columns: 1fr; /* 超小屏幕每行1列 */
    }
    
    .semiconductor-hero {
        height: 250px;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .product-caption {
        font-size: 14px;
        padding: 10px;
    }
    
    .product-group-title {
        font-size: 18px;
    }
}

/* 增强aspect-ratio兼容性 */
@supports not (aspect-ratio: 4/3) {
    .product-item {
        position: relative;
        height: 0;
        padding-bottom: 75%; /* 4:3比例的百分比计算 (3/4=0.75) */
    }
    
    .product-item img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: fill;
    }
    
    .product-caption {
        position: absolute;
        bottom: 0;
        left: 0;
    }
}