@charset "utf-8";
/* CSS Document */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

.logo-img {
    width: 50px;
    height: 40px;
    margin-right: 20px;
    object-fit: contain;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, #2c3e50, #1a2530);
    color: white;
    padding: 3px 0;
    position: relative;
    top: 0;
    z-index: 50;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 28px;
    font-weight: 700;
    display: flex;
    align-items: center;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 30px;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: #4CAF50;
}

/* Hero Section - 修改了手机端留白 */
.hero {
    color: white;
    text-align: center;
    padding: 40px 20px; /* 减少上下padding */
    position: relative;
    overflow: hidden;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    animation: fadeIn 1s ease-in;
}

.hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 30px;
    animation: fadeIn 1.5s ease-in;
}

.btn {
    display: inline-block;
    background: #4CAF50;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
    text-decoration: none;
}

.btn:hover {
    background: #3e8e41;
    transform: translateY(-3px);
}

/* About Section */
.about {
    padding: 80px 20px;
    background: white;
}

.section-title {
    text-align: center;
    margin-bottom: 50px;
    color: #2c3e50;
    font-size: 2.5rem;
}

.about-content {
    display: flex;
    align-items: center;
    gap: 40px;
}

.about-text {
    flex: 1;
}

.about-image {
    flex: 1;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.about-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s;
}

.about-image img:hover {
    transform: scale(1.05);
}

/* Products Section */
.products {
    padding: 80px 20px;
    background: #f2f6f9;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.product-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    width: 330px;
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.15);
}

/*.product-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid #eee;
}*/

.product-image {
    margin: 0 auto;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid #ddd;
    background: white; 
    height: 250px;
    width: 100%;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
}

/* 针对超宽图片的特殊处理 */
.product-image img.landscape {
    width: 90%;
    height: auto;
}

/* 针对超高图片的特殊处理 */
.product-image img.portrait {
    width: auto;
    height: 90%;
}

/* 针对正方形图片的优化 */
.product-image img.square {
    width: 80%;
    height: 80%;
    object-fit: cover;
}

/* 小图片居中放大显示 */
.product-image img.small {
    transform: scale(1.2);
}

/* 鼠标悬停效果 */
.product-image:hover img {
    transform: scale(1.05);
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-topic {
    padding: 20px;
    text-align: center;
}

.product-topic h3 {
    margin-bottom: 5px;
    color: #2c3e50;
}

.product-topic p {
    color: #777;
    font-size: 0.9rem;
}

.price-container {
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 25px 0;
}

.price-usd {
    font-size: 1.8rem;
    font-weight: bold;
    color: #4CAF50;
}

.price-rmb {
    font-size: 1.5rem;
    font-weight: bold;
    color: #e74c3c;
}

.overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Footer */
footer {
    background: #2c3e50;
    color: white;
    padding: 50px 20px 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h3 {
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.footer-section p, .footer-section li {
    margin-bottom: 10px;
}

.footer-section ul {
    list-style: none;
}

.footer-section a {
    color: #ddd;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: #4CAF50;
}

.social-icons a {
    display: inline-block;
    margin-right: 15px;
    font-size: 1.5rem;
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* 移动端导航菜单 */
.menu-toggle {
    display: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: white;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 轮播图样式 - 修改了手机端高度 */
.hero-carousel {
    width: 100%;
    height: 600px; /* 默认桌面端高度 */
    position: relative;
    overflow: hidden;
    margin: 0 auto;
    max-width: 1200px;
}

.carousel-item {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    cursor: pointer; /* 添加指针样式 */
}

.carousel-item.active {
    opacity: 1;
}

.carousel-item a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* 修改为contain确保完整显示 */
    display: block;
    background-color: #f0f0f0;
    pointer-events: none; /* 防止图片本身接收点击事件 */
}

/* 指示器 */
.indicators {
    position: absolute;
    bottom: 15px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 10px;
    z-index: 10;
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    background-color: #3498db;
    transform: scale(1.2);
}

.indicator:hover {
    background-color: #3498db;
    transform: scale(1.2);
}

section {
    padding: 1rem 0;
    margin: 1rem auto;
    background: #f6f2f2eb;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* 响应式设计 */
@media (max-width: 992px) {
    .hero h1 {
        font-size: 2.8rem;
    }

    .about-content {
        flex-direction: column;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-carousel {
        height: 400px; /* 平板端高度 */
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 30px 15px; /* 进一步减少手机端留白 */
    }
    
    .hero-carousel {
        height: 300px; /* 手机端高度调整 */
    }

    .carousel-item a {
        /* 禁用移动端链接的默认行为 */
        pointer-events: none;
    }

    .menu-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #2c3e50;
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        margin: 10px 0;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .product-grid {
        grid-template-columns: 1fr;
    }

    .price-container {
        flex-direction: column;
        gap: 10px;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .product-showcase {
        flex-direction: column;
        align-items: center;
    }

    .product-card {
        width: 100%;
        max-width: 350px;
    }

    .product-image {
        height: 400px;
    }

    /* 为移动设备添加点击提示 */
    .product-image::after {
        position: absolute;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0, 0, 0, 0.7);
        color: white;
        padding: 5px 10px;
        border-radius: 4px;
        font-size: 0.8rem;
        opacity: 0;
        transition: opacity 0.3s ease;
    }
    
    .product-image:hover::after {
        opacity: 1;
    }

    .about-image a {
        /* 禁用移动端链接的默认行为 */
        pointer-events: none;
    }

    .mega-menu-content {
        flex-direction: column; /* 改为垂直排列 */
        padding: 15px;
    }

    .menu-column {
        min-width: 100%; /* 每列占满容器宽度 */
        padding: 10px 0;
        border-bottom: 1px solid #eee;
    }

    .menu-column:last-child {
        border-bottom: none;
    }

    .mega-menu-container {
        width: 100%;
        right: auto;
    }

    .menu-column h3 {
        font-size: 1.1rem;
        padding-bottom: 8px;
        white-space: normal; /* 允许标题换行 */
    }
}

/* 添加交互优化 */
.mega-menu:hover .mega-menu-container {
    display: block;
}

/* 防止手机端点击时菜单立即关闭 */
@media (hover: none) {
    .mega-menu-container {
        display: none;
    }

    .mega-menu.active .mega-menu-container {
        display: block;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 20px 10px; /* 超小屏幕进一步减少留白 */
    }
    
    .hero-carousel {
        height: 250px; /* 超小屏幕调整高度 */
    }

    .logo {
        font-size: 1.5rem;
    }

    .logo-img {
        width: 50px;
        height: 50px;
    }

    .hero h1 {
        font-size: 1.8rem;
    }
    
    .hero p {
        font-size: 1rem;
    }

    .about, .products {
        padding: 50px 20px;
    }

    .section-title {
        font-size: 1.8rem;
    }
}

/* 保持桌面端的正常链接行为 */
@media (min-width: 769px) {
    .about-image a {
        pointer-events: auto;
    }
    
    .about-image::after {
        display: none;
    }
}

/* 其他样式保持不变... */
.mega-menu {
    position: static;
}

.mega-menu-container {
    position: absolute;
    width: 100%;
    left: 0;
    background: white;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: none;
    z-index: 1000;
}

.mega-menu-content {
    display: flex;
    padding: 30px;
}

.menu-column {
    flex: 1;
    padding: 0 20px;
    min-width: 250px;
}

.menu-column h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #2c3e50;
    border-bottom: 2px solid #4CAF50;
    padding-bottom: 10px;
    white-space: nowrap; /* 关键：禁止换行 */
     /* overflow: hidden; /* 隐藏溢出内容 */
    text-overflow: ellipsis; /* 溢出显示省略号 */
    min-width: 0; /* 允许缩小 */
}

.menu-column ul {
    list-style: none;
}

.menu-column ul li a {
    display: block;
    padding: 8px 0;
    color: #333;
    transition: all 0.3s;
    border-radius: 4px;
    padding-left: 15px;
}

.menu-column ul li a:hover {
    background: #f5f5f5;
    color: #4CAF50;
    transform: translateX(5px);
}

.featured-img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.dropdown:hover .mega-menu-container {
    display: flex;
    animation: fadeIn 0.3s ease-in-out;
}

.dropdown-menu {
    display: none;
    position: absolute;
    background: white;
    min-width: 50px;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    padding: 4px 0;
    z-index: 1000;
}

.submenu {
    display: none;
    position: absolute;
    left: 80%;
    top: 0;
    background: white;
    min-width: 90px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    padding: 4px 0;
    font-size: 0.85rem;
}

.dropdown-submenu {
    position: relative;
}
.dropdown-submenu > ul {
    display: none;
    position: absolute;
    left: 100%;
    top: 0;
    background: white;
    min-width: 160px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
}
.dropdown:hover > .dropdown-menu,
.dropdown-submenu:hover > ul {
    display: block;
}
.dropdown-menu li a {
    color: #333;
    padding: 5px 10px;
    font-size: 1rem;
    white-space: nowrap;
}
.dropdown-menu li a:hover {
    background: #f5f5f5;
    color: #4CAF50;
}
