/* 产品列表页面样式 - PC版本大气设计 */

/* CSS变量定义 */
:root {
    --primary-color: #050816;
    --accent-color: #4d9eff;
    --text-primary: #ffffff;
    --text-secondary: #c0c8e7;
    --text-muted: #8a94a6;
    --border-color: #1a2332;
    --card-bg: #0a0f1a;
    --card-hover-bg: #111827;
    --gradient-primary: linear-gradient(135deg, #4d9eff 0%, #6bb6ff 100%);
    --gradient-secondary: linear-gradient(135deg, #1a2332 0%, #2d3748 100%);
    --shadow-primary: 0 8px 32px rgba(77, 158, 255, 0.15);
    --shadow-secondary: 0 4px 20px rgba(0, 0, 0, 0.3);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 页面整体布局 */
.product-section {
    background: var(--primary-color);
    min-height: 100vh;
    padding: 120px 0 40px; /* 增加顶部内边距，避免导航栏遮挡 */
    position: relative;
    z-index: 1; /* 确保内容在正确的层级 */
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 2; /* 内容容器层级 */
}

/* 移除面包屑导航相关样式 */
/* 为移除的面包屑保留空间 */
.product-section {
    background: var(--primary-color);
    min-height: 100vh;
    padding: 120px 0 40px; /* 增加顶部内边距，避免导航栏遮挡 */
    position: relative;
    z-index: 1; /* 确保内容在正确的层级 */
}

/* 主要内容区域 */
.main-content {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: start;
    position: relative;
    z-index: 2; /* 主内容层级 */
}

/* 分类侧边栏 */
.category-sidebar {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow-secondary);
    position: sticky;
    top: 20px;
    position: relative;
    z-index: 2; /* 侧边栏层级 */
}

.category-header {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
    z-index: 2; /* 分类头部层级 */
}

.category-header h3 {
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 2; /* 分类标题层级 */
}

.category-header h3 i {
    color: var(--accent-color);
    font-size: 18px;
    position: relative;
    z-index: 2; /* 分类图标层级 */
}

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

.category-menu li {
    margin-bottom: 8px;
    position: relative;
}

.category-menu li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    min-height: 50px; /* 确保所有菜单项高度一致 */
    box-sizing: border-box; /* 确保padding不会影响整体尺寸 */
    font-weight: 500; /* 新增：统一所有状态下的字体粗细 */
}

.category-menu li a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    opacity: 0;
    transition: var(--transition);
    z-index: -1;
}

.category-menu li a:hover,
.category-menu li.active a {
    color: var(--text-primary);
    background: var(--card-hover-bg);
}

.category-menu li a:hover::before,
.category-menu li.active a::before {
    opacity: 0.1;
}

.category-menu .category-title {
    display: flex;
    align-items: center;
    gap: 8px; /* 使用gap属性来设置图标和文字的间距 */
}

.category-menu .category-title i {
    font-size: 14px;
    transition: color 0.3s ease;
}

.category-menu li a:hover .category-title i,
.category-menu li.active a .category-title i {
    color: var(--accent-color);
}

.category-count {
    background: var(--accent-color);
    color: var(--text-primary);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    min-width: 20px;
    text-align: center;
    flex-shrink: 0; /* 防止被压缩 */
    align-self: center; /* 垂直居中对齐 */
}

/* 产品内容区域 */
.product-content {
    position: relative;
    z-index: 2; /* 产品内容层级 */
}

/* 产品筛选器 */
.product-filter {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-secondary);
    position: relative;
    z-index: 2; /* 筛选器层级 */
}

.filter-header {
    margin-bottom: 20px;
    position: relative;
    z-index: 2; /* 筛选器头部层级 */
}

.filter-title {
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    z-index: 2; /* 筛选器标题层级 */
}

.filter-title i {
    color: var(--accent-color);
    font-size: 22px;
    animation: glow 2s ease-in-out infinite alternate;
    position: relative;
    z-index: 2; /* 筛选器图标层级 */
}

.filter-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin: 10px 0 0 0;
    line-height: 1.6;
    position: relative;
    z-index: 2; /* 筛选器副标题层级 */
}

/* 移除筛选按钮样式 */

/* 产品网格 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
    position: relative;
    z-index: 2; /* 产品网格层级 */
}

/* 当产品网格包含加载、错误或空状态时，覆盖网格布局 */
.product-grid:has(.loading-container),
.product-grid:has(.error-container),
.product-grid:has(.empty-container) {
    display: block !important;
    grid-template-columns: unset !important;
    gap: 0 !important;
}

/* 单个产品时的特殊布局 */
/* 单个产品布局 - 修复居中问题 */
.product-grid.single-product {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    justify-content: start;
}

.product-grid.single-product .product-item {
    max-width: none;
    margin: 0;
}

/* 确保单个产品不会占用过多空间 */
.product-grid:has(.product-item:only-child) {
    grid-template-columns: repeat(auto-fit, minmax(320px, 400px));
    justify-content: start;
}

/* 当只有一个产品时，限制最大宽度 */
.product-grid:has(.product-item:only-child) .product-item {
    max-width: 400px;
    margin: 0;
}

/* 产品卡片 */
.product-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-secondary);
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    z-index: 2; /* 产品卡片层级 */
}

.product-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-primary);
    border-color: var(--accent-color);
    z-index: 3; /* 悬停时提升层级 */
}

.product-item a {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    z-index: 2; /* 产品链接层级 */
}

.product-image {
    position: relative;
    overflow: hidden;
    height: 250px;
    background: var(--card-bg);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.product-item:hover .product-image img {
    transform: scale(1.05);
}

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(77, 158, 255, 0.9) 0%, rgba(107, 182, 255, 0.9) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.product-item:hover .product-overlay {
    opacity: 1;
}

.product-overlay i {
    color: var(--text-primary);
    font-size: 48px;
    animation: pulse 2s infinite;
}

.product-content {
    padding: 25px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-title {
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 15px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 50px;
}

.product-description {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 20px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.product-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.product-category {
    background: var(--gradient-primary);
    color: var(--text-primary);
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
}

.product-price {
    color: var(--accent-color);
    font-size: 16px;
    font-weight: 600;
}

.product-inquiry-btn {
    background: var(--accent-color);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    border: 1px solid transparent;
}

.product-inquiry-btn:hover {
    background: transparent;
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: scale(1.05);
}

/* 移除product-meta相关样式 */

/* 分页 */
.pagination-container {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 50px;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative;
    z-index: 2; /* 分页容器层级 */
}

.pagination {
    display: flex !important;
    align-items: center;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
    visibility: visible !important;
    opacity: 1 !important;
}

.page-item {
    position: relative;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: var(--card-hover-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    font-size: 16px;
}

.page-link i {
    font-size: 14px;
    color: inherit;
}

/* 图标备用方案 */
.icon-fallback {
    display: none;
    font-size: 18px;
    font-weight: bold;
    color: inherit;
}

/* 当Font Awesome图标不显示时，显示备用字符 */
.page-link:not(:has(i:not([style*="display: none"]))) .icon-fallback {
    display: inline-block;
}

/* 兼容性处理：如果Font Awesome图标不可见，显示备用字符 */
.page-link i[style*="display: none"],
.page-link i:not([class*="fa-"]),
.page-link:not(:has(i[class*="fa-"])) .icon-fallback {
    display: inline-block;
}

.page-link:hover,
.page-item.active .page-link {
    color: var(--text-primary);
    border-color: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: var(--shadow-primary);
}

.page-link:hover::before,
.page-item.active .page-link::before {
    opacity: 1;
}

.page-item.disabled .page-link {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
    color: rgba(192, 200, 231, 0.3);
}

.page-item.disabled .page-link:hover {
    transform: none;
    box-shadow: none;
}

.page-item.disabled .page-link::before {
    opacity: 0;
}

/* 分页信息样式 */
.pagination-container .text-center {
    text-align: center;
    margin-top: 0;
}

.pagination-container .text-muted {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.4;
}

/* 加载状态 */
.loading-container,
.error-container,
.empty-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    text-align: center;
    padding: 60px 20px;
    width: 100%;
    grid-column: 1 / -1; /* 让加载容器占满所有网格列 */
}

.empty-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 500px; /* 增加最小高度，让空状态更居中 */
    width: 100%;
    padding: 0; /* 移除内边距，让空状态完全居中 */
    grid-column: 1 / -1; /* 关键：让空容器占满所有网格列 */
}

/* 当空状态容器同时具有网格类时，覆盖网格布局 */
.empty-container.product-grid {
    display: flex !important;
    grid-template-columns: unset !important;
    gap: 0 !important;
    margin-bottom: 0 !important;
}

.loading-spinner {
    color: var(--accent-color);
    font-size: 18px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 80px 40px;
    background: linear-gradient(135deg, rgba(77, 158, 255, 0.05) 0%, rgba(160, 216, 255, 0.02) 100%);
    border-radius: 20px;
    border: 1px solid rgba(77, 158, 255, 0.1);
    margin: 40px auto; /* 使用auto居中 */
    position: relative;
    overflow: hidden;
    width: 100%; /* 使用100%宽度 */
    max-width: 600px; /* 限制最大宽度 */
    box-shadow: 0 8px 32px rgba(77, 158, 255, 0.1);
}

.loading-spinner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #4d9eff, transparent);
    animation: shimmer 2s ease-in-out infinite;
}

.loading-spinner::after {
    content: '';
    display: inline-block;
    width: 40px; /* 增大旋转器尺寸 */
    height: 40px;
    border: 4px solid rgba(77, 158, 255, 0.2);
    border-radius: 50%;
    border-top-color: #4d9eff;
    animation: spin 1s linear infinite;
    margin-right: 20px; /* 增加间距 */
}

.empty-state {
    text-align: center;
    padding: 100px 60px;
    background: linear-gradient(135deg, rgba(77, 158, 255, 0.05) 0%, rgba(160, 216, 255, 0.02) 100%);
    border-radius: 20px;
    border: 1px solid rgba(77, 158, 255, 0.1);
    margin: 0 auto; /* 使用auto居中 */
    position: relative;
    overflow: hidden;
    width: 100%; /* 使用100%宽度 */
    max-width: 600px; /* 限制最大宽度 */
    box-shadow: 0 8px 32px rgba(77, 158, 255, 0.1);
}

.empty-state::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px; /* 增加闪烁条高度 */
    background: linear-gradient(90deg, transparent, #4d9eff, transparent);
    animation: shimmer 2s ease-in-out infinite;
}

.empty-icon {
    margin-bottom: 32px; /* 增加图标下方间距 */
}

.empty-icon i {
    font-size: 80px; /* 增大图标尺寸 */
    color: var(--accent-color);
    opacity: 0.6;
    animation: float 3s ease-in-out infinite;
}

.empty-state h3 {
    font-size: 28px; /* 增大标题字体 */
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px; /* 增加标题下方间距 */
    background: linear-gradient(135deg, #4d9eff, #a0d8ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.empty-state p {
    font-size: 18px; /* 增大描述文字 */
    color: var(--text-secondary);
    margin-bottom: 0;
    line-height: 1.6;
    max-width: 500px; /* 增加描述文字最大宽度 */
    margin-left: auto;
    margin-right: auto;
}

.error {
    text-align: center;
    padding: 80px 40px;
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.05) 0%, rgba(255, 160, 160, 0.02) 100%);
    border-radius: 20px;
    border: 1px solid rgba(255, 107, 107, 0.1);
    margin: 40px 0;
    position: relative;
    overflow: hidden;
    min-width: 600px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 8px 32px rgba(255, 107, 107, 0.1);
}

.error::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #ff6b6b, transparent);
    animation: shimmer 2s ease-in-out infinite;
}

.error-icon {
    margin-bottom: 24px;
}

.error-icon i {
    font-size: 60px; /* 增大错误图标 */
    color: #ff6b6b;
    opacity: 0.8;
    animation: pulse 2s ease-in-out infinite;
}

.error h3 {
    font-size: 24px; /* 增大错误标题 */
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.error p {
    font-size: 18px; /* 增大错误描述 */
    color: var(--text-secondary);
    margin-bottom: 32px; /* 增加按钮上方间距 */
}

.retry-btn {
    background: linear-gradient(135deg, #4d9eff, #6babff);
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(77, 158, 255, 0.3);
}

.retry-btn:hover {
    background: linear-gradient(135deg, #6babff, #4d9eff);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(77, 158, 255, 0.5);
}

/* 动画效果 */
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scanline {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

@keyframes glow {
    0% { text-shadow: 0 0 5px var(--accent-color); }
    100% { text-shadow: 0 0 20px var(--accent-color), 0 0 30px var(--accent-color); }
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.8; }
    50% { transform: scale(1.1); opacity: 1; }
}

@keyframes shimmer {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 250px 1fr;
        gap: 30px;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }
    
    .product-grid.single-product {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        justify-content: start;
    }
    
    .product-image {
        height: 220px;
    }
    
    .product-content {
        padding: 20px;
    }
    
    .product-title {
        font-size: 16px;
    }
}

@media (max-width: 768px) {
    .product-section {
        padding: 30px 0 20px;
    }
    
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .category-sidebar {
        position: static;
        order: 2;
    }
    
    .product-content {
        order: 1;
        padding: 20px;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
    
    .product-grid.single-product {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        justify-content: start;
    }
    
    .product-image {
        height: 200px;
    }
    
    .product-content {
        padding: 15px;
    }
    
    .product-title {
        font-size: 15px;
        min-height: 44px;
    }
    
    .product-description {
        font-size: 13px;
        margin-bottom: 15px;
    }
    
    .product-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .product-grid.single-product {
        grid-template-columns: 1fr;
        justify-content: start;
    }
    
    .product-image {
        height: 180px;
    }
    
    .product-content {
        padding: 15px;
    }
    
    .product-title {
        font-size: 14px;
        min-height: 40px;
    }
    
    .product-description {
        font-size: 12px;
        margin-bottom: 12px;
    }
}

/* 空状态 - 美化版 */
.empty-container {
    text-align: center;
    padding: 80px 40px;
    color: var(--text-muted);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-secondary);
    margin: 20px 0;
    /* 居中显示 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    position: relative;
    overflow: hidden;
    z-index: 2; /* 空状态容器层级 */
}

.empty-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    animation: shimmer 2s ease-in-out infinite;
}

.empty-icon {
    font-size: 80px;
    margin-bottom: 30px;
    color: var(--accent-color);
    opacity: 0.6;
    animation: float 3s ease-in-out infinite;
}

.empty-container h3 {
    margin: 0 0 20px 0;
    color: var(--text-primary);
    font-size: 28px;
    font-weight: 600;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.empty-container p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.6;
    max-width: 500px;
}

/* 添加装饰元素 */
.empty-container::after {
    content: '';
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: 1px;
}


