/* 自定义样式 */

/* 全局样式 */
html, body, .flex-container {
  height: 100%;
  min-height: 100%;
}
main {
  min-height: 100vh;
}
.main-flex {
  display: flex;
  flex-direction: column;
  height: 100vh;
}
.flex-container {
  display: flex;
  flex-direction: row;
  flex: 1 1 0%;
  height: 100%;
  min-height: 600px;
}
.sidebar {
  width: 192px;
  min-width: 192px;
  max-width: 240px;
  flex-shrink: 0;
  height: 100%;
  overflow-y: auto;
}
.content {
  flex: 1 1 0%;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}
.custom-collapse {
  max-height: 500px;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(.4,0,.2,1);
}

/* 解决方案页面导航默认展开 */
.solution-page .custom-collapse {
  max-height: 500px !important;
}
.custom-collapse.show {
  max-height: 500px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* 轮播图样式 */
.hero-carousel-section {
    position: relative;
    overflow: hidden;
    margin-top: -70px; /* 抵消导航栏的padding-top */
}

.hero-carousel-section .carousel {
    min-height: 600px;
    max-height: 80vh;
}

.hero-carousel-section .carousel-item {
    position: relative;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.hero-carousel-section .carousel-item.active {
    opacity: 1;
    position: relative;
    z-index: 1;
}

.hero-carousel-section .carousel-inner {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* 移除遮罩层，让图片直接显示 */
/* .hero-carousel-section .carousel-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.1) 100%);
    z-index: 1;
} */

.hero-carousel-section .carousel-caption {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    backdrop-filter: blur(5px);
    margin: 0 auto;
    max-width: 500px;
    border: none;
    box-shadow: none;
}

.hero-carousel-section .carousel-caption h2 {
    font-size: 1.8rem;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    margin-bottom: 0.5rem;
}

.hero-carousel-section .carousel-caption p {
    font-size: 1rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    margin-bottom: 1rem;
}

.hero-carousel-section .carousel-indicators {
    bottom: 30px;
    z-index: 3;
}

.hero-carousel-section .carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin: 0 5px;
    background-color: rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.hero-carousel-section .carousel-indicators button.active {
    background-color: #fff;
    border-color: #fff;
    transform: scale(1.2);
}

.hero-carousel-section .carousel-control-prev,
.hero-carousel-section .carousel-control-next {
    width: 60px;
    height: 60px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    margin: 0 20px;
    z-index: 3;
    transition: all 0.3s ease;
}

.hero-carousel-section .carousel-control-prev:hover,
.hero-carousel-section .carousel-control-next:hover {
    background-color: rgba(0, 0, 0, 0.6);
    transform: translateY(-50%) scale(1.1);
}

.hero-carousel-section .carousel-control-prev-icon,
.hero-carousel-section .carousel-control-next-icon {
    width: 24px;
    height: 24px;
}

/* 响应式轮播图 */
@media (max-width: 768px) {
    .hero-carousel-section .carousel {
        min-height: 400px;
        max-height: 60vh;
    }
    
    .hero-carousel-section .carousel-caption {
        padding: 0.75rem;
        margin: 0 0.5rem;
        max-width: 400px;
    }
    
    .hero-carousel-section .carousel-caption h2 {
        font-size: 1.4rem;
    }
    
    .hero-carousel-section .carousel-caption p {
        font-size: 0.9rem;
    }
    
    .hero-carousel-section .carousel-control-prev,
    .hero-carousel-section .carousel-control-next {
        width: 40px;
        height: 40px;
        margin: 0 10px;
    }
}

@media (max-width: 576px) {
    .hero-carousel-section .carousel {
        min-height: 300px;
        max-height: 50vh;
    }
    
    .hero-carousel-section .carousel-caption {
        padding: 0.5rem;
        margin: 0 0.25rem;
        max-width: 300px;
    }
    
    .hero-carousel-section .carousel-caption h2 {
        font-size: 1.2rem;
    }
    
    .hero-carousel-section .carousel-caption p {
        font-size: 0.8rem;
    }
    
    .hero-carousel-section .carousel-caption .btn {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    .hero-carousel-section .carousel-control-prev,
    .hero-carousel-section .carousel-control-next {
        width: 35px;
        height: 35px;
        margin: 0 5px;
    }
}

/* 导航栏样式 */
.navbar {
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95) !important;
    z-index: 1030; /* 确保导航栏在最上层 */
    display: flex !important;
    width: 100% !important;
    visibility: visible !important;
    height: auto !important;
    position: fixed !important;
    top: 0 !important;
}

body {
    padding-top: 70px; /* 适配固定导航栏的高度 */
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.nav-link {
    position: relative;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 50%;
    background-color: #0d6efd;
    transition: all 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
    left: 0;
}

.navbar .dropdown-menu {
    border: none !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
    border-radius: 0.5rem !important;
    margin-top: 0.5rem !important;
    z-index: 1000 !important;
    transition: transform 0.3s ease, opacity 0.3s ease !important;
    display: none;
}

.navbar .dropdown-menu.show {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* 英雄区域样式 */
.hero-section {
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    min-height: calc(100vh - 70px); /* 减去导航栏高度 */
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.hero-section h1 {
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* 卡片悬停效果 */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1) !important;
}

/* 特性图标动画 */
.feature-icon {
    transition: transform 0.3s ease;
}

.card:hover .feature-icon {
    transform: scale(1.1);
}

/* 按钮样式 */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* 徽章样式 */
.badge {
    font-weight: 500;
    padding: 0.5em 1em;
}

/* 页脚样式 */
footer {
    background: linear-gradient(135deg, #212529 0%, #343a40 100%);
}

footer a:hover {
    color: #fff !important;
    text-decoration: none;
}

/* 确保大屏幕导航栏展开 */
@media (min-width: 992px) {
    .navbar-expand-lg .navbar-collapse {
        display: flex !important;
        flex-basis: auto;
        flex-grow: 1;
        visibility: visible !important;
        height: auto !important;
    }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .hero-section {
        min-height: 60vh;
        text-align: center;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.solution-grid-container {
    display: grid !important;
    gap: 1.5rem !important;
    min-height: 400px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    align-items: start !important;
    padding: 0 1rem;
}

.solution-card { height: 100%; display: flex; flex-direction: column; }
.solution-card .card-body { flex: 1; display: flex; flex-direction: column; }
.solution-card .card-text { flex-grow: 1; }

/* 产品网格样式 */
.product-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    min-height: 400px;
    width: 100%;
    box-sizing: border-box;
    align-items: start;
}

.product-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    height: 400px;
    box-sizing: border-box;
    text-decoration: none;
    color: inherit;
}

.product-image-container {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-description {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
    max-height: 2.8em;
    font-size: 0.95rem;
}

.product-description:hover {
    overflow-y: auto;
    max-height: 120px;
}

.product-card:hover {
    box-shadow: 0 12px 20px rgba(0,0,0,0.1) !important;
}

.product-card .card-body .mt-4 {
    margin-top: auto !important;
}

/* 产品卡片按钮样式 */
.product-card .card-body .mt-4 div {
    display: inline-block;
    background-color: #0d6efd !important;
    color: white !important;
    border: none;
    transition: background-color 0.3s ease;
}

.product-card .card-body .mt-4 div:hover {
    background-color: #0a58ca !important;
    transform: translateY(-1px);
}

/* 分页样式 */
.pagination-container {
    margin-top: 2rem;
}

.pagination .page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    background-color: #fff;
    border-color: #dee2e6;
}

.pagination .page-link {
    color: #0d6efd;
    background-color: #fff;
    border: 1px solid #dee2e6;
    padding: 0.75rem 1rem;
    font-weight: 500;
}

.pagination .page-link:hover {
    color: #0a58ca;
    background-color: #e9ecef;
    border-color: #dee2e6;
}

.pagination .page-item:not(.disabled) .page-link:hover {
    background-color: #0d6efd;
    border-color: #0d6efd;
    color: white;
}

/* 响应式产品网格 */
@media (max-width: 768px) {
    .product-grid-container {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .product-card {
        height: 350px;
    }
    
    .product-image-container {
        height: 150px;
    }
}

@media (max-width: 576px) {
    .product-grid-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .product-card {
        height: 320px;
    }
}

/* 产品水平滚动样式 */
.product-scroll-container {
    position: relative;
    overflow: hidden;
    margin: 0 -15px;
}

.product-scroll-wrapper {
    display: flex;
    gap: 20px;
    padding: 0 15px;
    transition: transform 0.5s ease-in-out;
    scroll-behavior: smooth;
}

.product-card-item {
    flex: 0 0 calc(33.333% - 14px);
    min-width: 300px;
}

.product-card-item .card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card-item .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}

/* 滚动指示器 */
.scroll-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.scroll-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #dee2e6;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.scroll-dot.active {
    background-color: #007bff;
}

.scroll-dot:hover {
    background-color: #adb5bd;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .product-card-item {
        flex: 0 0 calc(50% - 10px);
    }
}

@media (max-width: 768px) {
    .product-card-item {
        flex: 0 0 calc(100% - 10px);
    }
    
    .product-scroll-wrapper {
        gap: 15px;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #0d6efd;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0a58ca;
}

/* 产品详情页联系信息样式 */
.contact-info-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #dee2e6;
}

/* 立即咨询按钮样式 */
.contact-info-section .btn-success {
    height: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.contact-info-section .btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.contact-info-section .btn-success small {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    opacity: 0.9;
}

.qr-card {
    transition: all 0.3s ease;
    border: 1px solid #dee2e6 !important;
}

.qr-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.qr-code-img {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}



.company-info .card {
    transition: all 0.3s ease;
}

.company-info .card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 产品详情页响应式调整 */
@media (max-width: 768px) {
    .contact-info-section {
        padding: 1rem;
    }
    
    .qr-code-img {
        max-width: 100px !important;
    }
    
    .contact-info-section .btn-success {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .contact-info-section .btn-success small {
        font-size: 0.8rem;
    }
}

/* 滚动条样式 */
.product-scroll-container::-webkit-scrollbar {
    height: 6px;
}

.product-scroll-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.product-scroll-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.product-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 文本截断样式 */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 解决方案页面左侧导航样式 */
.sidebar {
  width: 192px;
  min-width: 192px;
  max-width: 240px;
  flex-shrink: 0;
  height: 100%;
  overflow-y: auto;
  background-color: #f8f9fa;
  border-right: 1px solid #dee2e6;
  box-shadow: 2px 0 4px rgba(0,0,0,0.1);
}

.sidebar .category-item {
  transition: all 0.2s ease;
  border-radius: 6px;
  margin: 2px 8px;
}

.sidebar .category-item:hover {
  background-color: #e9ecef;
  transform: translateX(2px);
}

.sidebar .category-item.active {
  background-color: #0d6efd;
  color: white;
}

.sidebar .subcategory {
  transition: all 0.2s ease;
  border-radius: 4px;
  margin: 1px 4px;
  font-size: 0.875rem;
}

.sidebar .subcategory:hover {
  background-color: #e9ecef;
  transform: translateX(2px);
}

.sidebar .subcategory.active {
  background-color: #0d6efd;
  color: white;
}

.sidebar .collapse {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.sidebar .collapse.show {
  max-height: 500px;
}

/* 确保解决方案卡片布局正确 */
.solution-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 1.5rem;
}

.solution-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  overflow: hidden;
  max-height: 380px; /* 限制最大高度 */
}

.solution-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
  border-color: #0d6efd;
}

.solution-card .solution-image-container {
  height: 180px; /* 减少图片高度 */
  overflow: hidden;
  position: relative;
}

.solution-card .solution-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.solution-card:hover .solution-image {
  transform: scale(1.05);
}

.solution-card .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  min-height: 0; /* 允许内容收缩 */
}

.solution-card .solution-description {
  flex: 1;
  color: #6c757d;
  font-size: 0.875rem;
  line-height: 1.4;
  margin-bottom: 1rem;
  /* 限制为3行 */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: 3.9em; /* 3行的高度 */
}

/* 强制控制解决方案卡片标题字体大小 */
.solution-card h3 {
  font-size: 0.875rem !important; /* 14px */
  font-weight: 500 !important;
  line-height: 1.3 !important;
  margin-bottom: 0.5rem !important;
}

/* 响应式布局 */
@media (max-width: 768px) {
  .flex-container {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    max-width: none;
    height: auto;
    max-height: 300px;
    margin-bottom: 1rem;
  }
  
  .solution-grid-container {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    padding: 1rem;
  }
  
  .solution-card {
    max-height: 350px; /* 移动端稍微降低高度 */
  }
  
  .solution-card .solution-image-container {
    height: 160px; /* 移动端减少图片高度 */
  }
}

@media (max-width: 576px) {
  .solution-grid-container {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0.5rem;
  }
  
  .solution-card {
    max-height: 320px; /* 小屏幕进一步降低高度 */
  }
  
  .solution-card .solution-image-container {
    height: 140px; /* 小屏幕进一步减少图片高度 */
  }
}

/* 文章页面样式 */
.article-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  padding: 1.5rem;
}

.article-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  overflow: hidden;
  max-height: 420px; /* 限制最大高度 */
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
  border-color: #0d6efd;
}

.article-card .article-image-container {
  height: 180px; /* 减少图片高度 */
  overflow: hidden;
  position: relative;
}

.article-card .article-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.article-card:hover .article-image {
  transform: scale(1.05);
}

.article-card .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem;
  min-height: 0; /* 允许内容收缩 */
}

.article-card .article-summary {
  flex: 1;
  color: #6c757d;
  font-size: 0.875rem;
  line-height: 1.4;
  margin-bottom: 1rem;
  /* 限制为3行 */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-height: 3.9em; /* 3行的高度 */
}

/* 文章页面响应式布局 */
@media (max-width: 768px) {
  .article-grid-container {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    padding: 1rem;
  }
  
  .article-card {
    max-height: 380px; /* 移动端稍微降低高度 */
  }
  
  .article-card .article-image-container {
    height: 160px; /* 移动端减少图片高度 */
  }
}

@media (max-width: 576px) {
  .article-grid-container {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0.5rem;
  }
  
  .article-card {
    max-height: 350px; /* 小屏幕进一步降低高度 */
  }
  
  .article-card .article-image-container {
    height: 140px; /* 小屏幕进一步减少图片高度 */
  }
}