:root {
    --primary: #1677ff;
    --secondary: #f5f7fa;
    --text: #333;
    --light: #fff;
    --header-height: 70px;
    /* 默认值，会由 JS 更新为真实高度 */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    overflow-x: hidden;
}

/* 避免横向滚动 */
body {
    font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
    color: var(--text);
    line-height: 1.6;
    padding-top: var(--header-height);
    /* 留出 header 高度，避免遮挡 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

ul {
    list-style-type: none;
}

/* header（固定） */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 5%;
    z-index: 1200;
    gap: 12px;
    background-color: #fff;
    border-bottom: 1px #e5e5e5 solid;
}

.logo {
    font-weight: 700;
    font-size: 20px;
    display: flex;
    align-items: center;
}

.logo img {
    width: 100px;
    margin-right: 10px;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 30px;
    align-items: center;
}

nav a {
    color: var(--text);
    text-decoration: none;
    font-size: 20px;
    padding: 8px 0;
}

nav a.selected,
nav a:hover {
    color: var(--primary);
    font-weight: bold;
    border-bottom: 3px var(--primary) solid;
}

.hamburger {
    display: none;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: var(--primary);
    /* display: inline-flex; */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
}

.hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    background: white;
    position: relative;
}

.hamburger span::before,
.hamburger span::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: white;
}

.hamburger span::before {
    top: -6px;
}

.hamburger span::after {
    top: 6px;
}

/* 手机下拉菜单 */
.mobile-nav {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    z-index: 1100;
    transform-origin: top;
    transform: translateY(-6px);
    opacity: 0;
    transition: transform .25s ease, opacity .25s ease;
}

.mobile-nav.open {
    display: block;
    transform: translateY(0);
    opacity: 1;
}

.mobile-nav a {
    display: block;
    padding: 14px 5%;
    color: #222;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
}

.mobile-nav a.selected {
    color: var(--primary);
    font-weight: bold;
}

/* Banner / 轮播 */
.banner {
    width: 100%;
    height: clamp(240px, 60vh, 520px);
    position: relative;
    overflow: hidden;
    padding: 0;
}

.swiper {
    width: 100%;
    height: 100%;
}


.swiper-slide {
    position: relative;
    height: 100%;
}

.swiper-slide img {
    width: 100%;
    height: 100%;
}

.swiper-slide .text {
    position: absolute;
    bottom: 0;
    /* 文字条在图片中偏下位置 */
    left: 0;
    width: 100%;
    text-align: left;
    color: #fff;
    font-size: 18px;
    line-height: 1.6;
    background: rgba(0, 0, 0, 0.35);
    /* 横条背景 */
    padding: 20px 0 20px 5%;
}

.text .tit {
    font-size: 30px;
}

/* 页面主体区域 */
section {
    padding: 48px 5%;
}

.title {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.title a {
    font-size: 14px;
    color: #999;
    text-decoration: none;
}

section h2 {
    text-align: center;
    margin-bottom: 28px;
    font-size: 32px;
    color: var(--primary);
}

section h3 {
    text-align: center;
    margin-bottom: 28px;
    font-size: 22px;
}

.products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.product-card {
    /* background: var(--secondary); */
    border-radius: 8px;
    overflow: hidden;
    transition: transform .25s ease;
}

.product-card:hover {
    transform: translateY(-6px);
}

.product-card img {
    width: 100%;
    height: 160px;
    object-fit: contain;
    display: block;
}

.product-card h3 {
    padding: 12px;
    font-size: 16px;
    text-align: center;
}

.about {
    display: flex;
    gap: 18px;
    align-items: center;
    flex-wrap: wrap;
}

.about img {
    width: 100%;
    max-width: 480px;
    border-radius: 10px;
    object-fit: cover;
}

.box {
    text-align: center;
}

.box img {
    width: 100%;
    max-width: 1000px;
}

.box2 {
    text-align: left;
}

.box2 h2 {
    text-align: left;
}

.about-text {
    flex: 1;
    min-width: 220px;
}


/* 动画（进入可视区） */
.animate {
    opacity: 0;
    transform: translateY(28px);
    transition: transform .7s ease, opacity .7s ease;
    will-change: transform, opacity;
}

.animate.show {
    opacity: 1;
    transform: translateY(0);
}

footer {
    text-align: center;
    padding: 20px 5%;
    background: #fafafa;
    font-size: 13px;
    color: #666;
}

.flexRow {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flexRow a {
    margin-left: 10px;
}

a {
    color: #999;
}

a:hover {
    color: var(--primary);
}

/* 响应式：手机显示汉堡、隐藏横向 nav */
@media (max-width: 900px) {
    .logo {
        font-size: 1rem;
    }

    .logo img {
        width: 6rem;
    }

    .hamburger {
        display: inline-flex;
    }

    nav ul {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    .mobile-nav {
        display: none;
    }

    section h2 {
        font-size: 1.3rem;
    }

    .about {
        flex-direction: column;
    }

    .banner {
        height: 12rem;
    }

    .slide {
        font-size: 22px;
        padding: 0 10px;
        text-align: center;
    }

    .flexRow {
        flex-direction: column;
    }

    /* .swiper img {
        width: 100%;
        height: auto;
    } */

    .swiper-slide .text {
        width: 100%;
        font-size: .875rem;
        padding: 12px 20px;
    }

    .text .tit {
        font-size: 1rem;
    }
}