/* 平衡美观的商品分类间距调整 */
.category {
    margin-bottom: 5px !important;
    padding-bottom: 0 !important;
}

.category .container {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

.category h3 {
    margin-bottom: 12px !important;
}

.category .separator {
    margin-bottom: 15px !important;
}

.category-menus {
    margin-bottom: 8px !important;
    padding-bottom: 0 !important;
}

.category-menus .nav {
    margin-bottom: 0 !important;
}

.category-menus .nav-item {
    margin-bottom: 0 !important;
}

.goods {
    margin-top: -3px !important;
    padding-top: 0 !important;
}

.goods .container {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

#goodsTabContent {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

.tab-content > .tab-pane {
    padding-top: 8px !important;
}

.row-cols-2.row-cols-md-5.g-1 {
    --bs-gutter-x: 0.5rem !important;
    --bs-gutter-y: 0.5rem !important;
    margin-right: -0.25rem !important;
    margin-left: -0.25rem !important;
}

.row-cols-2.row-cols-md-5.g-1 > * {
    padding-right: 0.25rem !important;
    padding-left: 0.25rem !important;
    margin-top: 0.25rem !important;
    margin-bottom: 0.25rem !important;
}

.card {
    margin-bottom: 0 !important;
}

.main-container {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

/* 分类区块样式 */
.category-section {
    margin-bottom: 40px;
    padding: 20px 0;
    border-bottom: 1px solid #eee;
    transition: all 0.3s ease;
}

.category-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* 分类标题可点击样式 - 简化选中效果，仅保留颜色变化 */
.clickable-category-title {
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 10px;
    border-radius: 8px;
    margin: -10px -10px 20px -10px;
}

.clickable-category-title:hover {
    background-color: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

/* 选中状态：仅文字变色（移除了底部蓝色下划线） */
.clickable-category-title.active {
    color: #667eea;
    background: none;
    box-shadow: none;
    transform: none;
    /* 已删除 border-bottom: 2px solid #667eea; 这一行 */
}

.clickable-category-title.active h3 {
    color: #667eea !important;
}

.clickable-category-title.active p {
    color: #667eea !important;
}

.category-title {
    margin-bottom: 20px;
}

.category-products {
    margin-bottom: 10px;
}

/* 激活的分类菜单样式 - 仅按钮变色，无多余装饰 */
.nav-pills .nav-link.active {
    background-color: #667eea !important;
    border-color: #667eea !important;
    color: white !important;
    box-shadow: none;
    transform: none;
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    display: none;
}

.back-to-top.show {
    display: block;
}

.back-to-top-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.back-to-top-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* 响应式优化 */
@media (max-width: 767px) {
    .category {
        margin-bottom: 3px !important;
    }
    
    .goods {
        margin-top: -2px !important;
    }
    
    .tab-content > .tab-pane {
        padding-top: 5px !important;
    }
    
    .category h3 {
        margin-bottom: 10px !important;
    }
    
    .category .separator {
        margin-bottom: 12px !important;
    }
    
    .category-section {
        margin-bottom: 30px;
        padding: 15px 0;
    }
    
    .clickable-category-title {
        padding: 8px;
        margin: -8px -8px 15px -8px;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
    }
    
    .back-to-top-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}

/* CSS轮播样式 */
.css-carousel-container {
    position: relative;
    width: 100%;
    max-width: 80%;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 8px;
}

.css-carousel-track {
    display: flex;
    transition: transform 0.5s ease-in-out;
    width: 300%;
}

.css-carousel-slide {
    width: 33.333%;
    flex-shrink: 0;
    text-align: center;
    padding: 20px;
}

.css-carousel-slide img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.css-carousel-indicators {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: background-color 0.3s;
}

.indicator.active {
    background-color: #fff;
}

.css-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0,0,0,0.5);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: background-color 0.3s;
    z-index: 10;
}

.css-carousel-btn:hover {
    background-color: rgba(0,0,0,0.8);
}

.css-carousel-btn-prev {
    left: 10px;
}

.css-carousel-btn-next {
    right: 10px;
}

@keyframes autoSlide {
    0%, 28% { transform: translateX(0); }
    33.33%, 61.33% { transform: translateX(-33.333%); }
    66.66%, 94.66% { transform: translateX(-66.666%); }
    100% { transform: translateX(0); }
}

.css-carousel-track.auto-playing {
    animation: autoSlide 9s infinite;
}

/* 精致小巧的联系模态框 - 与网站配色一致 */
#contactModal .modal-dialog {
    max-width: 360px;
    margin: 1.75rem auto;
}

#contactModal .modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
    overflow: hidden;
}

#contactModal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 20px;
    position: relative;
}

#contactModal .modal-title {
    font-weight: 600;
    font-size: 16px;
    display: flex;
    align-items: center;
}

#contactModal .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
    transition: all 0.3s ease;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

#contactModal .btn-close:hover {
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

#contactModal .modal-body {
    padding: 20px;
}

#contactModal .contact-intro {
    text-align: center;
    margin-bottom: 20px;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* 联系方式容器 */
#contactModal .contact-methods {
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

#contactModal .contact-item {
    flex: 1;
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    border-radius: 10px;
    padding: 16px 12px;
    text-align: center;
    border: 1px solid #e8ecff;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#contactModal .contact-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

#contactModal .contact-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.15);
    border-color: #667eea;
}

#contactModal .contact-item:hover::before {
    transform: scaleX(1);
}

#contactModal .contact-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-size: 20px;
    color: white;
    position: relative;
    z-index: 1;
}

/* QQ图标样式 */
#contactModal .contact-item.qq .contact-icon {
    background: linear-gradient(135deg, #1296db 0%, #4fc3f7 100%);
    box-shadow: 0 3px 10px rgba(18, 150, 219, 0.3);
}

/* 微信图标样式 */
#contactModal .contact-item.wechat .contact-icon {
    background: linear-gradient(135deg, #07c160 0%, #66bb6a 100%);
    box-shadow: 0 3px 10px rgba(7, 193, 96, 0.3);
}

#contactModal .contact-type {
    font-weight: 600;
    font-size: 13px;
    color: #333;
    margin-bottom: 6px;
}

#contactModal .contact-number {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    font-weight: 500;
}

#contactModal .qr-code {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    margin: 0 auto;
    display: block;
    border: 2px solid #f0f0f0;
    transition: all 0.3s ease;
    object-fit: cover;
}

#contactModal .contact-item:hover .qr-code {
    transform: scale(1.05);
    border-color: #667eea;
}

#contactModal .qr-tip {
    font-size: 11px;
    color: #999;
    margin-top: 6px;
    line-height: 1.3;
}

#contactModal .modal-footer {
    border: none;
    padding: 0 20px 20px;
    text-align: center;
}

#contactModal .btn-close-modal {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    padding: 8px 25px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
}

#contactModal .btn-close-modal:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* 响应式优化 */
@media (max-width: 576px) {
    #contactModal .modal-dialog {
        max-width: 320px;
        margin: 1rem auto;
    }
    
    #contactModal .modal-body {
        padding: 16px;
    }
    
    #contactModal .contact-methods {
        flex-direction: column;
        gap: 10px;
    }
    
    #contactModal .contact-item {
        padding: 14px 12px;
    }
    
    #contactModal .qr-code {
        width: 55px;
        height: 55px;
    }
}

/* 服务卡片基础样式 */
.service-card {
    background: white !important;
    border: 1px solid rgba(102, 126, 234, 0.1) !important;
    backdrop-filter: blur(10px);
}

.service-card:hover {
    border-color: rgba(102, 126, 234, 0.2) !important;
}

/* 响应式优化 */
@media (max-width: 767px) {
    .service-icon {
        width: 50px !important;
        height: 50px !important;
    }
    
    .service-icon span {
        font-size: 24px !important;
    }
    
    .service-content {
        padding: 2px !important;
    }
}

/* 与网站整体风格保持一致的颜色系统 */
.service-card:nth-child(1):hover,
.service-card:nth-child(6):hover {
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15) !important;
}

.service-card:nth-child(2):hover {
    box-shadow: 0 8px 25px rgba(17, 153, 142, 0.15) !important;
}

.service-card:nth-child(3):hover {
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.15) !important;
}

.service-card:nth-child(4):hover {
    box-shadow: 0 8px 25px rgba(250, 112, 154, 0.15) !important;
}

.service-card:nth-child(5):hover {
    box-shadow: 0 8px 25px rgba(168, 237, 234, 0.15) !important;
}