/* ==========================================================================
   VIP 首页样式（index.css）
   适用于：Index.html
   结构：banner 轮播 → 企业介绍 → 联系方式 + 样品展示 + 供货信息
   设计原则：
     1. 移动优先 + 流式布局（max-width 替代固定 width）
     2. 模块间通过卡片背景 + 间距形成清晰视觉边界
     3. 跨浏览器兼容（-webkit/-ms 前缀）
     4. 触控友好（最小点击区域 44px）
     5. 性能优化（transform/opacity 触发 GPU 合成层）
   ========================================================================== */

/* ==================== 首页主容器 ==================== */
.index-block {
    width: 100%;
    max-width: var(--vip-container);
    margin: 0 auto;
    padding: var(--vip-space) var(--vip-space) 0;
    background-color: transparent;
}

/* ==================== 顶部 Banner 轮播 ==================== */
.big_banner {
    width: 100%;
    height: auto;
    background-color: #fff;
}

.img_block {
    position: relative;
    height: auto;
    min-height: 340px;
    background-color: #fff;
    width: 100%;
    margin: 0 auto;
}

.img_banner {
    width: 100%;
    max-height: none;
    position: absolute;
    margin: 0 auto;
}

/* ---- 轮播容器：阴影 + 边框（清晰视觉边界） ---- */
#demo.carousel {
    overflow: hidden;
    box-shadow: var(--vip-shadow);
    background: #fff;
}

/* ---- 轮播图片：响应式高度（PC 端固定比例，移动端自适应） ---- */
.carousel-inner {
    overflow: hidden;
}

.carousel-item {
    /* 970:190 比例容器，避免图片加载时布局抖动（CLS） */
    position: relative;
    width: 100%;
    padding-top: 19.59%; /* 190/970 ≈ 19.59% */
    overflow: hidden;
    background: #f0f0f0;
}

.carousel-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.carousel-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    -o-object-fit: cover;
}

/* ---- 轮播指示器（小圆点） ---- */
.carousel-indicators {
    margin-bottom: 12px;
}

.carousel-indicators li {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    border: none;
    margin: 0 4px;
    -webkit-transition: var(--vip-transition);
    transition: var(--vip-transition);
    cursor: pointer;
}

.carousel-indicators li.active {
    background-color: var(--vip-primary);
    width: 24px;
    border-radius: 5px;
}

/* ---- 轮播左右控制箭头 ---- */
.carousel-control-prev,
.carousel-control-next {
    width: 8%;
    opacity: 0;
    -webkit-transition: opacity 0.3s ease;
    transition: opacity 0.3s ease;
}

#demo.carousel:hover .carousel-control-prev,
#demo.carousel:hover .carousel-control-next {
    opacity: 0.8;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 32px;
    height: 32px;
    background-color: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    background-size: 50% 50%;
}

/* ==================== 企业介绍卡片 ==================== */
.company_in {
    background-color: var(--vip-card-bg);
    width: 100%;
    margin-top: var(--vip-space);
    box-shadow: var(--vip-shadow-sm);
    border: 1px solid var(--vip-border-light);
    overflow: hidden;
}

.company_in_block {
    padding: var(--vip-space-lg) var(--vip-space);
}

.company_z {
    height: auto;
    max-width: 100%;
}

/* ---- 区块标题（带橙色左竖条，复用通用样式） ---- */
.company_title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    position: relative;
    padding-left: 14px;
    color: var(--vip-text);
}

.company_title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    -webkit-transform: translateY(-50%);
    -ms-transform: translateY(-50%);
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: var(--vip-primary);
    border-radius: 2px;
}

.company_info {
    font-size: 14px;
    height: auto;
    overflow: hidden;
    white-space: pre-wrap;
    word-wrap: break-word;
    -webkit-word-break: break-word;
    word-break: break-word;
    line-height: 1.8;
    color: var(--vip-text-secondary);
    /* 限制最大高度，超出显示省略号（保持版面整洁） */
    max-height: 280px;
    overflow-y: auto;
}

.company_info_button {
    text-align: right;
    margin-top: 24px;
    margin-bottom: 16px;
}

.company_img_block {
    margin-left: 20px;
}

.company_img {
    min-height: 270px;
    width: 100%;
}

.company_product {
    background-color: #fff;
    width: 100%;
    padding-bottom: 40px;
}

.product_block {
    margin: 0 auto;
    padding: 32px 20px 0 20px;
}

/* ---- 产品区块标题（居中 + 装饰下划线） ---- */
.product_title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
    color: var(--vip-text);
    position: relative;
    padding-bottom: 12px;
}

.product_title::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 0;
    -webkit-transform: translateX(-50%);
    -ms-transform: translateX(-50%);
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--vip-primary);
    border-radius: 2px;
}

/* ==================== 产品卡片（样品 / 供货） ==================== */
.product_list {
    margin-top: 16px;
    margin-bottom: 16px;
    position: relative;
    object-fit: contain;
    padding: 12px;
    background: #fff;
    border: 1px solid var(--vip-border-light);
    -webkit-transition: var(--vip-transition);
    transition: var(--vip-transition);
    overflow: hidden;
    height: calc(100% - 32px);
}

.product_list:hover {
    box-shadow: var(--vip-shadow-hover);
    -webkit-transform: translateY(-4px);
    -ms-transform: translateY(-4px);
    transform: translateY(-4px);
    border-color: var(--vip-primary);
}

.product_list_img {
    margin: 0 auto;
    overflow: hidden;
    background: var(--vip-bg);
    position: relative;
    /* 正方形比例容器（避免 CLS） */
    width: 100%;
    padding-top: 100%;
}

.product_list_img img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    -o-object-fit: cover;
    -webkit-transition: -webkit-transform 0.4s ease;
    transition: transform 0.4s ease;
}

.product_list:hover .product_list_img img {
    -webkit-transform: scale(1.06);
    -ms-transform: scale(1.06);
    transform: scale(1.06);
}

.product_list_name {
    font-size: 14px;
    color: var(--vip-text);
    text-align: center;
    line-height: 1.5;
    height: 42px;
    overflow: hidden;
    margin-top: 10px;
    padding: 0 4px;
    /* 多行省略（webkit） */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product_name {
    position: absolute;
    z-index: 2;
    bottom: 0;
    background-color: rgba(17, 17, 17, 0.55);
    height: 24px;
    color: #fff;
    width: 100%;
    text-align: center;
    font-size: 14px;
    overflow: hidden;
}

/* ---- 查看更多按钮 ---- */
.product_more {
    margin-top: 32px;
    margin-bottom: 16px;
    font-size: 14px;
    text-align: center;
}

.product_more .btn-primary {
    background: var(--vip-primary);
    border-color: var(--vip-primary);
    border-radius: var(--vip-radius-sm);
    padding: 10px 36px;
    font-size: 14px;
    -webkit-transition: var(--vip-transition);
    transition: var(--vip-transition);
    min-height: 44px; /* 触控友好 */
}

.product_more .btn-primary:hover {
    background: var(--vip-primary-dark);
    border-color: var(--vip-primary-dark);
    box-shadow: 0 4px 12px rgba(255, 96, 0, 0.3);
    -webkit-transform: translateY(-2px);
    -ms-transform: translateY(-2px);
    transform: translateY(-2px);
}

.product_more .btn-primary:active {
    -webkit-transform: translateY(0);
    -ms-transform: translateY(0);
    transform: translateY(0);
}

/* ==================== 新闻 / 招聘等列表（首页未直接用，预留兼容） ==================== */
.company_new {
    background-color: #fff;
    width: 100%;
    padding-bottom: 40px;
    min-height: 450px;
}

.new_block {
    margin: 0 15%;
    padding: 40px 0 0 0;
}

.new_main_block {
    height: 360px;
    width: 100%;
    background-color: var(--vip-bg);
}

.new_main_img {
    width: 100%;
    height: 180px;
}

.new_mian_title {
    font-size: 14px;
    height: 30px;
    overflow: hidden;
    width: 100%;
    line-height: 30px;
}

.new_less_block {
    margin: 10px 0 0 0;
}

.new_less_img {
    width: 100%;
    height: 90px;
}

.new_less_title {
    height: 46px;
    overflow: hidden;
    font-size: 14px;
}

.new_new_block,
.new_recruit_block {
    border-bottom: 1px solid var(--vip-text);
}

.new_new_title,
.new_recruit_title {
    font-size: 18px;
    font-weight: 600;
    float: left;
}

.new_new_more,
.new_recruit_more {
    float: right;
    font-size: 14px;
}

.new_new_content {
    border-bottom: 1px dashed var(--vip-border);
}

.new_new_name,
.new_new_time,
.new_recruit_name,
.new_recruit_time {
    height: 42px;
    line-height: 42px;
    font-size: 14px;
    overflow: hidden;
}

.new_recruit_time {
    text-align: right;
}

/* ==================== 联系方式 + 产品区域（卡片容器） ==================== */
.contact-block {
    margin-top: var(--vip-space);
    margin-bottom: var(--vip-space-lg);
    background: var(--vip-card-bg);
    box-shadow: var(--vip-shadow-sm);
    border: 1px solid var(--vip-border-light);
    overflow: hidden;
}

/* ---- 左侧：联系方式 ---- */
.contact-block-l {
    font-size: 14px;
    padding: var(--vip-space) var(--vip-space);
    line-height: 1.9;
    color: var(--vip-text-secondary);
    height: 100%;
}

.contact-block-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--vip-text);
    line-height: 36px;
    height: 36px;
    margin-bottom: 16px;
    position: relative;
    padding-left: 14px;
}

.contact-block-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    -webkit-transform: translateY(-50%);
    -ms-transform: translateY(-50%);
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background: var(--vip-primary);
    border-radius: 2px;
}

.contact-block-l > div {
    margin-bottom: 6px;
    word-wrap: break-word;
    -webkit-word-break: break-word;
    word-break: break-word;
}

.contact-block-l a {
    color: var(--vip-secondary);
}

.contact-block-l a:hover {
    color: var(--vip-primary);
    text-decoration: underline;
}

/* ---- 联系方式与右侧内容的分界线 ---- */
.col-st-bo {
    border-right: 1px solid var(--vip-border-light);
    background: linear-gradient(to right, #fafafa, #fff);
}

/* ---- 右侧内容区 ---- */
.contact-block-r {
    padding: var(--vip-space);
}

/* ---- 右侧内部分区（样品 / 供货） ---- */
.contact-block-section {
    padding: 0;
}

.contact-block-section + .contact-block-section {
    border-top: 1px dashed var(--vip-border);
    margin-top: var(--vip-space);
    padding-top: var(--vip-space);
}

/* ==================== 响应式：平板（≤992px） ==================== */
@media (max-width: 992px) {
    .index-block {
        padding: var(--vip-space-sm) var(--vip-space-sm) 0;
    }

    .company_in_block {
        padding: var(--vip-space) var(--vip-space-sm);
    }

    .contact-block-l {
        padding: var(--vip-space-sm);
    }

    .contact-block-r {
        padding: var(--vip-space-sm);
    }

    .new_block {
        margin: 0 20px;
    }

    /* 轮播图比例调整（稍高一些） */
    .carousel-item {
        padding-top: 40%;
    }
}

/* ==================== 响应式：手机（≤768px） ==================== */
@media (max-width: 768px) {
    .index-block {
        padding: var(--vip-space-xs) var(--vip-space-xs) 0;
    }

    /* ---- 轮播图：移动端比例更高 ---- */
    .carousel-item {
        padding-top: 50%;
    }

    .carousel-control-prev,
    .carousel-control-next {
        width: 12%;
        opacity: 0.6; /* 移动端默认显示 */
    }

    .carousel-control-prev-icon,
    .carousel-control-next-icon {
        width: 28px;
        height: 28px;
    }

    .carousel-indicators li {
        width: 8px;
        height: 8px;
    }

    .carousel-indicators li.active {
        width: 20px;
    }

    /* ---- 企业介绍 ---- */
    .company_in {
        margin-top: var(--vip-space-sm);
    }

    .company_in_block {
        padding: var(--vip-space-sm) var(--vip-space-xs);
    }

    .company_title {
        font-size: 18px;
    }

    .company_info {
        font-size: 13px;
        line-height: 1.7;
        max-height: none;
        overflow-y: visible;
    }

    /* ---- 联系方式区域 ---- */
    .contact-block {
        border: none;
        margin-bottom: var(--vip-space);
    }

    /* 移动端：联系方式变上下布局，去除右边框 */
    .col-st-bo {
        border-right: none;
        border-bottom: 1px solid var(--vip-border-light);
        background: var(--vip-bg-alt);
    }

    .contact-block-l {
        padding: var(--vip-space-sm) var(--vip-space);
    }

    .contact-block-r {
        padding: var(--vip-space-sm) var(--vip-space-xs);
    }

    /* ---- 产品标题 ---- */
    .product_title {
        font-size: 18px;
        margin-bottom: 16px;
    }

    /* ---- 产品卡片：移动端减小间距 ---- */
    .product_list {
        margin-top: 8px;
        margin-bottom: 8px;
        padding: 8px;
    }

    .product_list_name {
        font-size: 13px;
        height: 38px;
    }

    /* ---- 查看更多按钮 ---- */
    .product_more {
        margin-top: 20px;
    }

    .product_more .btn-primary {
        padding: 8px 28px;
        width: 100%;
    }

    /* ---- 兼容旧样式 ---- */
    .img_block {
        width: 100%;
        height: auto;
        min-height: 80px;
    }

    .img_banner {
        width: 100%;
        height: auto;
    }

    .product_block {
        margin: 0 16px;
        padding: 20px 0 0 0;
    }

    .company_img_block {
        margin-left: 0;
        display: none;
    }

    .new_main_block {
        margin: 0 0 20px 0;
    }

    .new_new_block,
    .new_recruit_block {
        margin: 20px 0;
    }

    .company_info {
        height: auto;
    }
}

/* ==================== 响应式：小屏手机（≤480px） ==================== */
@media (max-width: 480px) {
    .index-block {
        padding: 0;
    }

    /* 极小屏：轮播图比例更高（适合竖屏） */
    .carousel-item {
        padding-top: 56.25%;
    }

    /* 产品网格：极小屏每行 2 个 */
    .product_list {
        padding: 6px;
    }

    .product_list_name {
        font-size: 12px;
        height: 34px;
    }

    .company_name {
        font-size: 18px;
    }

    .contact-block-l {
        padding: var(--vip-space-xs) var(--vip-space-sm);
        font-size: 13px;
    }

    .contact-block-r {
        padding: var(--vip-space-sm) var(--vip-space-xs);
    }
}

/* ==================== 响应式：极小屏（≤370px） ==================== */
@media (max-width: 370px) {
    .product_list_name {
        font-size: 11px;
        -webkit-line-clamp: 1;
        height: 24px;
    }
}

/* ==================== 打印样式 ==================== */
@media print {
    .top_nav,
    .main_nav,
    .carousel-control-prev,
    .carousel-control-next,
    .carousel-indicators,
    .product_more,
    .footer-vip {
        display: none !important;
    }

    .index-block,
    .company_in,
    .contact-block {
        box-shadow: none !important;
        border: none !important;
    }
}
