/* 公共样式 */
@import url('header.css');
@import url('footer.css');

.logo-img {
    height: 40px;  /* 保持原有高度 */
    width: auto;
    transition: transform 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.05);
}

/* 公共样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    padding-top: 80px;
}

/* 页眉样式 */
.header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

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

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

.logo img {
    height: 100%;
    width: auto;
    object-fit: contain;
    max-height: 35px;
}

.menu {
    display: flex;
    list-style: none;
}

.menu li {
    margin: 0 15px;
}

.menu a {
    text-decoration: none;
    color: #333;
}

/* 页脚样式 */
.footer {
    background: #333;
    color: #fff;
    padding: 50px 0;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    justify-items: center;
}

.footer-section {
    padding: 0 20px;
}

.footer-section h3 {
    margin-bottom: 15px;
    font-size: 18px;
}

.copyright {
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.2);
    text-align: center;
}

.disclaimer {
    display: block;
    font-size: 0.8em;
    color: #ccc;
    margin-top: 8px;
}

/* 下拉菜单样式 */
.menu-item {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    min-width: 200px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 4px;
    padding: 10px 0;
    z-index: 1000;
}

.menu-item:hover .dropdown-menu {
    display: block;
}

/* 添加快速链接统一样式 */
.footer-section p {
    margin: 8px 0;
}

.footer-section a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s;
    display: block;  /* 改为块级元素保持间距 */
    padding: 4px 0;
}

.footer-section a:hover {
    color: #00b4ff;
    text-decoration: none;
}

/* 邮件链接样式 */
.email-link {
    color: #003366;
    text-decoration: none;
    border-bottom: 1px dotted #003366;
    transition: all 0.3s;
}

.email-link:hover {
    color: #00b4ff;
    border-bottom-color: #00b4ff;
}

/* 图片模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
}

.modal-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 1200px;
    animation: zoom 0.3s;
}

@keyframes zoom {
    from {transform: scale(0.1)} 
    to {transform: scale(1)}
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close:hover {
    color: #bbb;
}

/* 产品分类菜单样式 */
.product-categories {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    min-width: 800px;
    padding: 20px;
}

.product-category {
    display: block;
    text-decoration: none;
    color: #333;
    transition: transform 0.3s;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.product-category:hover {
    transform: translateY(-5px);
}

.product-category img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-bottom: 2px solid #f0f0f0;
}

.category-info {
    padding: 15px;
    background: #fff;
}

.category-info h4 {
    color: #003366;
    margin-bottom: 8px;
    font-size: 16px;
}

.category-info p {
    color: #666;
    font-size: 14px;
    line-height: 1.4;
}

/* 响应式调整 */
@media (max-width: 1200px) {
    .product-categories {
        grid-template-columns: repeat(3, 1fr);
        min-width: 600px;
    }
}

@media (max-width: 768px) {
    .product-categories {
        grid-template-columns: 1fr;
        min-width: 300px;
    }
    
    .product-category img {
        height: 120px;
    }
}

/* 首页产品中心样式保持原样 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.product-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-image {
    height: 280px;
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.product-image.loaded {
    background: transparent; /* 加载完成后移除背景色 */
}

.product-image img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease;
}

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

/* 优化加载状态显示 */
.product-image::before {
    content: '图片加载中...';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #999;
    font-size: 14px;
    z-index: 1;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
}

.product-image.loaded::before {
    display: none !important;
}

/* 添加错误状态提示 */
.product-image.error::before {
    content: '图片加载失败';
    color: #ff4d4f;
}

.product-info {
    padding: 20px;
    text-align: center;
}

.product-info h3 {
    color: #003366;
    margin-bottom: 10px;
}

.product-info p {
    color: #666;
    line-height: 1.6;
}

.product-link {
    display: inline-block;
    margin-top: 15px;
    color: #003366;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
}

.product-link:hover {
    color: #00b4ff;
    transform: translateX(5px);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .product-image {
        height: 220px;
    }
    
    .product-image img {
        max-width: 85%;
        max-height: 85%;
    }
}

@media (max-width: 480px) {
    .product-image {
        height: 200px;
    }
}

/* 新版悬浮菜单样式 */
.menu-item:hover .header-product-menu {
    opacity: 1;
    visibility: visible;
    transition-delay: 0.1s;
}

.header-product-menu {
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    width: 360px;
    padding: 12px;
    max-height: 60vh; /* 改用视口单位 */
    min-height: 200px; /* 保证最小高度 */
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ccc #f5f5f5;
    background: #fff;
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    border-radius: 8px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1000;
    margin-top: 5px;
    box-sizing: border-box; /* 包含内边距 */
}

/* 修复滚动条被截断问题 */
.menu-item .header-product-menu {
    overflow: hidden; /* 保持滚动条可见 */
}

/* 调整箭头位置 */
.header-product-menu::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 10px 10px;
    border-style: solid;
    border-color: transparent transparent #fff transparent;
    z-index: 1001;
}

/* 添加阴影箭头 */
.header-product-menu::after {
    content: '';
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 10px 10px;
    border-style: solid;
    border-color: transparent transparent rgba(0,0,0,0.1) transparent;
    z-index: 1000;
}

/* 优化滚动条显示 */
.header-product-menu::-webkit-scrollbar {
    width: 8px; /* 加宽滚动条 */
    height: 8px; /* 水平滚动条高度 */
}

.header-product-menu::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 3px;
}

.header-product-menu::-webkit-scrollbar-thumb {
    background: #bbb;
    border: 2px solid #f5f5f5; /* 增加留白 */
    border-radius: 3px;
}

.header-product-menu::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

.header-product-list {
    display: flex;
    flex-direction: column;
    gap: 8px; /* 减少行间距 */
    padding: 10px 0; /* 增加上下内边距 */
}

.header-product-item {
    width: 100%; /* 占满容器宽度 */
    display: flex;
    align-items: center;
    justify-content: space-between; /* 两端对齐 */
    padding: 10px 12px; /* 减少水平内边距 */
    margin: 0 -3px; /* 调整边距补偿 */
}

.header-product-item:hover {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transform: translateX(5px);
}

/* 图片容器 */
.header-product-image {
    flex: 0 0 25%; /* 固定25%宽度 */
    max-width: 80px; /* 从100px缩小到80px */
    height: 60px;    /* 对应缩小高度 */
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-product-image img {
    max-height: 100%;
    width: auto;
}

/* 文字容器 */
.header-product-info {
    flex: 1;
    min-width: 0;
    text-align: center;
    padding: 0 15px;
    display: flex;
    flex-direction: column;
    justify-content: center; /* 垂直居中 */
}

.header-product-info h4 {
    font-size: 13px; /* 从14px缩小 */
    margin: 0 0 4px 0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-product-info p {
    font-size: 11px; /* 从12px缩小 */
    color: #666;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .header-product-image {
        max-width: 80px;
        height: 60px;
    }
    
    .header-product-info h4 {
        font-size: 13px;
    }
    
    .header-product-info p {
        font-size: 11px;
    }
    
    .header-product-menu {
        top: 100%;
        margin-top: 0;
    }
    
    .header-product-menu::before,
    .header-product-menu::after {
        display: none;
    }
}

/* 首页产品中心标题优化 */
.products h2 {
    font-size: 2.2rem;
    color: #003366;
    margin-bottom: 40px;
    position: relative;
    padding-bottom: 15px;
    text-align: center;
    font-weight: 600;
    letter-spacing: 1.5px;
}

.products h2::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: #00a8ff;
    border-radius: 2px;
}

.products h2::after {
    content: 'PRODUCTS';
    display: block;
    font-size: 0.8rem;
    color: #666;
    letter-spacing: 4px;
    margin-top: 8px;
    font-weight: 400;
}

@media (max-width: 768px) {
    .products h2 {
        font-size: 1.8rem;
        margin-bottom: 30px;
        padding-bottom: 12px;
    }
    
    .products h2::before {
        width: 40px;
        height: 2px;
    }
    
    .products h2::after {
        font-size: 0.7rem;
    }
}

/* 确保父容器没有溢出隐藏 */
.menu-item {
    position: relative;
}

.menu-item .header-product-menu {
    overflow: visible; /* 覆盖可能存在的溢出隐藏 */
}

/* 重置页眉菜单文字样式 */
.nav-container,
.main-menu,
.main-menu * {
    all: initial; /* 清除所有继承样式 */
    font-family: system-ui, -apple-system, sans-serif; /* 系统默认字体 */
}

/* 基础页眉结构 */
.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 60px;
}

/* Logo样式 */
.logo img {
    height: 40px;
    display: block;
}

/* 主菜单容器 */
.main-menu {
    display: flex;
    gap: 30px;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* 菜单项基础样式 */
.main-menu > li {
    position: relative;
    display: flex;
    align-items: center;
}

/* 菜单链接基础样式 */
.main-menu a {
    color: #333;
    font-size: 16px;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

/* 交互状态 */
.main-menu a:hover {
    background: #f5f5f5;
    color: #0066cc;
}

/* 当前菜单项 */
.main-menu > .current-menu-item > a {
    color: #0066cc;
    font-weight: 500;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .main-menu {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block !important; /* 强制显示 */
        order: 2; /* 右侧排列 */
    }
}

/* 修复移动菜单按钮显示问题 */
.mobile-menu-toggle {
    display: none; /* 默认隐藏 */
    background: none;
    border: none;
    font-size: 24px;
    padding: 8px;
    cursor: pointer;
    color: #333;
}

/* 仅在移动端显示 */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block !important; /* 强制显示 */
        order: 2; /* 右侧排列 */
    }
}

/* 新增下拉菜单样式 */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    flex-flow: column;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    min-width: 320px;
    z-index: 1000;
    border-radius: 4px;
    padding: 15px;
    gap: 8px;
    max-height: 60vh;
    overflow-y: scroll;
}

.dropdown:hover .dropdown-content {
    display: flex;
}

/* 添加箭头指示 */
.dropdown-content::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 10px 10px;
    border-style: solid;
    border-color: transparent transparent #fff transparent;
    z-index: 1;
}

.dropdown-content::after {
    content: '';
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 0 10px 10px;
    border-style: solid;
    border-color: transparent transparent rgba(0,0,0,0.1) transparent;
    z-index: 0;
}

.product-item {
    display: flex;
    align-items: center;
    padding: 10px;
    min-height: 80px; /* 最小高度保证一致性 */
    transition: all 0.25s cubic-bezier(0.4,0,0.2,1); /* 平滑过渡 */
    background: #f8fafc; /* 浅蓝色背景 */
    border-radius: 8px; /* 圆角增大 */
    margin: 4px 0; /* 增加行间距 */
}

.product-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    background: #fff;
}

.product-item img {
    flex: 0 0 80px; /* 固定宽度 */
    width: 80px;    /* 明确宽度 */
    height: 60px;   /* 固定高度 */
    object-fit: cover; /* 保持比例填充 */
    border-radius: 4px;
    margin-right: 10px;
    overflow: hidden; /* 隐藏溢出部分 */
}

.product-item span {
    font-size: 15px; /* 增大字号 */
    font-weight: 500; /* 中等字重 */
    color: #2d3748; /* 深灰色提升可读性 */
    line-height: 1.6; /* 增加行高 */
    padding: 0 20px; /* 增加左右间距 */
    letter-spacing: 0.5px; /* 微调字间距 */
    text-shadow: 0 1px 1px rgba(0,0,0,0.05); /* 添加文字阴影 */
} 