/* 导航栏组件 */
header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
}

header.header-hidden {
    transform: translateY(-100%);
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 0;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
}

.logo i {
    margin-right: 0.5rem;
    color: var(--accent);
}

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

.nav-menu li {
    margin-left: 2rem;
}

/* 平板横屏模式 */
@media (min-width: 992px) and (max-width: 1199px) {
    .nav-menu li {
        margin-left: 1.5rem;
    }
    
    .nav-menu a {
        font-size: 18px;
    }
}

/* 平板竖屏模式 - 减小菜单项间距，避免拥挤 */
@media (min-width: 769px) and (max-width: 991px) {
    .nav-menu li {
        margin-left: 1rem;
    }
    
    .nav-menu a {
        font-size: 18px;
    }
}

.nav-menu a {
    color: var(--dark);
    text-decoration: none;
    font-weight: 500;
    font-size: 18px;
    transition: color 0.3s;
    position: relative;
}

.nav-menu a:hover {
    color: var(--primary);
}

.nav-menu a.active {
    color: var(--primary);
}

/* 导航链接下划线动画 */
.nav-menu a::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -6px;
    height: 2px;
    background: var(--primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    transform: scaleX(1);
}

/* 响应式菜单active状态 */
/* 平板横屏 */
@media (min-width: 992px) and (max-width: 1199px) {
    .navbar {
        padding: 1rem 0;
    }
}

/* 平板竖屏 */
@media (min-width: 769px) and (max-width: 991px) {
    .navbar {
        padding: 1rem 0;
    }
}

/* 手机竖屏 */
@media (max-width: 768px) {
    .nav-menu a.active {
        color: var(--primary);
        position: relative;
    }
    
    .nav-menu a.active::after {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        bottom: -6px;
        height: 2px;
        background: var(--primary);
        transform: scaleX(1);
        transform-origin: left;
        transition: transform 0.25s ease;
    }
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--dark);
    cursor: pointer;
}

/* 页脚组件 */
footer {
    background: #f6f6f6;
    color: #333;
    padding: 4rem 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

/* 联系我们区域保持在第一列 */
.footer-column:first-child {
    grid-column: 1;
}

/* 关于我们区域开始，整体往右移一列 */
.footer-column:nth-child(2) {
    grid-column: 3;
}

.footer-column:nth-child(3) {
    grid-column: 4;
}

.footer-column:nth-child(4) {
    grid-column: 5;
}

.footer-column h3 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
    font-weight: 600;
    border-bottom: 2px solid var(--primary);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.footer-column p, .footer-column li {
    color: #666;
    margin-bottom: 0.8rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.footer-column p {
    white-space: nowrap;
}

/* 响应式设计 - 小屏幕时允许换行 */
@media (max-width: 768px) {
    .footer-column p {
        white-space: normal;
    }
}

.footer-column ul {
    list-style: none;
    padding: 0;
}

.footer-column li {
    margin-bottom: 0.6rem;
}

.footer-column a {
    color: #666;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-column a:hover {
    color: var(--primary);
}

.social-media {
    margin-top: 1rem;
}

.social-media p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.social-media i {
    margin-right: 0.5rem;
    color: var(--accent);
}

.footer-divider {
    height: 1px;
    background: #e0e0e0;
    margin: 2rem 0;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.copyright p, .design-credit p {
    margin: 0;
    font-size: 0.9rem;
    color: #999;
}

.copyright p a{
    text-decoration: none;
    color: #999999;
}


.design-credit p {
    font-style: italic;
}

/* 响应式设计 */
/* 平板横屏 */
@media (min-width: 992px) and (max-width: 1199px) {
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem;
    }
    
    .footer-column:first-child {
        grid-column: 1;
    }
    
    .footer-column:nth-child(2) {
        grid-column: 2;
    }
    
    .footer-column:nth-child(3) {
        grid-column: 1;
    }
    
    .footer-column:nth-child(4) {
        grid-column: 2;
    }
}

/* 平板竖屏 */
@media (min-width: 768px) and (max-width: 991px) {
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .footer-column:first-child {
        grid-column: 1;
    }
    
    .footer-column:nth-child(2) {
        grid-column: 2;
    }
    
    .footer-column:nth-child(3) {
        grid-column: 1;
    }
    
    .footer-column:nth-child(4) {
        grid-column: 2;
    }
}

/* 手机竖屏 */
@media (max-width: 767px) {
    .footer-content {
        grid-template-columns: 2fr 1fr;
        gap: 1.5rem;
        align-items: start;
        /* 确保与父容器container的padding保持一致 */
        margin-left: 0;
        margin-right: 0;
    }
    
    /* 第一列占2/3空间 */
    .footer-column:first-child {
        grid-column: 1;
        grid-row: 1;
        text-align: left;
    }
    
    /* 第二列占1/3空间 */
    .footer-column:nth-child(2) {
        grid-column: 2;
        grid-row: 1;
        text-align: left;
    }
    
    /* 第三列占2/3空间 */
    .footer-column:nth-child(3) {
        grid-column: 1;
        grid-row: 2;
        text-align: left;
    }
    
    /* 第四列占1/3空间 */
    .footer-column:nth-child(4) {
        grid-column: 2;
        grid-row: 2;
        text-align: left;
    }
    
    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-column h3 {
        font-size: 1rem;
    }
    
    .footer-column p,
    .footer-column li {
        font-size: 0.9rem;
    }
    
    /* 确保链接列表也正确对齐 */
    .footer-column ul {
        text-align: left;
    }
}

/* 小屏手机 */
@media (max-width: 576px) {
    footer {
        padding: 3rem 0 1.5rem;
    }
    
    .footer-content {
        gap: 1.5rem;
    }
    
    .footer-column h3 {
        font-size: 1rem;
    }
}

/* 超小屏幕 */
@media (max-width: 400px) {
    footer {
        padding: 2.5rem 0 1rem;
    }
    
    .footer-content {
        gap: 1.25rem;
    }
    
    .footer-column h3 {
        font-size: 0.95rem;
    }
    
    .footer-column p,
    .footer-column li {
        font-size: 0.85rem;
    }
}

/* 产品卡片组件 */
.product-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    aspect-ratio: 1/1;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.product-img {
    height: 50%;
    overflow: hidden;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s;
    background-color: var(--product-image-bg);
}

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

.product-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 50%;
}

.product-content h3 {
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
    color: var(--dark);
    line-height: 1.3;
    font-weight: 600;
}

.product-content p {
    margin-bottom: 0;
    color: var(--text);
    flex-grow: 1;
    font-size: 1rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-cta {
    text-align: center;
    margin-top: auto;
    padding-top: 0.5rem;
}

.product-cta .btn {
    font-size: 0.9rem;
    padding: 0.6rem 1.5rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    
    .nav-menu {
        position: fixed;
        top: 80px;
        left: -100%;
        background: white;
        width: 100%;
        height: calc(100vh - 80px);
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        padding-top: 2rem;
        transition: left 0.3s;
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-menu li {
        margin: 1.2rem 0;
    }
}
