/* 电商风格样式 */
:root {
    --bs-blue: #1A4E8C;
    --bs-orange: #F58220;
    --bs-gray: #F5F5F7;
    --common-container-width: 100%;    /* 响应式宽度 */
    --common-container-max-width: 1320px; /* 最大宽度 */
    
}

.common-width {
    width: var(--common-container-width);
    max-width: var(--common-container-max-width);
    margin: 0 auto;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans SC', sans-serif;
    background: var(--bs-gray);
}


/* 顶部导航 */
.top-nav {
    background: var(--bs-blue);
    /* border-bottom: 2px solid var(--bs-orange); */
}

.top-search {
    border-radius: 15px;
    overflow: hidden;
   border: 2px solid var(--bs-orange); 
}

.top-search input {
    border: none;
    border-radius: 0 !important;
    padding: 12px 25px;
    /* 输入框左边框移除 */
   padding-left: 15px !important;
}

/* 选择框样式 */
.form-select {
    border-radius: 0 !important;
    background-position: right 0.75rem center;
    line-height: 1.8; /* 控制分界线高度 */
    padding-right: 15px; !important;
}

/* 修改焦点状态 */
.form-control:focus,
.form-select:focus {
    box-shadow: none !important;
    border-color: #ddd;
}

/* 选择框悬停效果 */
.form-select:hover {
    border-color: #ced4da;
}

.top-search button {
    background: var(--bs-orange);
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 0 !important; /* 按钮直角样式 */
    transition: all 0.3s; /* 过渡效果 */
}
.top-search button:hover {
    background: var(--bs-orange);
    color: white;
}

/* 数据看板 */
.data-board {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.data-item {
    border-right: 1px solid #eee;
    padding: 15px;
}

.data-item:last-child {
    border: none;
}


/* 钢种导航和新增导航条全宽样式 */
.full-width-nav {
    width: 100%;
    background-color: white;
}

/* 调整导航项之间的间距 */
.nav-item-link {
    text-decoration: none;
    color: #333;
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 18px;
    font-weight: 500;
    padding: 8px 0;
    flex: 1;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

.nav-item-link:hover {
    color: #1A4E8C;
    font-weight: bold;
}

.nav-item-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background-color: #1A4E8C;
    transition: width 0.3s ease;
}

.nav-item-link:hover::after {
    width: 40%;
}

/* 移除原来容器的样式 */
.mt-1.bg-white.py-2.px-3.rounded.shadow-sm,
.mt-2.bg-white.py-2.px-3.rounded.shadow-sm {
    background-color: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}


/* 商品卡片 */
.steel-card {
    background: white;
    border-radius: 6px;
    transition: all 0.3s;
    border: 1px solid #ddd;
}

.steel-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-3px);
}

 /* 卡片悬停效果 */
.steel-card:hover,
.latest-products .card:hover {  /* 选择器 */
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.steel-price {
    color: var(--bs-orange);
    font-size: 1.0em;
    font-weight: 700;
}

/* 最新现货悬停效果 */
.latest-products .hover-effect {
    transition: all 0.3s ease;
    position: relative;
}

.latest-products .hover-effect:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
    z-index: 2;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
}

/* 统一三栏容器高度 */
.row > .col-lg-2,
.row > .col-lg-7{
    height: 350px; /* 根据实际内容调整 */
}

/* 轮播图容器高度 */
#mainCarousel {
    height: 100%;
}

/* 轮播图图片高度 */
.carousel-item img {
    height: 100%;
    object-fit: cover;
}

/* 分类导航 */
.category-nav {
    height: 301px; /* 7个按钮总高度 */
    display: flex !important;  
    flex-direction: column;  
    flex-wrap: nowrap; /* 防止换列 */
    }
.card-header.bg-steel {
    height: 48px; /* 资源分类标题固定高度 */
    display: flex;
    align-items: center;
}
.category-nav .nav-link {
    color: #666;
    padding: 12px 20px;
    border-radius: 4px;
    flex-shrink: 0; /* 防止内容挤压 */
    height: 43px;   /* 7个按钮固定高度 */
    display: flex;  
    align-items: center; /* 垂直居中 */
    box-sizing: border-box; 
    margin: 0; /* 微小间距 */
}

.category-nav .nav-link:hover {
    background: rgba(26,78,140,0.05);
    color: var(--bs-blue);
}

/* 表格样式 */
.steel-table th {
    background: var(--bs-blue);
    color: white;
}

/* 按钮样式 */
.btn-steel {
    background: var(--bs-orange);
    color: white;
    border-radius: var(--bs-border-radius); /* 使用与采购按钮相同的圆角 */
    padding: 2px 16px;
    transition: all 0.3s; /* 过渡效果 */
}
.btn-steel:hover {
    background: white !important;
    color: var(--bs-orange) !important;
    border: 1px solid var(--bs-orange);
}

/* 热门交易钢种折叠按钮样式 */
.btn-orange {
    background: #F58220;
    color: white !important;
    border-radius: 25px;
    padding: 8px 20px;
    transition: all 0.3s;
}
.btn-orange:hover {
    background: #e6731c;
    color: white;
}

.object-fit-cover {
    object-fit: cover;
}

/* 资源分类侧面子导航样式 */
.sub-nav-box {
    display: none;
    position: absolute;
    pointer-events: auto !important;
    left: 195px; /* 与资源分类导航框紧挨对齐 */
    top: 0;
    width: 700px;
    height: 350px;
    background: white;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    padding: 15px;
    z-index: 1000;
}

.sub-nav-box:hover {
    display: block !important;
}

/* 横向布局样式 */
.sub-nav-columns {
    display: flex;
    gap: 10px; /* 缩小列间距防止溢出 */
    padding: 10px;
}

.sub-nav-col {
    flex: 1 0 18%;  /* 其他列保持较小比例 */
    min-width: 18%;  /* 导航框内品种、规格、材质的宽度 */
}

.sub-nav-col[style*="flex: 2"] {
    flex: 2 0 25% !important; /* 企业直通车列占更大比例 */
    min-width: 25%;
}

.sub-nav-item {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    white-space: nowrap;
    padding: 6px 0;
}

.sub-nav-item a {
    color: #1A4E8C;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 0.9em;
    padding: 4px 8px;
}

.sub-nav-item a:hover {
    color: #F58220;
    padding-left: 5px;
}

/* 侧面导航项悬停时保持背景色 */
.nav-link:hover {
    background: rgba(26,78,140,0.05)!important;
}

/* 侧面导航子导航分组样式 */
.sub-nav-group {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 8px;
}

.sub-nav-title {
    color: #F58220;
    font-size: 0.9em;
    font-weight: 600;
    margin-bottom: 8px;
    padding-left: 8px;
}

.sub-nav-group:last-child {
    border-bottom: none;
}


.sub-nav-item a {
    display: block;
    padding: 6px 12px;
    border-radius: 4px;
}

.sub-nav-item:hover {
    background: rgba(26,78,140,0.05);
}


.shop-logo {
    width: 80px;
    height: 80px;
    object-fit: cover;
}
.shop-card {
    height: 100%;
    transition: transform 0.3s;
    margin: 5px; /* 外边距 */
    border: 1px solid #ddd !important; /* 强制显示边框 */            
}
.shop-card img {
    height: 100px;
    width: auto;
    object-fit: contain;
    margin: 0 auto;
}
.shop-card:hover {
    transform: translateY(-5px) scale(0.98); /* 缩放效果 */
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    z-index: 1; /* 层级提升 */
}

/* 右侧快捷工具栏样式 */
.quick-toolbar {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px; /* 减小间距 */
}

.tool-item {
    position: relative;
    background: white;
    border-radius: 8px; /* 减小圆角 */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.tool-item:hover {
    transform: translateX(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.tool-link {
    display: block;
    text-align: center;
    padding: 10px; /* 减小内边距 */
    text-decoration: none;
    color: #333;
}

.tool-icon img {
    width: 24px; /* 调小图标 */
    height: 24px; /* 调小图标 */
    display: block;
    margin: 0 auto 4px; /* 减小下边距 */
}

.tool-text {
    font-size: 12px; 
    white-space: nowrap;
}

/* 微信公众号二维码样式 */
.wechat-item:hover .wechat-qrcode {
    display: block;
}

.wechat-qrcode {
    position: absolute;
    right: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    padding: 12px; /* 减小内边距 */
    border-radius: 8px; /* 减小圆角 */
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    display: none;
    margin-right: 8px; /* 减小间距 */
    width: 130px; /* 减小宽度 */
    text-align: center;
}

.wechat-qrcode img {
    width: 100px; /* 调小二维码 */
    height: 100px; /* 调小二维码 */
    display: block;
    margin: 0 auto 8px; /* 减小下边距 */
}

.wechat-qrcode p {
    margin: 0;
    font-size: 10px; /* 调小文字 */
    color: #666;
}

.wechat-qrcode::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent; /* 调小箭头 */
    border-left-color: white;
}

/* 快捷工具栏响应式设计 - 在小屏幕上隐藏 */
@media (max-width: 768px) {
    .quick-toolbar {
        display: none;
    }
}


/* 钢厂轮播区域导航按钮定位 */
.owl-prev, .owl-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px !important;
    color: #1A4E8C !important;
    background: rgba(255,255,255,0.9) !important;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10; /* 确保按钮在卡片上方 */
}
.owl-prev { 
    left: -20px; /* 移到容器外侧 */
}
.owl-next { 
    right: -20px; /* 移到容器外侧 */
}

/* 钢厂轮播区域悬停触发区域 */
.container.mt-4.bg-white:hover .owl-prev,
.container.mt-4.bg-white:hover .owl-next {
    opacity: 1;
}

/* 钢厂轮播区域信息卡片 */
.info-card {
    margin-bottom: 10px;
    transition: transform 0.3s;
}
.info-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.scrolling-container {
    height: 400px;
    overflow-y: hidden;
}
.scrolling-content {
    animation: scroll 30s linear infinite;
}

/* 滚动动画 */
@keyframes scroll {
    0% { transform: translateY(0); }
    100% { transform: translateY(calc(-100% + 400px)); }
}
.scrolling-content:hover {
    animation-play-state: paused;
}
.scroll-item:hover {
    background: rgba(26,78,140,0.05);
}


.ad-banner {
    height: auto; /* 移除固定高度 */
    margin-bottom: 1rem; /* 添加间距 */
}
.ad-banner img {
    height: auto; /* 移除固定高度 */
    margin-bottom: 1rem; /* 添加间距 */
}

.section-title {  /* 独立出来的标题样式 */
    position: relative;
    padding-left: 15px;
    margin-bottom: 20px;
}
.section-title:before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 20px;
    background-color: #0d6efd;
} 

.bg-orange {
    background-color: #F58220!important;
    padding: 5px 12px;
    border-radius: 5px;
    font-size: 0.9em;
}

/* 服务区域开始 */
.service-container {
    display: flex;
    overflow: hidden;
    height: 200px; /* 设置固定高度，使动画效果更明显 */
}

.service-item {
    flex: 1; /* 初始时平均分配宽度 */
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* 平滑过渡效果 */
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.service-item:hover {
    flex: 3; /* 悬停时占比扩大 */
    background-color: #212529; /* 悬停时背景色变化 */
}

.service-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* 保持图片比例，覆盖容器 */
    opacity: 1;
    transform: scale(1.1); /* 初始时图片放大10% */
    transition: all 0.5s ease;
}

.service-item:hover img {
    opacity: 0.7; /* 半透明效果 */
    transform: scale(1); /* 悬停时图片缩小回原大小，产生缩放动画 */
}

.service-content {
    position: absolute;
    top: 50%; /* 垂直居中定位 */
    left: 0;
    right: 0;
    transform: translateY(-50%); /* 垂直居中偏移 */
    padding: 2rem;
    color: white;
    z-index: 1;
    transition: all 0.5s ease;
    opacity: 0.8;
    text-align: center; /* 水平居中 */
}

.service-item:hover .service-content {
    transform: translateY(-50%); /* 保持垂直居中 */
    opacity: 1;
}

.service-title {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.service-item:hover .service-title {
    font-size: 2rem; /* 悬停时标题变大 */
}

.service-desc {
    opacity: 0; /* 初始时描述隐藏 */
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    transition-delay: 0.1s; /* 延迟显示，增强层次感 */
}

.service-item:hover .service-desc {
    opacity: 1; /* 悬停时描述显示 */
    max-height: 100px; /* 设置一个足够大的值 */
}

/* 服务区域结束 */


/* 响应式调整 */
@media (max-width: 768px) {
    #cityNav {
        max-height: 200px;
        overflow-y: auto;
    }
    .city-region {
        width: 100%;
        margin-bottom: 10px;
    }
    .city-region .badge {
        margin-bottom: 5px;
    }   
    .btn-light {
        padding: 0.5rem !important;
        font-size: 0.9rem !important;
    }
    .fa-sm {
        font-size: 0.8em !important;
    } 
    .product-card {
        margin-bottom: 20px;
    }
}


/* ========== 移动端专属样式 ========== */
@media (max-width: 767.98px) {
    /* 隐藏PC端顶部导航 */
    .top-nav {
        display: none !important;
    }

    /* 1. 移动端顶部：logo + 带对勾的广告语（同一行） */
    .mobile-top-header {
        background: #1a4e8c;
        padding: 10px 15px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        border-bottom: 1px solid #eee;
    }
    .mobile-top-header .logo {
        flex-shrink: 0;
    }
    .mobile-top-header .logo img {
        height: 30px;
    }
    .mobile-top-header .slogan-wrapper {
        font-size: 13px;
        color: #ffffff;
        font-weight: 500;
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: nowrap;
    }
    .mobile-top-header .slogan-item {
        display: flex;
        align-items: center;
        gap: 3px;
        white-space: nowrap;
    }
    .mobile-top-header .check-icon {
        color: #1296db;
        font-weight: bold;
        font-size: 14px;
        line-height: 1;
    }
    .mobile-top-header .slogan-separator {
        color: var(--bs-blue);
        font-size: 12px;
    }
    .mobile-top-header .slogan-text {
        white-space: nowrap;
        line-height: 1;
    }

    /* 2. 移动端搜索+登录行 */
    .mobile-search-login {
        background: white;
        padding: 10px 15px;
        display: flex;
        align-items: center;
        gap: 10px;
        border-bottom: 1px solid #eee;
    }
    .mobile-search-login .search-wrap {
        flex: 1;
        position: relative;
    }
    #mobileSearchForm {
        width: 100%;
        position: relative;
    }
    .mobile-search-login .search-input {
        width: 100%;
        padding: 8px 12px 8px 35px;
        border: 2px solid var(--bs-orange);
        border-radius: 20px;
        font-size: 14px;
        box-sizing: border-box;
        outline: none;
    }
    .mobile-search-login .search-icon {
        position: absolute;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
        width: 20px;
        height: 20px;
        filter: brightness(0) saturate(100%) invert(0%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(100%) contrast(100%);
        pointer-events: none;
    }
    #mobileSearchForm button {
        position: absolute;
        right: 8px;
        top: 50%;
        transform: translateY(-50%);
        background: transparent;
        border: none;
        color: var(--bs-orange);
        font-size: 14px;
        padding: 4px 8px;
        cursor: pointer;
        opacity: 0;
        z-index: 1;
    }
    .mobile-search-login .login-btn {
        flex-shrink: 0;
        color: var(--gold-color);
        font-weight: 500;
        text-decoration: none;
        font-size: 14px;
        white-space: nowrap;
    }

    /* 3. 移动端功能图标栏（适配你的3个按钮：快速求购/交易大厅/供求大厅） */
    .mobile-function-bar {
        background: white;
        padding: 15px 0;
        display: flex;
        justify-content: space-around;
    }
    .mobile-function-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 5px;
        color: #333;
        text-decoration: none;
        font-size: 12px;
    }
    .mobile-function-item img {
        width: 28px;
        height: 28px;
        /* 统一图标颜色为#1296db */
        filter: invert(40%) sepia(89%) saturate(1260%) hue-rotate(182deg) brightness(94%) contrast(92%);
    }
}

/* ========== 非移动端隐藏移动端元素 ========== */
@media (min-width: 768px) {
    .mobile-top-header,
    .mobile-search-login,
    .mobile-function-bar {
        display: none !important;
    }
    /* 快捷区域轮播广告双端高度适配：PC端(lg≥768px)42%高度，移动端自适应+最小120px */
    .carousel-card-custom {
        height: 44% !important; /* !important 确保覆盖行内的height:auto，优先级足够 */
        min-height: unset !important; /* 取消PC端的最小高度180px，仅保留42%固定高度 */
    }
}