/* 页面总布局优化 */
.page-layout {
    display: flex;
    gap: 30px;
    max-width: 2000px;
    margin: 80px auto 0; /* 减小顶部间距 */
    padding: 0 2%;
}

/* 左侧目录样式 */
.sidebar {
    position: sticky;
    top: 100px;
    width: 200px; /* 稍微减小侧边栏宽度 */
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    height: fit-content;
    flex-shrink: 0; /* 防止侧边栏被压缩 */
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin-bottom: 10px;
}

.nav-link {
    display: block;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    color: #666;
    transition: background 0.3s ease;
    position: relative;
    padding-right: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover {
    background: #f5f5f7;
    color: #333;
}

.nav-link.active {
    background: #2997ff;
    color: #fff;
    box-shadow: 0 4px 12px rgba(41, 151, 255, 0.3);
}

/* 子菜单样式 */
.subnav-list {
    list-style: none;
    margin: 0;
    padding-left: 15px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item.active > .subnav-list {
    max-height: 500px; /* 足够大的值以容纳内容 */
    margin-top: 8px;
    margin-bottom: 8px;
}

.subnav-list a {
    display: block;
    padding: 8px 10px 8px 15px;
    border-radius: 6px;
    text-decoration: none;
    color: #777;
    font-size: 14px;
    position: relative;
    transition: all 0.3s ease;
    border-left: 2px solid transparent;
}

.subnav-list a:hover {
    background: rgba(230, 0, 18, 0.05);
    color: #e60012;
}

.subnav-list a.active {
    background: rgba(230, 0, 18, 0.1);
    color: #e60012;
    font-weight: 500;
    border-left: 2px solid #e60012;
}

/* 滚动监听高亮效果 */
.subnav-list a.scroll-active {
    background: rgba(230, 0, 18, 0.08);
    color: #e60012;
    border-left: 2px solid #e60012;
    animation: pulse 1.5s infinite;
}

/* 移动设备不显示子菜单 */
@media (max-width: 1500px) {
    .subnav-list {
        display: none;
    }
    
    .nav-item.active > .subnav-list {
        max-height: 0;
        margin: 0;
    }
    
    /* 确保移动设备上父级菜单项始终可点击 */
    .nav-link {
        pointer-events: auto;
    }
}

@keyframes pulse {
    0% { background: rgba(230, 0, 18, 0.05); }
    50% { background: rgba(230, 0, 18, 0.15); }
    100% { background: rgba(230, 0, 18, 0.05); }
}

/* 滚动到视图时的视觉反馈 */
.nav-item.in-viewport > .nav-link {
    color: #e60012;
    font-weight: 500;
    background: rgba(230, 0, 18, 0.05);
    transform: translateX(3px);
}

/* 添加滑动指示器 */
.nav-indicator {
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: #333;
    transform: scaleY(0);
    transition: transform 0.3s ease;
    transform-origin: top;
}

.subnav-list a.active .nav-indicator {
    transform: scaleY(1);
}

/* 父级菜单项展开状态优化 */
.nav-item.active > .nav-link {
    font-weight: 500;
    position: relative;
    overflow: hidden;
    color: #e60012;
    background: rgba(230, 0, 18, 0.05);
}

/* 添加父级激活指示器 */
.nav-item.active > .nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: #333;
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 无子菜单时的父级高亮效果 */
.nav-item:not(:has(.subnav-list)) > .nav-link.active {
    background: #333;
    color: #fff;
    font-weight: 500;
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* 动画效果 */


/* 动态高亮过渡效果 */
.nav-link, .subnav-list a {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 产品容器样式优化 */
.product-container {
    flex: 1;
    min-width: 0; /* 防止溢出 */
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 5px; /* 减小产品类别之间的间距 */
}

.product-category {
    margin-bottom: 0px; /* 减小底部间距 */
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    overflow: hidden;
    padding-bottom: 5px; /* 减小底部内边距 */
    display: flex;
    flex-direction: column;
    gap: 5px; /* 减小间距 */
}

/* 产品卡片网格布局 */
.product-pair {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0px;
    padding: 10px; /* 减小内边距 */
    width: calc(50% - 10px);
    float: left;
    margin: 0;
    margin-bottom: 10px; /* 减小底部间距 */
}

/* 创建pair容器 */
.pairs-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 20px;
    width: 100%;
}

/* 清除浮动 */
.pairs-container::after {
    content: '';
    display: table;
    clear: both;
}

/* 类别标题样式 */
.category-header {
    padding: 15px 25px; /* 减小内边距 */
    background: linear-gradient(to right, #e60012, #ff4d4d);
    border-bottom: none;
    height: 20px; /* 固定高度 */
    display: flex;
    align-items: center;
}

.category-title {
    font-size: 18px; /* 减小字体大小 */
    color: #fff;
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.3px;
    line-height: 1;
}

/* 选择器容器样式 */
.selectors-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
    min-height: auto;
}

/* 产品类型选择器 */
.type-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    padding: 3px;
    background: #f5f5f7;
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.type-option {
    flex: 1;
    padding: 6px 12px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #1d1d1f;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    font-weight: 500;
}

.type-option.active {
    background: #e60012;
    color: #fff;
    box-shadow: 0 4px 12px rgba(230, 0, 18, 0.3);
}

/* 芯数选择器 */
.pin-selector {
    position: relative;
    width: 100%;
    margin: 15px 0;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.pin-selector select {
    appearance: none;
    width: 100%;
    padding: 12px 15px;
    background: #f5f5f7;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pin-selector select:focus {
    outline: none;
    border-color: #e60012;
    box-shadow: 0 0 0 2px rgba(230, 0, 18, 0.1);
}

.pin-option {
    padding: 10px 18px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.8);
    color: #1d1d1f;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.pin-option:hover {
    background: rgba(41, 151, 255, 0.1);
    border-color: #2997ff;
}

.pin-option.active {
    background: #e60012;
    color: #fff;
    border-color: #e60012;
    box-shadow: 0 4px 12px rgba(230, 0, 18, 0.3);
}

/* 规格网格样式 */
.specs-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 10px;
    min-height: 0;
    margin-bottom: 20px;
    opacity: 1 !important; /* 防止子元素闪烁 */
}

/* 产品图片样式 */
.product-image {
    width: 100%;
    height: 400px; /* 固定初始高度 */
    object-fit: contain; /* 保持图片比例 */
    background: linear-gradient(145deg, #fff, #fff8f8);
    padding: 10px;
    border-radius: 5px;
    margin-bottom: 5px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.1));
}

/* 展开状态下的图片样式 */


/* 添加图片加载状态 */
.product-image.loading {
    position: relative;
    min-height: 200px;
    background: linear-gradient(145deg, #f5f5f5, #fafafa);
}

.product-image.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    border: 3px solid #eee;
    border-top-color: #e60012;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 针对不同尺寸图片的优化 */
@media (min-width: 1200px) {
    .product-image {
        height: 320px;
    }
    
    .product-card.expanded .product-image {
        height: 450px;
    }
}

@media (max-width: 768px) {
    .product-image {
        height: 240px;
    }
    
    .product-card.expanded .product-image {
        height: 350px;
    }
}

/* 连接箭头样式 */
.connection-arrow {
    display: none;
    align-items: center;
    justify-content: center;
    color: #2997ff;
    font-size: 28px;
    text-shadow: 0 0 15px rgba(41, 151, 255, 0.4);
}

/* 规格项样式 */
.spec-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.02);
    transition: all 0.3s ease;
    min-height: auto;
    margin-bottom: 8px;
    border-left: 2px solid transparent;
}

.spec-item:nth-child(6n+1) {
    background: linear-gradient(145deg, #fff, #fff8f8);
    border-left-color: #e60012;
}

.spec-item:nth-child(6n+2) {
    background: linear-gradient(145deg, #fff, #f0f7ff);
    border-left-color: #0066cc;
}

.spec-item:nth-child(6n+3) {
    background: linear-gradient(145deg, #fff, #f8fff8);
    border-left-color: #34c759;
}

.spec-item:nth-child(6n+4) {
    background: linear-gradient(145deg, #fff, #fff0f8);
    border-left-color: #af52de;
}

.spec-item:nth-child(6n+5) {
    background: linear-gradient(145deg, #fff, #fff8f0);
    border-left-color: #ff9500;
}

.spec-item:nth-child(6n+6) {
    background: linear-gradient(145deg, #fff, #f8f0ff);
    border-left-color: #5856d6;
}

.spec-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.spec-label {
    font-size: 12px;
    color: #666;
    flex: 1;
    margin-bottom: 0;
}

.spec-value {
    font-size: 12px;
    color: #333;
    font-weight: 500;
    text-align: right;
}

/* 范围规格样式 */
.range-spec {
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", sans-serif;
}

.range-icon {
    color: #0066cc;
    font-size: 16px;
    font-weight: normal;
}

/* 五金排列图容器样式 */
.pin-layout-container {
    margin-top: 10px;
    text-align: center;
}

.pin-layout-image {
    max-width: 200px;
    width: 100%;
    height: auto;
    margin-top: 10px;
    border-radius: 8px;
    transition: transform 0.3s ease;
    max-height: 100px;
}

.pin-layout-image:hover {
    transform: scale(1.05);
}

/* 添加以下样式 */
.product-card {
    min-height: 0; /* 设置最小高度防止闪烁 */
    transition: opacity 0.5s ease, transform 0.3s ease;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
    padding: 25px; /* 增加内边距 */
    margin-bottom: 20px;
    will-change: opacity; /* 优化性能 */
    opacity: 1;
    animation: fadeIn 0.5s ease-out;
    height: var(--card-height);
    max-height: var(--card-height);
    overflow-y: auto;
    border-radius: 16px;
    max-height: 600px;
    overflow-y: auto;
    min-width: 200px; /* 减小最小宽度 */
    max-width: none;
    margin: 0;
    background: linear-gradient(145deg, #ffffff, #fafbfc);
    border: 1px solid rgba(0, 0, 0, 0.08);
    position: relative;
    scrollbar-gutter: stable;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(230, 0, 18, 0.1);
}

.product-card.loaded {
    opacity: 1;
}

.product-card.loading {
    opacity: 0.6;
}

.product-card:nth-child(8n+1) {
    background: linear-gradient(145deg, #fff, #fff8f8);
    border-top: 3px solid #e60012;
}

.product-card:nth-child(8n+2) {
    background: linear-gradient(145deg, #fff, #f0f7ff);
    border-top: 3px solid #0066cc;
}

.product-card:nth-child(8n+3) {
    background: linear-gradient(145deg, #fff, #f8fff8);
    border-top: 3px solid #34c759;
}

.product-card:nth-child(8n+4) {
    background: linear-gradient(145deg, #fff, #fff0f8);
    border-top: 3px solid #af52de;
}

.product-card:nth-child(8n+5) {
    background: linear-gradient(145deg, #fff, #fff8f0);
    border-top: 3px solid #ff9500;
}

.product-card:nth-child(8n+6) {
    background: linear-gradient(145deg, #fff, #f8f0ff);
    border-top: 3px solid #5856d6;
}

.specs-container {
    min-height: 0;
    opacity: 1 !important; /* 防止子元素闪烁 */
    backdrop-filter: blur(10px);
    border-radius: 15px;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 15px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.02);
}

/* 添加数学符号的特殊样式 */
.range-spec span:not(.range-icon) {
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 14px;
}

/* 响应式适配 */
@media (max-width: 1024px) {
    .specs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .product-pair {
        grid-template-columns: 1fr;
    }
    .connection-arrow {
        display: none;
    }
    .product-card {
        min-width: auto;
    }
}

/* 更新页面背景 */
body {
    background: linear-gradient(135deg, 
        #f5f5f5 0%,
        #ffffff 50%,
        #f8f8f8 100%
    );
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(230, 0, 18, 0.05);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: rgba(230, 0, 18, 0.2);
    border-radius: 3px;
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(230, 0, 18, 0.3);
}

/* 优化产品展示布局 */
.product-pair {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 固定为4列 */
    gap: 20px;
    padding: 20px;
    margin: 0 auto;
    width: 100%;
}

/* 隐藏连接箭头 */
.connection-arrow {
    display: none;
}

/* 产品卡片样式优化 */
.product-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    transition: all 0.3s ease;
    height: fit-content;
    min-height: 0;
    min-width: 250px; /* 减小最小宽度 */
    max-width: none;
    height: 30vh;
    max-height: 30vh;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative; /* 确保相对定位 */
    scrollbar-gutter: stable; /* 保持滚动条空间 */
    scrollbar-width: thin; /* Firefox 滚动条 */
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(230, 0, 18, 0.1);
}

.product-card.loaded {
    opacity: 1;
}

.product-card.loading {
    opacity: 0.6;
}

.product-card:nth-child(8n+1) {
    background: linear-gradient(145deg, #fff, #fff8f8);
    border-top: 3px solid #e60012;
}

.product-card:nth-child(8n+2) {
    background: linear-gradient(145deg, #fff, #f0f7ff);
    border-top: 3px solid #0066cc;
}

.product-card:nth-child(8n+3) {
    background: linear-gradient(145deg, #fff, #f8fff8);
    border-top: 3px solid #34c759;
}

.product-card:nth-child(8n+4) {
    background: linear-gradient(145deg, #fff, #fff0f8);
    border-top: 3px solid #af52de;
}

.product-card:nth-child(4n+1) {
    background: linear-gradient(145deg, #ffffff, #f9f9f9);
    border-top: 3px solid #c7000b;
}

.product-card:nth-child(4n+2) {
    background: linear-gradient(145deg, #ffffff, #f5f7fa);
    border-top: 3px solid #0057d0;
}

.product-card:nth-child(4n+3) {
    background: linear-gradient(145deg, #ffffff, #f7f9fc);
    border-top: 3px solid #007878;
}

.product-card:nth-child(4n+4) {
    background: linear-gradient(145deg, #ffffff, #fafafa);
    border-top: 3px solid #cf000f;
}

/* 产品图片容器 */
.product-image {
    height: 180px; /* 增加图片高度 */
    object-fit: contain;
    margin-bottom: 20px;
}

/* 规格列表样式优化 */
.specs-container {
    min-height: 0;
}

.specs-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
    min-height: 0;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.02);
    transition: all 0.3s ease;
    background: #f9f9f9;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 8px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    background: linear-gradient(145deg, #ffffff, #f5f7fa);
    position: relative;
    overflow: hidden;
}

.spec-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: rgba(230, 0, 18, 0.2);
    box-shadow: 0 4px 15px rgba(230, 0, 18, 0.08);
    border-color: rgba(230, 0, 18, 0.15);
}

.spec-label {
    font-size: 12px;
    color: #666;
    flex: 1;
    margin-bottom: 0;
    font-size: 13px;
    color: #666;
    font-weight: 500;
    position: relative;
    padding-left: 12px;
}

.spec-value {
    font-size: 12px;
    color: #333;
    font-weight: 500;
    text-align: right;
    font-size: 13px;
    color: #333;
    font-weight: 600;
    position: relative;
    padding-right: 15px;
}

.spec-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transform: skewX(-25deg);
    transition: all 0.3s ease;
}

.spec-item:hover::before {
    left: 150%;
    transition: 0.5s ease-in-out;
}

/* 自定义数字选择器 */
.pin-selector {
    position: relative;
    width: 100%;
    margin: 15px 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* 将按钮改为下拉选择器 */
.pin-selector select {
    appearance: none;
    width: 100%;
    padding: 12px 15px;
    background: #f5f5f7;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pin-selector select:focus {
    outline: none;
    border-color: #e60012;
    box-shadow: 0 0 0 2px rgba(230, 0, 18, 0.1);
}

.pin-option {
    padding: 10px 18px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.8);
    color: #1d1d1f;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #fff;
    transition: all 0.3s ease;
}

.pin-option:hover {
    /* background: rgba(41, 151, 255, 0.1);
    border-color: #2997ff; */
    background: rgba(230, 0, 18, 0.05);
    border-color: #e60012;
}

.pin-option.active {
    background: #e60012;
    color: #fff;
    border-color: #e60012;
    box-shadow: 0 4px 12px rgba(230, 0, 18, 0.3);
    background: #e60012;
    color: #fff;
    border-color: #e60012;
    box-shadow: 0 2px 8px rgba(230, 0, 18, 0.25);
}

/* 类型选择器优化 */
.type-selector {
    background: #f5f5f7;
    border-radius: 8px;
    padding: 4px;
    background: #f5f5f5;
    padding: 4px;
    border-radius: 10px;
}

.type-option {
    padding: 8px 16px;
    font-size: 13px;
    border-radius: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.type-option.active {
    background: #e60012;
    color: #fff;
    background: #e60012;
    color: #fff;
    box-shadow: 0 2px 8px rgba(230, 0, 18, 0.25);
}

/* 响应式布局优化 */
@media (min-width: 1921px) {
    .product-pair {
        grid-template-columns: repeat(4, 1fr);
        max-width: 2000px;
    }
}

@media (max-width: 1920px) {
    .product-pair {
        grid-template-columns: repeat(4, 1fr);
        max-width: 1800px;
    }
}

@media (max-width: 1600px) {
    .product-pair {
        grid-template-columns: repeat(3, 1fr);
        width: 100%;
    }
}

@media (max-width: 1400px) {
    .product-pair {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .product-pair {
        grid-template-columns: 1fr;
    }
    .product-card {
        min-width: auto;
    }
}

/* 卡片内容布局优化 */
.product-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
    position: relative;
}

.product-title {
    font-size: 18px;
    margin: 0;
    color: #333;
}

/* 添加阴影效果 */
.product-card {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(230, 0, 18, 0.1);
}

.product-card:hover {
    transform: translateY(-5px) scale(1.01);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

/* 优化选择器容器 */
.selectors-container {
    min-height: auto;
    gap: 10px;
}

/* 添加科技感动画 */

.product-card {
    animation: fadeIn 0.5s ease-out;
}

/* 确保页面背景与设计协调 */
body {
    background: linear-gradient(135deg, 
        #f5f5f5 0%,
        #ffffff 50%,
        #f8f8f8 100%
    );
}

/* 响应式布局调整 */
@media (min-width: 1600px) {
    .product-pair {
        max-width: 1600px;
    }
}

/* 响应式布局强制4列 */
@media (min-width: 1400px) {
    .product-pair {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* 当屏幕太窄时才降级到更少的列数 */
@media (max-width: 1399px) {
    .product-pair {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1100px) {
    .product-pair {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .product-pair {
        grid-template-columns: 1fr;
    }
}

/* 卡片高度变量（可调整） */
:root {
    --card-height: 2vh; /* 这里可以调整卡片高度比例，范围20%~30% */
}

/* 优化滚动条样式 */
.product-card::-webkit-scrollbar {
    width: 6px;
    width: 4px;
    height: 6px;
    display: block; /* 确保显示 */
}

.product-card::-webkit-scrollbar-track {
    background: rgba(230, 0, 18, 0.05);
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 2px;
    margin: 4px;
}

.product-card::-webkit-scrollbar-thumb {
    background: rgba(230, 0, 18, 0.2);
    border-radius: 3px;
    transition: all 0.3s ease;
    background: rgba(230, 0, 18, 0.15);
    border-radius: 2px;
    transition: all 0.3s ease;
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.2) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.2) 50%,
        rgba(255, 255, 255, 0.2) 75%,
        transparent 75%,
        transparent
    );
    background-size: 12px 12px;
}


/* 类别标题样式优化 */
.category-header {
    padding: 15px 25px; /* 减小内边距 */
    background: linear-gradient(to right, #e60012, #ff4d4d);
    border-bottom: none;
    height: 20px; /* 固定高度 */
    display: flex;
    align-items: center;
    background: linear-gradient(to right, #c7000b, #e60012);
    padding: 12px 20px;
    height: auto;
    min-height: 30px;
}

.category-title {
    font-size: 18px; /* 减小字体大小 */
    color: #fff;
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.3px;
    line-height: 1;
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    letter-spacing: 0.5px;
}


.spec-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        45deg,
        transparent 0%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 100%
    );
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}


/* 滚动提示动画 */
.product-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(
        to bottom,
        transparent,
        rgba(255, 255, 255, 0.9)
    );
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: pulseGradient 2s infinite;
}

.product-card:not(:hover)::after {
    opacity: 1;
}

@keyframes pulseGradient {
    0% { opacity: 0.6; }
    50% { opacity: 0.9; }
    100% { opacity: 0.6; }
}

/* 添加内容滚动提示 */
.scroll-indicator {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 30px;
    border: 2px solid rgba(230, 0, 18, 0.2);
    border-radius: 10px;
    opacity: 0.8;
    pointer-events: none;
}

.scroll-indicator::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 50%;
    width: 4px;
    height: 4px;
    background: rgba(230, 0, 18, 0.4);
    border-radius: 50%;
    transform: translateX(-50%);
    animation: scrollIndicate 1.5s infinite;
}

@keyframes scrollIndicate {
    0% { transform: translate(-50%, 0); opacity: 1; }
    100% { transform: translate(-50%, 10px); opacity: 0; }
}

/* 添加阅读进度指示器 */
.scroll-progress {
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: rgba(230, 0, 18, 0.1);
    border-radius: 2px;
}

.scroll-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--scroll-percent, 0%);
    background: #e60012;
    border-radius: 2px;
    transition: height 0.1s ease;
}

/* 导航控制按钮样式 */
.nav-controls {
    position: relative;
    padding: 8px;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: flex-end;
    padding: 12px 15px;
    margin: -10px -15px 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-radius: 15px 15px 0 0;
}

.nav-control-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    background: rgba(230, 0, 18, 0.05);
    color: #666;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-control-btn:hover {
    background: rgba(230, 0, 18, 0.05);
    color: #e60012;
    background: rgba(230, 0, 18, 0.1);
    color: #e60012;
}

.nav-icon {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-control-btn.expanded .nav-icon {
    transform: rotate(180deg);
}

.nav-control-text {
    font-weight: 500;
    font-size: 13px;
}

/* 添加展开/收起动画 */


/* 优化子菜单过渡效果 */
.subnav-list {
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 0;
    opacity: 0;
}

.nav-item.active > .subnav-list {
    opacity: 1;
}

/* 产品卡片展开状态 */
.product-card.expanded {
    position: fixed; /* Fixed position to center on screen */
    top: 10vh; /* Position at 10% from top of viewport */
    left: 20%;
    width: 30%;
    max-width: 900px;
    height: 85vh;
    max-height: 85vh;
    z-index: 100;
    overflow-y: auto; /* Enable vertical scrolling */
    overflow-x: hidden; /* Prevent horizontal scrolling */
    background: #fff;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 25px;
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    margin: 0; /* Remove margin since it's fixed positioned */
    scroll-padding-bottom: 20px; /* Better scrolling experience */
    animation: slideDownIn 0.4s forwards;
}

@keyframes slideDownIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    .product-card.expanded {
        width: 30%;
        height: 88vh;
        top: 6vh;
        padding: 15px;
    }
    
    .product-card.expanded .product-image {
        height: 180px;
    }
}

@media (max-width: 480px) {
    .product-card.expanded {
        width: 96%;
        height: 90vh;
        top: 5vh;
        padding: 12px;
        border-radius: 12px;
    }
}

/* 关闭按钮样式简化 */
.close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: rgba(230, 0, 18, 0.1);
    color: #e60012;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transform: scale(1);
}

/* 简化遮罩效果 */


/* 展开时的内容样式简化 */
.product-card.expanded .product-image {
    height: 220px;
    margin-bottom: 20px;
}

.product-card.expanded .specs-container {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 12px;
}

/* 页面遮罩 */


/* 关闭按钮 */
.close-button {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(230, 0, 18, 0.1);
    color: #e60012;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: scale(0.8);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(230, 0, 18, 0.2);
}

.close-button:hover {
    background: rgba(230, 0, 18, 0.2);
    transform: scale(1.1);
}

.close-button::before,
.close-button::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 2px;
    background: currentColor;
    transform-origin: center;
    transition: transform 0.3s ease;
}

.close-button::before {
    transform: rotate(45deg);
}

.close-button::after {
    transform: rotate(-45deg);
}

.product-card.expanded .close-button {
    opacity: 1;
    transform: scale(1);
    transition-delay: 0.3s;
}

/* 展开时的内容样式 */
.product-card.expanded .product-image {
    height: 250px;
    margin-bottom: 30px;
}

.product-card.expanded .specs-container {
    padding: 25px;
    background: linear-gradient(145deg, #fff, #f8f9fa);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

/* 动画效果 */


.product-card.expanded {
    animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 其他卡片虚化效果 */
.product-card:not(.expanded) {
    transition: filter 0.3s ease, transform 0.3s ease;
}

body.has-expanded-card .product-card:not(.expanded) {
    filter: blur(4px) grayscale(50%);
    pointer-events: none;
}

/* 产品卡片中的图片容器 */
.product-image-container {
    width: 100%;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #fff, #f8f8f8);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 产品图片基础样式 */
.product-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 展开状态的图片容器 */
.product-card.expanded .product-image-container {
    height: 500px;  /* 展开后的图片容器高度 */
    margin: 20px 0 30px;
    padding: 20px;
    background: linear-gradient(145deg, #fff, #fafafa);
}

/* 展开状态的图片 */
.product-card.expanded .product-image {
    max-height: 460px;  /* 给padding留出空间 */
    width: auto;
    height: auto;
}



/* 添加命名空间，避免与主菜单冲突 */
.products-specs-section {
    width: 100%;
    box-sizing: border-box;
}

/* 页面总布局优化 */
.page-layout {
    display: flex;
    gap: 30px;
    max-width: 2000px;
    margin: 80px auto 0; 
    padding: 0 2%;
}

/* 左侧目录样式 */
.sidebar {
    position: sticky;
    top: 100px;
    width: 200px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    height: fit-content;
    flex-shrink: 0;
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin-bottom: 10px;
}

.nav-link {
    display: block;
    padding: 10px;
    border-radius: 8px;
    text-decoration: none;
    color: #666;
    transition: background 0.3s ease;
    position: relative;
    padding-right: 24px;
}

.nav-link:hover {
    background: #f5f5f7;
    color: #333;
}

.nav-link.active {
    background: #2997ff;
    color: #fff;
    box-shadow: 0 4px 12px rgba(41, 151, 255, 0.3);
}

/* 子菜单样式优化 */


.nav-item.active > .subnav-list {
    max-height: 500px;
    margin-top: 8px;
    margin-bottom: 8px;
}

.subnav-list a {
    display: block;
    padding: 8px 10px 8px 15px;
    border-radius: 6px;
    text-decoration: none;
    color: #777;
    font-size: 14px;
    position: relative;
    transition: all 0.3s ease;
    border-left: 2px solid transparent;
}

.subnav-list a:hover {
    background: rgba(230, 0, 18, 0.05);
    color: #e60012;
}

.subnav-list a.active {
    background: rgba(230, 0, 18, 0.1);
    color: #e60012;
    font-weight: 500;
    border-left: 2px solid #e60012;
}

/* 父级菜单项展开状态优化 */
.nav-item.active > .nav-link {
    font-weight: 500;
    position: relative;
    overflow: hidden;
    color: #e60012;
    background: rgba(230, 0, 18, 0.05);
}

/* 产品容器样式优化 */
.product-container {
    flex: 1;
    min-width: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.product-category {
    margin-bottom: 20px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    overflow: hidden;
}

/* 产品卡片网格布局 - 简化版 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
}

/* 类别标题样式 */
.category-header {
    padding: 15px 20px;
    background: linear-gradient(to right, #c7000b, #e60012);
    border-bottom: none;
    display: flex;
    align-items: center;
}

.category-title {
    font-size: 16px;
    color: #fff;
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* 产品卡片样式 - 简化版 */
.product-card {
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(230, 0, 18, 0.1);
}

/* 产品图片容器 */
.product-image {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    padding: 10px;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* 规格列表样式 - 更精简版 */
.specs-container {
    flex: 1;
}

.specs-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.spec-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
    background: #f9f9f9;
    border-radius: 6px;
    border-left: 2px solid #e60012;
}

.spec-label {
    font-size: 13px;
    color: #666;
    flex: 1;
}

.spec-value {
    font-size: 13px;
    color: #333;
    font-weight: 500;
}

/* 过滤和选择器样式 */
.selectors-container {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    background: #f9f9f9;
}

.type-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.type-option {
    padding: 8px 16px;
    border-radius: 20px;
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s ease;
}

.type-option.active {
    background: #e60012;
    color: #fff;
    border-color: #e60012;
}

/* 自定义滚动条 - 简化版 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* 响应式布局 - 优化移动端 */
@media (max-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .page-layout {
        display: block;
        padding: 0 10px;
    }
    
    /* 在移动端隐藏侧边栏 */
    .sidebar {
        display: none;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
        padding: 15px;
    }
    
    .product-card {
        padding: 12px;
    }
    
    .product-image {
        height: 150px;
    }
    
    .category-header {
        padding: 12px 15px;
    }
    
    .category-title {
        font-size: 15px;
    }
    
    .spec-item {
        padding: 8px 10px;
    }
    
    .spec-label, .spec-value {
        font-size: 12px;
    }
    
    .selectors-container {
        padding: 12px 15px;
    }
    
    .type-option {
        padding: 6px 12px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .page-layout {
        margin-top: 60px;
    }
}

/* 移除部分复杂动画和冗余效果，简化UI */