/* ==========================================================================
   1. 纯原生全局基本样式重置
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box; /* 锁定盒模型计算方式，防止内边距撑破布局 */
}

:root {
    --primary-color: #0b397b;   /* 经典高端工业蓝：代表精细加工与沉稳实力 */
    --accent-color: #f1c40f;    /* 工业警示明黄：用于小圆点及悬停高亮 */
    --text-dark: #2c3e50;       /* 深灰：用于各大板块标题 */
    --text-body: #555555;       /* 中灰：用于大部分长篇正文，确保对比度柔和 */
    --bg-light: #f9fbfd;        /* 极浅灰蓝：用于区块交替时进行视觉分割 */
    --transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* 工业高平滑缓动曲线 */
}

html {
    scroll-behavior: smooth;    /* 原生启动全屏点击锚点平滑滚动特效 */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Microsoft YaHei", sans-serif;
    color: var(--text-body);
    line-height: 1.7;
    background-color: #ffffff;
    overflow-x: hidden;         /* 防止移动端出现横向死滚动条 */
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 替代原 Bootstrap 核心功能的原生响应式居中控制层 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==========================================================================
   2. 顶部综合导航栏样式 (PC端与移动端兼容型设计)
   ========================================================================== */
header {
    background-color: #ffffff;
    box-shadow: 0 2px 15px rgba(0,0,0,0.06);
    position: sticky;           /* 滚动吸顶 */
    top: 0;
    z-index: 1000;
}

.header-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 90px;               /* PC端固定高度 90px */
}

.logo-box {
    display: flex;
    flex-direction: column;
}

.logo-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 1px;
}

.logo-sub {
    font-size: 0.65rem;
    color: #888;
    font-family: Arial, sans-serif;
    margin-top: 2px;
}

/* PC 端的主体横向菜单 */
.nav-list {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-item {
    position: relative;
    font-weight: 500;
    color: #333;
    padding: 10px 0;
    font-size: 1.05rem;
}

.nav-item:hover, .nav-item.active {
    color: var(--primary-color);
}

/* 纯 CSS 实现的下拉菜单交互 */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(15px);
    background-color: #ffffff;
    min-width: 160px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border-top: 3px solid var(--primary-color);
    border-radius: 0 0 4px 4px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-menu a {
    display: block;
    padding: 12px 20px;
    font-size: 0.95rem;
    color: #444;
    text-align: center;
}

.dropdown-menu a:hover {
    background-color: var(--bg-light);
    color: var(--primary-color);
}

/* 移动端汉堡按钮基础隐藏 */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    border: none;
    background: none;
    padding: 5px;
}

.menu-toggle span {
    display: block;
    width: 28px;
    height: 3px;
    background-color: var(--primary-color);
    transition: var(--transition);
    border-radius: 2px;
}

/* ==========================================================================
   3. 大轮播区核心样式 (升级版：Web端黄金首屏满屏设计方案)
   ========================================================================== */
.banner-carousel {
    position: relative;
    width: 100%;
    /* 核心修改：动态计算一整屏的高度（100%视口高度 - 顶栏90px高度），做到完美满屏 */
    height: calc(100vh - 90px); 
    overflow: hidden;
    background-color: #2c3e50;
}

.carousel-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.carousel-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;
    background-position: center bottom; /* 轴心靠底对齐，确保大图厂房主体和文字露出来，裁剪顶部天空 */
    background-size: cover;             /* 等比例铺满容器，决不拉伸变形 */
    opacity: 0;
    display: none;
    transition: opacity 0.8s ease-in-out;
}

.carousel-item.active {
    display: block;
    opacity: 1;
}

/* 小圆点切换栏定位与绘制 */
.carousel-dots {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 12px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: var(--transition);
}

.dot.active, .dot:hover {
    background-color: var(--accent-color); /* 激活圆点改为耀眼工业黄 */
    transform: scale(1.2);
}

/* ==========================================================================
   4. 关于我们模块样式 (About Section)
   ========================================================================== */
.about-section {
    padding: 90px 0;
    background-color: #ffffff;
}

.about-grid {
    display: flex;
    gap: 60px;
    align-items: center;
}

.about-img-box {
    flex: 1;
}

.about-img-box img {
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.about-text-box {
    flex: 1.2;
}

/* 全站高度统一、精细化的区块标题样式 */
.section-title {
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 12px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background-color: var(--primary-color);
}

.about-text-box p {
    margin-bottom: 20px;
    color: var(--text-body);
    text-align: justify;
}

/* ==========================================================================
   5. 产品展示中心网格样式 (升级为超链接包装、多端图片100%全幅不截断模式)
   ========================================================================== */
.products-section {
    padding: 90px 0;
    background-color: var(--bg-light);
}

.products-section .section-title {
    text-align: center;
    margin-bottom: 50px;
}

.products-section .section-title::after {
    left: 50%;
    transform: translateX(-50%);
}

/* 基于现代原生 CSS Grid 的自适应网格 */
.product-grid {
    display: grid;
    /* PC端默认无缝适应 */
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); 
    gap: 40px;
}

/* 产品卡片全局块级超链接 */
.product-grid .product-card {
    display: block;             
    text-decoration: none;      
    color: inherit;             
    background-color: #ffffff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(7,36,76,0.1);
}

.product-img-wrapper {
    position: relative;
    width: 100%;
    height: 280px;              /* PC端锁定 280px 展示高规格 */
    background-color: #ffffff;  /* 纯白背景防止部件四周突兀 */
    display: flex;
    align-items: center;
    justify-content: center;    
    overflow: hidden;
    padding: 15px;              
}

/* 产品零部件图片的完美自适应缩放 */
.product-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;        /* 确保机械核心部件完整展示、四边绝不被截断 */
    object-position: center center;
    transition: var(--transition);
}

.product-card:hover .product-img-wrapper img {
    transform: scale(1.05);
}

.product-card h4 {
    padding: 22px;
    text-align: center;
    font-size: 1.15rem;
    color: var(--text-dark);
    font-weight: 600;
    border-top: 1px solid #eee;
    transition: var(--transition);
}

.product-card:hover h4 {
    color: var(--primary-color);
}

/* ==========================================================================
   6. 高响应式多终端媒体查询断点适配 (移动端及响应式产品图深度打磨)
   ========================================================================== */
@media (max-width: 992px) {
    .banner-carousel {
        height: 450px;        /* 平板端脱离满屏，保持紧凑高 */
    }
    .about-grid {
        flex-direction: column;
        gap: 40px;
    }
    .about-img-box, .about-text-box {
        width: 100%;
    }
    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .banner-carousel {
        height: 320px;        /* 手机端保持合适的固定高度，让厂房完美显现 */
    }

    .menu-toggle {
        display: flex; 
    }
    
    /* 移动端全原生抽屉式菜单容器 */
    .nav-list {
        position: absolute;
        top: 90px;
        left: 0;
        width: 100%;
        background-color: #ffffff;
        flex-direction: column;
        gap: 0;
        box-shadow: 0 10px 15px rgba(0,0,0,0.05);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.35s ease-in-out; 
    }
    
    .nav-list.open {
        max-height: 400px;
    }
    
    .nav-item {
        width: 100%;
        text-align: center;
        padding: 15px 0;
        border-bottom: 1px solid #f5f5f5;
    }
    
    .dropdown-menu {
        position: static;
        transform: none !important;
        box-shadow: none;
        border-top: none;
        max-height: 0;
        overflow: hidden;
        opacity: 1;
        visibility: visible;
        padding: 0;
    }
    
    .dropdown:hover .dropdown-menu {
        max-height: 250px;
    }

    /* 📱 手机移动端产品网格与图片防截断适配 */
    .product-grid {
        grid-template-columns: 1fr; /* 手机端单列平铺 */
        gap: 20px;
    }

    .product-img-wrapper {
        height: 200px;              /* 手机端将卡片图片高度平滑下调至 200px */
        padding: 10px;
    }

    .product-img-wrapper img {
        object-fit: contain;        /* 移动端强制 contain，确保链条、履带等核心部件完整能看清全图 */
        width: auto;
        height: auto;
        max-width: 100%;
        max-height: 100%;
    }
    
    .product-card h4 {
        padding: 15px;
        font-size: 1.05rem;
    }
}

/* ==========================================================================
   7. 产品详情页 - 三列图片展示区专属样式 (追加项)
   ========================================================================== */
.detail-gallery-section {
    padding: 60px 0;
    background-color: #ffffff; /* 保持干净的纯白或浅灰底色 */
}

/* 详情页特制副标题 */
.gallery-title {
    font-size: 1.6rem;
    color: var(--text-dark);
    margin-bottom: 35px;
    position: relative;
    padding-left: 15px;
}

/* 标题左侧的装饰蓝色竖条，更显工业严谨感 */
.gallery-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 15%;
    width: 4px;
    height: 70%;
    background-color: var(--primary-color);
    border-radius: 2px;
}

/* 核心：基于 CSS Grid 锁定标准三列布局 */
.gallery-grid {
    display: grid;
    /* 核心点：repeat(3, 1fr) 强制在PC端平分并排展示三列 */
    grid-template-columns: repeat(3, 1fr); 
    gap: 30px; /* 卡片之间的间距 */
}

/* 单个展示卡片盒模型 */
.gallery-card {
    background-color: #ffffff;
    border: 1px solid #eaeaea; /* 微妙的边框，防止纯白图片与背景混在一起 */
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
    transition: var(--transition);
}

/* 悬停时的上浮及高端工业蓝阴影 */
.gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(7, 36, 76, 0.08);
    border-color: #d1dbec;
}

/* 图片容器：锁定正方形或接近正方形的比例 */
.gallery-img-wrapper {
    position: relative;
    width: 100%;
    height: 320px;             /* 锁定 320px 黄金高度 */
    background-color: #ffffff; /* 纯白垫底 */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;             /* 给机械零部件四周留出足够的呼吸空间 */
    overflow: hidden;
}

/* 原图完美不截断自适应 */
.gallery-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;       /* 核心关键：确保支重轮、链条全图展现，绝不裁剪 */
    object-position: center;
    transition: var(--transition);
}

/* 悬停时图片轻微平滑放大 */
.gallery-card:hover .gallery-img-wrapper img {
    transform: scale(1.04);
}

/* 文字阐述区域 */
.gallery-info {
    padding: 18px;
    text-align: center;
    background-color: #fafafa; /* 底部文字区带微弱浅灰底色，与图片区形成对比 */
    border-top: 1px solid #eaeaea;
    transition: var(--transition);
}

.gallery-card:hover .gallery-info {
    background-color: #ffffff;
}

.gallery-info h4 {
    font-size: 1.1rem;
    color: var(--text-dark);
    font-weight: 600;
    transition: var(--transition);
}

.gallery-card:hover .gallery-info h4 {
    color: var(--primary-color); /* 悬停时文字变为企业主题工业蓝 */
}

/* ==========================================================================
   7.1 详情页三列图片区 - 移动端响应式断点适配
   ========================================================================== */
@media (max-width: 992px) {
    /* 平板端：如果三列太挤，自动调整为两列 */
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    .gallery-img-wrapper {
        height: 260px; /* 平板端适当调低容器高度 */
    }
}

@media (max-width: 576px) {
    /* 手机端：强制降级为单列横向撑满，确保零配件原图在手机上依然清晰 */
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .gallery-img-wrapper {
        height: 220px; /* 手机端容器高度 */
        padding: 15px;
    }
    .gallery-title {
        font-size: 1.3rem;
        margin-bottom: 20px;
    }
}