/* ==========================================
   index首页专用样式（home.css）
   仅作用于 index.html，不影响其他页面
   ========================================== */
/* ✅ 主容器：强制 2:1 比例（1920×960） */
#mainBanner .carousel-item {
    aspect-ratio: 2 / 1;        /* ✅ 和 1920×960 对应 */
    min-height: 420px;
    max-height: 800px;
    overflow: hidden;
    background: #333;
}

#mainBanner .carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;          /* ✅ 配合 ResizeToFill */  /* 保证图片铺满不变形 */
    object-position: center;    /* ✅ 现在 center 就真的居中了 */
}

/* ✅ 蒙版（可选，提升文字可读性） */
#mainBanner .carousel-item::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.1) 50%, transparent 100%);
    z-index: 1;
}

/* ✅ 文字层确保在蒙版之上 */
/* --- 文字与按钮层级 --- */

.carousel-caption {
    position: absolute;
    top: 50%;
    left: 5%;                   /* 文字靠左对齐，更符合阅读习惯 */
    transform: translateY(-50%); /* 垂直居中 */
    bottom: auto;               /* 覆盖 Bootstrap 默认的 bottom */
    right: auto;
    text-align: left;           /* 文字左对齐 */
    z-index: 2;
    width: 60%;                 /* 控制文字最大宽度，防止换行过长 */
}

/* 标题样式（参考对手：大字号、加粗、白色） */

.carousel-caption h2 {
    font-size: 3rem;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    margin-bottom: 1rem;
}

/* 描述文字样式 */
.carousel-caption p {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

/* 按钮样式（参考对手：黑色/深色背景 + 白色文字，圆角适中） */
.carousel-caption .btn-read-more {
    background-color: #c00000;  /* 采用类似对手的醒目红色，或改为 #000 */
    color: #fff;
    padding: 0.8rem 2rem;
    font-weight: 600;
    border-radius: 4px;
    border: none;
    transition: all 0.3s ease;
}

.carousel-caption .btn-read-more:hover {
    background-color: #900000;
    transform: translateY(-2px);
}

/* =========================
   移动端 Banner 铺满首屏（关键）
   ========================= */
@media (max-width: 768px) {
/* 1. Banner 容器：减小高度至 45vh，去掉 flex 布局防止 Bootstrap JS 冲突 */
    #mainBanner .carousel-item {
        position: relative;          /* 改用相对定位，修复轮播切换闪回问题 */
        height: 45vh;                /* 固定高度，比之前的 50vh 更紧凑 */
        min-height: 300px;           /* 防止过小屏幕看不清 */
        max-height: 450px;
        overflow: hidden;
        background: transparent !important; /* 🔴 关键：彻底去掉黑背景 */
    }

    /* 2. 图片适配：绝对定位铺满容器，确保居中无黑边 */
    #mainBanner .carousel-item img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        opacity: 1;
        z-index: 1;
    }

    /* 3. 蒙版：保持在图片之上 */
    #mainBanner .carousel-item::before {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.1) 60%, transparent 100%);
        z-index: 2;
    }

    /* 4. 文字区域：绝对定位，确保在蒙版之上 */
    .carousel-caption {
        position: absolute;
        top: auto;
        bottom: 10%;
        left: 50%;
        transform: translate(-50%, 0);
        width: 90%;
        text-align: center;
        z-index: 3;                  /* 确保在蒙版和图片最上层 */
        padding: 1rem;
    }

    .carousel-caption h2 {
        font-size: 1.6rem;
        margin-bottom: 0.5rem;
    }

    .carousel-caption p {
        font-size: 0.85rem;
        margin-bottom: 1rem;
    }

.carousel-caption .btn-read-more {
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
}

    /* 4. 下方缩略图区域：占剩余 35% 视口高度（100vh - 45vh = 55vh） */
        height: calc(100vh - 45vh);  /* 剩余高度 */
    overflow-y: auto;
}


/* ==========================================
   首页产品缩略图 + 详情区（最终版）
   ========================================== */
/* ✅ 缩略图容器 */
.product-thumb {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 6px;
  padding: 4px;
  box-sizing: border-box;
  cursor: pointer;
  border: 1px solid transparent; /* ✅ 默认状态：无边框 */
  /* ✅ 关键：过渡动画 */
  transition: background-color .25s ease,
              box-shadow .25s ease,
              transform .2s ease;
}



/* ✅ 鼠标悬浮：高亮（蓝色，和你箭头呼应） */
.product-thumb:hover {
  /*background-color: #eef5ff;*/
  border-color: #0d6efd;
  box-shadow: 0 4px 12px rgba(13, 110, 253, .25);
  transform: translateY(-2px);
}

/* ✅ 选中态（JS 切换时用到） */
.product-thumb.active {
  background-color: #eef5ff;
  border-color: #0d6efd;
  box-shadow: 0 4px 12px rgba(13, 110, 253, .25);
}

/* ✅ 图片本身不要抢 hover */
.product-thumb img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  pointer-events: none; /* ✅ 防止 img 吃掉 mouse 事件 */
}

/* ✅ 箭头 */
.thumb-arrow {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all .2s ease;
}
.thumb-arrow:hover {
  background: #0d6efd;
  color: #fff;
  border-color: #0d6efd;
}

/* ✅ 缩略图滚动区 */
.thumb-scroll {
  scroll-behavior: smooth;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 10px;
}


/* ✅ 缩略图（关键：永远完整） */
.thumb-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* ✅ 详情卡片 */
.detail-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
  padding: 32px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: transform .3s ease, box-shadow .3s ease;
}
#detail-info-card-link:hover .detail-card {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,.1);
}

/* ✅ 详情标题 */
#detail-title {
  font-size: 2rem;
  font-weight: 800;
  color: #111;
  line-height: 1.3;
  margin-bottom: 1.5rem;
  border-left: 4px solid #e63946;
  padding-left: 1rem;
  word-break: keep-all;
  hyphens: auto;
}

/* ✅ 详情描述 */
#detail-desc {
  color: #444;
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

/* ✅ 参数 */
#detail-specs .list-group-item {
  background: transparent;
  border-bottom: 1px solid #f0f0f0;
  padding: 10px 0;
  font-size: 0.95rem;
  color: #333;
}

/* ✅ 大图容器（关键） */
#detail-image-container {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
  padding: 32px;
  height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

/* ✅ 大图（关键） */
#detail-image {
  max-height: 100%;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* ✅ 默认提示 */
#default-tip {
  text-align: center;
  color: #6c757d;
  padding: 60px 20px;
}

/* ✅ 移动端 */
@media (max-width: 768px) {
  .upload-tip-box {
    font-size: 0.85rem;
    padding: 10px 12px;
  }

  .detail-card {
    padding: 24px;
  }

  #detail-title {
    font-size: 1.5rem;
    padding-left: .75rem;
    border-left-width: 3px;
  }

  #detail-image-container {
    padding: 20px;
    height: 280px;
  }

  #detail-image {
    max-height: 250px;
  }
}


/* =========================
   5. 核心产品 & 解决方案 & 新闻
   ========================= */

.core-products .card,
.solutions .card,
.news-section .card {
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
}

.core-products .card,
.solutions .card,
.news-section .card {
    transition: transform .2s ease, box-shadow .2s ease;
}

.core-products .card-img-top,
.solutions .card-img-top {
    height: 220px;
    object-fit: cover;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.news-section .card-img-top {
    height: 160px;
    object-fit: cover;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.core-products .card-body,
.solutions .card-body,
.news-section .card-body {
    padding: 20px;
}

.core-products .card-title,
.solutions .card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.news-section .card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.core-products .card-text,
.solutions .card-text {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 16px;
}

.news-section .card-text {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 8px;
}

.core-products .btn,
.solutions .btn,
.news-section .btn {
    font-size: 14px;
    padding: 6px 16px;
    border-radius: 4px;
}

/* =========================
   6. 公司实力
   ========================= */
#companyStrengthCarousel img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
    transition: transform .3s;
}

#companyStrengthCarousel img:hover {
    transform: scale(1.03);
}

#companyStrengthCarousel .carousel-control-prev,
#companyStrengthCarousel .carousel-control-next {
    width: 40px;
    height: 40px;
    background-color: rgba(255,255,255,0.8);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

#companyStrengthCarousel .carousel-control-prev {
    left: -20px;
}

#companyStrengthCarousel .carousel-control-next {
    right: -20px;
}

#companyStrengthCarousel .carousel-control-prev-icon,
#companyStrengthCarousel .carousel-control-next-icon {
    width: 20px;
    height: 20px;
}

/* 手机端优化 */
@media (max-width: 767.98px) {
    #companyStrengthCarousel img {
        height: 130px;
    }

    #companyStrengthCarousel .carousel-control-prev,
    #companyStrengthCarousel .carousel-control-next {
        width: 36px;
        height: 36px;
    }

    #companyStrengthCarousel .carousel-control-prev-icon,
    #companyStrengthCarousel .carousel-control-next-icon {
        width: 18px;
        height: 18px;
    }
}

/* ==========================================
   公司实力 - 横向滑动（scroll-snap）
   ========================================== */

.strength-slider-wrapper {
    position: relative;
    overflow: hidden;
    padding: 0 3rem; /* 给左右按钮留空间 */
}

.strength-slider {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch; /* iOS 顺滑 */
    scrollbar-width: none; /* Firefox 隐藏滚动条 */
}

.strength-slider::-webkit-scrollbar {
    display: none; /* Chrome 隐藏滚动条 */
}

.strength-card {
    flex: 0 0 calc(25% - 0.75rem); /* PC：4 个一排 */
    scroll-snap-align: start;
    text-align: center;
}

.strength-card img {
    width: 100%;
    height: 200px;          /* PC 稍大一点 */
    object-fit: cover;
    border-radius: 0.375rem;
    transition: transform 0.3s ease;
}

.strength-card img:hover {
    transform: scale(1.03); /* 轻微 hover 放大，高级感 */
}

.strength-card p {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #6c757d;
}

/* 左右按钮 */
.strength-prev,
.strength-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(0,0,0,0.5);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.strength-prev { left: 0; }
.strength-next { right: 0; }

.strength-prev:hover,
.strength-next:hover {
    background: rgba(0,0,0,0.75);
}

.strength-prev .carousel-control-prev-icon,
.strength-next .carousel-control-next-icon {
    width: 20px;
    height: 20px;
    filter: invert(1); /* 白色图标 */
}

/* =========================
   响应式断点
   ========================= */

/* 平板：3 个一排 */
@media (max-width: 991.98px) {
    .strength-card {
        flex: 0 0 calc(33.333% - 0.75rem);
    }
}

/* 小平板：2 个一排 */
@media (max-width: 767.98px) {
    .strength-card {
        flex: 0 0 calc(50% - 0.5rem);
    }
    .strength-slider-wrapper {
        padding: 0 2.5rem;
    }
}

/* 手机：1 个一排 */
@media (max-width: 575.98px) {
    .strength-card {
        flex: 0 0 100%;
    }
    .strength-card img {
        height: 200px; /* 手机端图片可以大一点 */
    }
    .strength-slider-wrapper {
        padding: 0 2rem;
    }
}


/* =========================
   7. 客户评价
   ========================= */
.client-reviews .list-group-item {
    border: none;
    padding: 16px 0;
    border-bottom: 1px solid #e9ecef;
}

.client-reviews .list-group-item:last-child {
    border-bottom: none;
}

.client-reviews .text-warning {
    margin-bottom: 8px;
}

.client-reviews .fw-medium {
    color: #212529;
    margin-bottom: 8px;
    line-height: 1.6;
}

.client-reviews .text-muted {
    font-size: 13px;
    color: #6c757d !important;
}

/* =========================
   8. 核心优势
   ========================= */
/* =========================
   核心优势 - 高端金属卡片风格
   ========================= */
.advantage-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    /*border: 2px solid transparent;*/
    border-radius: 12px;
    padding: 30px 20px;
    margin: 15px 0;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    /* 关键：金色边框效果 */
    background-clip: padding-box;
    /*border-image: linear-gradient(135deg, #c9a227, #f0d57a, #c9a227) 1;*/
    border: 2px solid #D4AF37; /* 使用实线边框代替渐变边框，避免渲染缝隙 */
}

.advantage-card::before {
    content: '';
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    background: linear-gradient(135deg, #c9a227, #f0d57a, #c9a227);
    border-radius: 14px;
    z-index: -1;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.advantage-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.advantage-card:hover::before {
    opacity: 1;
}

/* 图标徽章容器 */
.advantage-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #c9a227;
    box-shadow: 0 4px 10px rgba(201, 162, 39, 0.2);
    position: relative;
    overflow: hidden;
}

.advantage-icon::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.8), transparent 50%);
    border-radius: 50%;
    z-index: 1;
}

.advantage-icon i {
    font-size: 32px;
    color: #0d6efd; /* 蓝色图标，和你原风格一致 */
    z-index: 2;
    position: relative;
}

/* 响应式：小屏时缩小间距 */
@media (max-width: 768px) {
    .advantage-card {
        padding: 20px 15px;
        margin: 10px 0;
    }
    .advantage-icon {
        width: 60px;
        height: 60px;
    }
    .advantage-icon i {
        font-size: 24px;
    }
}

/* =========================
   9. 联系我们 CTA
   ========================= */
.cta-section {
    background: linear-gradient(135deg, #198754 0%, #0d6efd 100%);
    padding: 60px 0;
    text-align: center;
    color: #fff;
}

.cta-section h3 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 16px;
}

.cta-section p {
    font-size: 18px;
    margin-bottom: 24px;
    opacity: 0.9;
}

.cta-section .btn {
    background-color: #fff;
    color: #0d6efd;
    font-size: 18px;
    padding: 12px 32px;
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.cta-section .btn:hover {
    background-color: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* =========================
   10. 底部
   ========================= */

.site-footer {
    background: linear-gradient(135deg, #198754 0%, #0d6efd 100%);
    color: #fff;
    padding: 40px 0 20px;
}

.site-footer h5 {
    font-weight: 700;
    margin-bottom: 20px;
    font-size: 18px;
}

.site-footer ul {
    padding-left: 0;
    list-style: none;
}

.site-footer li {
    margin-bottom: 8px;
}

.site-footer a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-footer a:hover {
    color: #fff;
    text-decoration: underline;
}

.site-footer .text-center {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 14px;
    color: rgba(255,255,255,0.7);
}


/* =========================
   12. 响应式调整
   ========================= */

@media (max-width: 991.98px) {
    #detail-info-card,
    #detail-image-container {
        min-height: auto;
        padding: 20px;
    }

    #detail-image {
        max-height: 250px;
    }

    .core-products .card-img-top,
    .solutions .card-img-top {
        height: 200px;
    }

    .news-section .card-img-top {
        height: 140px;
    }
}

@media (max-width: 767.98px) {
    .thumb-arrow {
        width: 28px;
        height: 28px;
    }

    .thumb-arrow span {
        font-size: 16px;
    }

    .thumb-arrow-left {
        left: -14px;
    }

    .thumb-arrow-right {
        right: -14px;
    }

    .product-item-wrapper {
        width: 90px;
    }

    /*.product-content img {*/
    /*    width: 60px;*/
    /*    height: 60px;*/
    /*}*/

    /*.product-content .small {*/
    /*    font-size: 11px;*/
    /*}*/

    #companyStrengthCarousel .carousel-control-prev,
    #companyStrengthCarousel .carousel-control-next {
        width: 32px;
        height: 32px;
    }

    #companyStrengthCarousel .carousel-control-prev-icon,
    #companyStrengthCarousel .carousel-control-next-icon {
        width: 16px;
        height: 16px;
    }
}
