/* ==========================================================================
   1. 基础重置与全局设置
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-family: "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: #333;
}

body {
    line-height: 1.6;
    background-color: #fff;
    padding-top: 70px; /* 契合导航栏高度 */
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-padding {
    padding: 60px 0; /* 适当紧凑排版 */
}

.bg-light {
    background-color: #f9f9f9;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 40px;
    position: relative;
    padding-bottom: 10px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: #d9383a;
}

/* ==========================================================================
   2. 弹性导航栏
   ========================================================================== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    font-size: 1.4rem;
    font-weight: bold;
    color: #d9383a;
}

.nav-menu a {
    text-decoration: none;
    color: #555;
    margin-left: 30px;
    font-size: 1.1rem;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: #d9383a;
}

/* ==========================================================================
   3. 首页 & 轮播图自适应（核心修复：黄框不变形）
   ========================================================================== */
.carousel {
    width: 100%;
    max-height: 480px; /* 限定桌面端最大高度 */
    aspect-ratio: 1920 / 550; /* 锁定黄金标准广告图比例 */
    overflow: hidden;
    background-color: #e9ecef;
}

.carousel-inner, .carousel-item {
    width: 100%;
    height: 100%;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 核心：在任何分辨率下自动裁剪居中，绝不拉伸变形 */
    object-position: center;
    display: block;
}

.company-intro {
    text-align: center;
    max-width: 850px;
}

.company-intro h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.company-intro p {
    font-size: 1.05rem;
    color: #666;
    margin-bottom: 15px;
    text-align: justify;
}

/* ==========================================================================
   4. 产品介绍区 (网格自适应 & 子框两行文本)
   ========================================================================== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
}

.product-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: #d9383a;
    box-shadow: 0 5px 15px rgba(217, 56, 58, 0.1);
}

.img-container {
    width: 100%;
    height: 220px;
    overflow: hidden;
    background-color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* 子框文本容器 */
.product-info-box {
    padding: 15px;
    text-align: center;
}

/* 第一行标题文本 */
.product-info-box h3 {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 6px;
}

/* 第二行正文描述文本 */
.product-info-box p {
    font-size: 0.9rem;
    color: #777;
    line-height: 1.4;
}

/* ==========================================================================
   5. 业界新闻区
   ========================================================================== */
.news-list {
    max-width: 900px;
    margin: 0 auto;
}

.news-item {
    display: flex;
    border-bottom: 1px dashed #ddd;
    padding: 15px 0;
    font-size: 1.1rem;
}

.news-date {
    color: #999;
    margin-right: 20px;
    flex-shrink: 0;
}

.news-link {
    color: #333;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s;
}

.news-link:hover {
    color: #d9383a;
}

/* ==========================================================================
   6. 联系方式区
   ========================================================================== */
.contact-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    align-items: center;
}

.contact-map {
    flex: 1 1 500px;
}

.contact-map img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.contact-info {
    flex: 1 1 400px;
}

.contact-info h3 {
    margin-bottom: 20px;
    color: #d9383a;
}

.contact-info p {
    margin-bottom: 12px;
    font-size: 1.05rem;
}

.contact-info .tip {
    color: #f5222d;
    font-size: 0.95rem;
    margin-top: 20px;
}

/* ==========================================================================
   7. 页脚
   ========================================================================== */
.footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 20px 0;
    font-size: 0.9rem;
}

/* ==========================================================================
   8. 移动端响应式适配（精准修复：手机端文字超出轮播图边界问题）
   ========================================================================== */
@media (max-width: 768px) {
    body {
        /* 手机端导航栏变高了，所以内容区顶部多留出空隙，防止遮挡内容 */
        padding-top: 140px; 
    }

    .navbar {
        height: auto;             
        padding: 12px 0 8px 0;    
    }

    .nav-container {
        flex-direction: column;   
        justify-content: center;
        gap: 8px;                 
    }

    .logo {
        font-size: 1.15rem;       
        padding-top: 5px;         
        text-align: center;
    }

    .nav-menu {
        text-align: center;
        width: 100%;
    }

    .nav-menu a {
        margin: 0 8px;            
        font-size: 0.95rem;
    }

    /* ----------------------------------------------------------------------
       核心修复：强制约束手机端轮播图文字，绝对不超出图片范围
       ---------------------------------------------------------------------- */
    .carousel {
        height: auto !important;
        max-height: 180px !important; /* 进一步压低手机端容器最大高度 */
    }

    /* 针对文字层定位和背景的手机端单独调整 */
    .carousel div[style*="position: absolute"] {
        padding: 10px !important; /* 缩小四周内边距，给文字腾出内部空间 */
        background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.6) 70%, rgba(255,255,255,0) 100%) !important;
    }

    /* 第一行：标题文本（再次缩小） */
    .carousel h1 {
        font-size: 1.15rem !important;    /* 缩小字号，防止两边顶出屏幕 */
        margin-bottom: 4px !important;    /* 缩减与下一行的间距 */
        white-space: normal !important;   
        line-height: 1.2 !important;      /* 缩紧行高 */
    }

    /* 第二行：正文文本（再次缩小） */
    .carousel p {
        font-size: 0.75rem !important;    /* 缩小正文字号 */
        max-width: 95% !important;        /* 让文字能利用更宽的屏幕空间 */
        line-height: 1.3 !important;      /* 缩紧行高 */
        margin: 0 auto !important;
    }

    /* ----------------------------------------------------------------------
       其他基础版块优化
       ---------------------------------------------------------------------- */
    .section-padding {
        padding: 40px 0;
    }

    .news-item {
        flex-direction: column;
        gap: 5px;
    }
}