/* 重置默认样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基础样式 */
body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #ffffff;
    padding-top: 80px; /* 为固定导航栏留出空间 */
}

/* 顶部导航栏 */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    box-shadow: 0 2px 20px rgba(22, 124, 248, 0.1);
    z-index: 1000;
    border-bottom: 1px solid rgba(22, 124, 248, 0.1);
}

.top-nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Logo和品牌 */
.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    display: flex;
    align-items: center;
}

.brand-text h1 {
    font-size: 1.4rem;
    color: #167cf8;
    margin: 0;
    font-weight: 700;
}

.brand-text span {
    font-size: 0.75rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: -2px;
    display: block;
}

/* 分类导航 */
.nav-categories {
    flex: 1;
    display: flex;
    justify-content: center;
    margin: 0 30px;
}

.category-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 30px;
}

.category-item {
    text-decoration: none;
    color: #666;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    white-space: nowrap;
}

.category-item:hover {
    color: #167cf8;
    background: rgba(22, 124, 248, 0.08);
}

.category-item.active {
    color: #ffffff;
    background: linear-gradient(135deg, #167cf8, #4a90e2);
    box-shadow: 0 4px 15px rgba(22, 124, 248, 0.3);
}

/* 搜索区域 */
.search-section {
    padding: 40px 0;
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    border-radius: 20px;
    margin-bottom: 40px;
    box-shadow: 0 4px 20px rgba(22, 124, 248, 0.05);
}

.search-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: 50px;
    padding: 0;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    box-shadow: 0 8px 30px rgba(22, 124, 248, 0.1);
    margin-bottom: 20px;
}

.search-box:focus-within {
    border-color: #167cf8;
    box-shadow: 0 8px 40px rgba(22, 124, 248, 0.2);
}

#search-input {
    border: none;
    background: transparent;
    padding: 16px 64px 16px 24px; /* 右边距留出搜索按钮的空间 */
    font-size: 1rem;
    color: #333;
    width: 100%;
    outline: none;
    border-radius: 50px;
}

#search-input::placeholder {
    color: #999;
    font-size: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-btn {
    background: linear-gradient(135deg, #167cf8, #4a90e2);
    border: none;
    color: #ffffff;
    padding: 12px;
    border-radius: 50%;
    cursor: pointer;
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    min-width: 44px;
    height: 44px;
}

.search-btn:hover {
    box-shadow: 0 4px 15px rgba(22, 124, 248, 0.3);
}

.search-stats {
    color: #666;
    font-size: 0.9rem;
    opacity: 0.8;
}

.search-stats strong {
    color: #167cf8;
    font-weight: 600;
}

/* 汉堡菜单按钮 */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: #167cf8;
    border-radius: 2px;
    transition: all 0.3s linear;
    position: relative;
    transform-origin: 1px;
}

.mobile-menu-toggle.active span:first-child {
    transform: rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(20px);
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, #167cf8 0%, #4a90e2 100%);
    color: #ffffff;
    padding: 60px 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(22, 124, 248, 0.2);
    position: relative;
    overflow: hidden;
}

/* 头部装饰圆形 */
header::before,
header::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    pointer-events: none;
}

header::before {
    width: 300px;
    height: 300px;
    top: -150px;
    right: -100px;
    animation: float 6s ease-in-out infinite;
}

header::after {
    width: 200px;
    height: 200px;
    bottom: -100px;
    left: -50px;
    animation: float 8s ease-in-out infinite reverse;
}

/* 额外的装饰圆形 */
header .container {
    position: relative;
    z-index: 2;
}

header .container::before,
header .container::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
    z-index: -1;
}

header .container::before {
    width: 150px;
    height: 150px;
    top: 20px;
    left: 10%;
    animation: float 10s ease-in-out infinite;
}

header .container::after {
    width: 100px;
    height: 100px;
    bottom: 20px;
    right: 15%;
    animation: float 7s ease-in-out infinite reverse;
}

/* 浮动动画 */
@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

header h1 {
    font-size: 3rem;
    margin-bottom: 15px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
}

/* 主要内容区域 */
main {
    padding: 80px 0;
    background-color: #ffffff;
}

.products-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 50px;
    color: #167cf8;
    font-weight: 600;
    position: relative;
}

.products-section h2::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #167cf8, #4a90e2);
    margin: 15px auto;
    border-radius: 2px;
}

/* 产品网格布局 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 40px;
    max-width: none;
    align-items: stretch;
}

/* 产品卡片样式 */
.product-card {
    background: #ffffff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(22, 124, 248, 0.1);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    box-shadow: 0 20px 40px rgba(22, 124, 248, 0.2);
    border-color: #167cf8;
}


/* 产品图片 */
.product-image {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, opacity 0.3s ease;
    opacity: 0;
    background-color: #f8f9ff;
}

.product-image img.loaded {
    opacity: 1;
}

/* 文字封面样式 */
.product-image img.text-cover {
    opacity: 1;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover .product-image img.text-cover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(22, 124, 248, 0.3);
}

/* 文字封面标识 */
.product-image .text-cover-indicator {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: #167cf8;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 2;
}


/* 产品信息 */
.product-info {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-content {
    flex: 1;
}

.product-info h3 {
    font-size: 1.4rem;
    margin-bottom: 12px;
    color: #167cf8;
    font-weight: 600;
}

.product-description {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 0;
    line-height: 1.6;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* 产品底部容器 */
.product-footer {
    margin-top: auto;
}

/* 产品元信息 */
.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.price {
    font-size: 1.3rem;
    font-weight: 700;
    color: #167cf8;
}

.language {
    background: linear-gradient(135deg, #167cf8, #4a90e2);
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* 按钮样式 */
.btn-primary {
    width: 100%;
    padding: 12px 0;
    background: linear-gradient(135deg, #167cf8 0%, #4a90e2 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1366d9 0%, #4080d1 100%);
    box-shadow: 0 6px 20px rgba(22, 124, 248, 0.3);
}

/* 底部样式 */
footer {
    background: linear-gradient(135deg, #167cf8 0%, #4a90e2 100%);
    color: #ffffff;
    text-align: center;
    padding: 30px 0;
    margin-top: 60px;
}

footer p {
    font-size: 0.95rem;
    opacity: 0.9;
}

/* 导航栏响应式设计 */
@media (max-width: 1200px) {
    .top-nav .container {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .nav-categories {
        margin: 0 15px;
    }
    
    .category-list {
        gap: 20px;
    }
    
    #search-input {
        width: 200px;
    }
}

@media (max-width: 900px) {
    body {
        padding-top: 80px; /* 减少空间，因为导航会收缩 */
    }
    
    .top-nav .container {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 15px;
        position: relative;
    }
    
    .nav-brand {
        margin-bottom: 0;
    }
    
    /* 显示汉堡菜单按钮 */
    .mobile-menu-toggle {
        display: flex;
        order: 2;
    }
    
    /* 隐藏分类导航，但保留搜索框 */
    .nav-categories {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #ffffff;
        box-shadow: 0 4px 20px rgba(22, 124, 248, 0.1);
        border-top: 1px solid rgba(22, 124, 248, 0.1);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 999;
        margin: 0;
    }
    
    .nav-categories.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .category-list {
        flex-direction: column;
        padding: 20px;
        gap: 15px;
    }
    
    .category-item {
        display: block;
        text-align: center;
        padding: 12px 20px;
        border-radius: 8px;
        font-size: 1rem;
    }
    
}

@media (max-width: 600px) {
    body {
        padding-top: 80px;
    }
    
    .brand-text h1 {
        font-size: 1.2rem;
    }
    
    .brand-text span {
        font-size: 0.7rem;
    }
    
    .category-item {
        font-size: 0.95rem;
        padding: 10px 16px;
    }
    
    /* 搜索区域响应式 */
    .search-section {
        padding: 30px 20px;
        margin-bottom: 30px;
    }
    
    .search-container {
        max-width: 100%;
    }
    
    #search-input {
        padding: 14px 56px 14px 20px; /* 调整右边距为搜索按钮留出空间 */
        font-size: 0.95rem;
    }
    
    .search-btn {
        min-width: 40px;
        height: 40px;
        padding: 10px;
    }
}

/* 产品网格响应式设计 */
@media (max-width: 1600px) {
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 25px;
    }
}

@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .container {
        padding: 0 30px;
    }
}

@media (max-width: 900px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    header h1 {
        font-size: 2.5rem;
    }
    
    .products-section h2 {
        font-size: 2rem;
    }
}

@media (max-width: 600px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .container {
        padding: 0 15px;
    }
    
    header {
        padding: 40px 0;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    /* 手机端装饰圆形调整 */
    header::before {
        width: 200px;
        height: 200px;
        top: -100px;
        right: -50px;
    }
    
    header::after {
        width: 120px;
        height: 120px;
        bottom: -60px;
        left: -30px;
    }
    
    header .container::before {
        width: 80px;
        height: 80px;
        top: 10px;
        left: 5%;
    }
    
    header .container::after {
        width: 60px;
        height: 60px;
        bottom: 10px;
        right: 10%;
    }
    
    main {
        padding: 40px 0;
    }
    
    .products-section h2 {
        font-size: 1.8rem;
        margin-bottom: 30px;
    }
    
    .product-info {
        padding: 15px;
    }
    
    .product-info h3 {
        font-size: 1.1rem;
        margin-bottom: 8px;
        line-height: 1.3;
    }
    
    .product-description {
        font-size: 0.85rem;
        line-height: 1.4;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
    
    .product-meta .language {
        font-size: 0.75rem;
        padding: 4px 8px;
    }
    
    .btn-primary {
        font-size: 0.8rem;
        padding: 8px 12px;
    }
    
    /* 手机端产品图片优化 */
    .product-image {
        height: 120px; /* 进一步减小图片高度，确保完整显示 */
        border-radius: 8px; /* 添加圆角 */
        overflow: hidden; /* 确保图片不会溢出 */
    }
    
    .product-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center; /* 确保图片居中显示 */
    }
    
    .product-card {
        border-radius: 12px; /* 稍微减小圆角 */
        min-height: auto; /* 移除最小高度限制 */
    }
    
    /* 优化文字封面标识在手机端的显示 */
    .product-image .text-cover-indicator {
        font-size: 0.6rem;
        padding: 3px 6px;
        top: 6px;
        right: 6px;
    }
    
    /* 手机端产品卡片整体优化 */
    .products-grid .product-card {
        display: flex;
        flex-direction: column;
        height: auto; /* 自动高度 */
    }
    
    .product-info {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
}


/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #167cf8;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #1366d9;
}

/* 分页样式 */
#pagination-container {
    margin-top: 3rem;
    display: flex;
    justify-content: center;
}

.pagination-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.pagination {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(.disabled):not(.current) {
    background: #f8f9fa;
    border-color: #167cf8;
    color: #167cf8;
}

.pagination-btn.current {
    background: #167cf8;
    border-color: #167cf8;
    color: white;
    font-weight: 500;
}

.pagination-btn.disabled {
    background: #f8f9fa;
    border-color: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
}

.pagination-info {
    color: #666;
    font-size: 0.9rem;
    text-align: center;
}

/* 移动端分页优化 */
@media (max-width: 576px) {
    .pagination {
        gap: 0.125rem;
    }
    
    .pagination-btn {
        min-width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    .pagination-info {
        font-size: 0.8rem;
    }
}
