/* 通用样式 */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    color: #fff;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
}

/* 第1行：Logo 和导航栏 */
.header {
    background: #fff;
    padding: 20px 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
}

.logo-nav {
    display: flex;
    justify-content: space-between; 
    align-items: center;
}

.logo img {
    height: 90px;
}

.nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column; 
    height: 0; /* 修改: 默认高度为0 */
    overflow: hidden; /* 修改: 隐藏溢出内容 */
    transition: height 0.3s ease; /* 修改: 添加过渡效果 */
}

.nav.active ul {
    height: auto; /* 修改: 当导航栏激活时，高度自适应 */
}

.nav ul li {
    margin: 10px 15px; /* 修改: 调整间距 */
}

.nav ul li a {
    text-decoration: none;
    color: #333;
    font-weight: bold;
}

.nav ul li a:hover {
    color: #28a745;
    text-decoration-line: underline;
    text-decoration-style: double;
    text-decoration-thickness: 2px;
}

.nav ul li a.active {
    color: #28a745;
    text-decoration-line: underline;
    text-decoration-style: double;
    text-decoration-thickness: 2px;
}

.hamburger {
    display: flex; /* 修改: 使用flex布局 */
    flex-direction: column;
    justify-content: center; /* 修改: 垂直居中 */
    align-items: center; /* 修改: 水平居中 */
    width: 44px; /* 修改: 调整宽度 */
    height: 34px; /* 修改: 调整高度 */
    cursor: pointer;
    border: none;
    background: #1c5329; /* 修改: 设置背景为透明 */
}

.hamburger span {
    display: block;
    width: 80%;
    height: 3px; /* 修改: 调整高度 */
    background-color: #fff; /* 修改: 设置颜色 */
    transition: transform 0.3s ease, opacity 0.3s ease;
    border-radius: 4px; /* 添加: 圆角效果 */
    margin: 3px 0; /* 修改: 调整上下间距 */
}

.hamburger.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

@media (max-width: 767px) {
    .hamburger {
        display: flex; /* 修改: 手机端显示汉堡菜单按钮 */
    }

    .nav ul {
        flex-direction: column; /* 修改: 手机端为列布局 */
        height: 0; /* 修改: 默认高度为0 */
        overflow: hidden; /* 修改: 隐藏溢出内容 */
    }

    .nav.active ul {
        height: auto; /* 修改: 当导航栏激活时，高度自适应 */
    }
}

@media (min-width: 768px) {
    .nav ul {
        flex-direction: row; /* 修改: 桌面端为行布局 */
        height: auto; /* 修改: 桌面端高度自适应 */
    }

    .hamburger {
        display: none; /* 修改: 桌面端隐藏汉堡菜单按钮 */
    }
}

/* 第2行：轮播图片 */
.carousel-section {
    margin-top: 20px;
    padding-top: 80px;
}

.carousel-item img {
    max-width: 100%; /* 修改: 设置最大宽度为100% */
    height: auto; /* 修改: 高度自适应 */
    object-fit: cover; /* 保持图片的宽高比 */
}

/* 第3行：服务项目 */
.services-section {
    padding: 50px 0;
    background: #f9f9f9;
}

.services-section h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 24px;
}

.services-section p {
    font-size: 18px;
    text-align: center;
    margin-bottom: 30px;
    color: #676464;
}

@media (max-width: 767px) {
    .services-section h2 {
        font-size: 20px;
    }

    .services-section p {
        font-size: 16px;
    }
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(50%, 1fr)); /* 修改: 最大为2列，最小为1列 */
    gap: 50px;
}

/* 添加媒体查询以确保在电脑端显示2列 */
@media (min-width: 768px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.service-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    text-align: center;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 3px; 
}

.service-card img {
    width: 100%; 
    height: 80%; 
    object-fit: cover;
    border-radius: 20px 20px 0 0;
    animation: fadeIn 2s ease-in-out;
    max-height: 80%; /* 确保图片高度不超过卡片高度的80% */
}

.service-card h3 {
    color: #333;
    margin: 0;
    font-size: 22px;
    padding: 10px;
    flex: 0 0 auto; /* 确保标题不被压缩 */
}

.service-card p {
    color: #333;
    margin: 20px;
    flex: 1 1 auto; /* 允许段落内容扩展以填充剩余空间 */
    overflow-wrap: break-word;
    text-align: left;
    font-size: 14px; /* 修改: 调整字体大小以适应不同屏幕 */
    padding: 0;
    line-height: 1.6;
}

.service-card:hover {
    background: #cad1cc;
    /* 添加图片翻转动画效果 */
    animation: flip 1s ease-in-out forwards;
}

.service-card:hover img {
    transform: rotateY(180deg);
    transition: transform 1s ease-in-out;
}

/* 第4行：滚动图片 */
.scroll-section {
    padding: 50px 0;
    height: 100%;
}

.scroll-section h2 {
    text-align: left;
    margin-bottom: 30px;
    color: #333;
    height: auto;
}

.scroll-container {
    white-space: nowrap; /* 修改: 允许内容换行 */
    overflow: hidden; /* 修改: 允许滚动 */
    transition: scroll-left 0.3s ease;
    margin-top: 30px;
}

.scroll-container img {
    display: inline-block;
    margin-right: 10px;
    height: 400px; /* 修改: 设置高度为auto */
    max-width: 100%; /* 修改: 设置最大宽度为100% */
    border-radius: 10px;
}

@media (max-width: 767px) {
    .scroll-container img {
        height: 200px; /* 修改: 设置手机端图片高度 */
    }
}

/* 第5行：页脚 */
.footer {
    width: 100%;
    background: #bebcbc;
    color: #333;
    padding: 40px 0;
    font-size: 12px;
}

.footer-row {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin-bottom: 20px;
}

.footer-about, .footer-qrcode, .footer-contact {
    flex: 1;
    margin: 10px 0;
    font-size: 12px;
}

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

.footer p {
    margin: 0;
    color: #666;
}

.footer-about p {
    text-indent: 2em;
}

.footer-qrcode-images {
    display: flex; 
    flex-wrap: wrap;
    justify-content: center;
}

.footer-qrcode img {
    width: 100px; 
    height: 100px;
    box-sizing: border-box;
    margin: 5px;
    transition: transform 0.3s ease;
}

.footer-qrcode img:hover {
    transform: scale(4);
    z-index: 1000; 
}

@media (max-width: 768px) {
    .footer-qrcode img {
        width: 50px; 
        height: 50px;
    }
}

.footer-contact-icon {
    margin-right: 15px; 
    vertical-align: middle; 
    width: 15px; 
    height: 15px;
}

.footer-contact-info {
    margin-bottom: 20px;
}

.footer-contact-info:last-child {
    margin-bottom: 0; /* 最后一个门店信息不需要底部间距 */
}

.footer-contact p {
    margin: 5px 0;
    color: #666;
}

.footer-links {
    text-align: left;
    margin: 0 20px;
}

.footer-links a {
    color: #666;
    text-decoration: none;
    margin: 0 10px;
}

.footer-links a:hover {
    color: #28a745;
}

@media (min-width: 768px) {
    .footer-row {
        flex-direction: row;
    }
}

/* 新增横线样式 */
.footer-copyright-line {
    border-top: 0.5px solid rgba(102, 102, 102, 0.5);
    margin: 20px 0;
    width: 100%;
}

.footer-copyright {
    text-align: center;
    margin-top: 40px;
    color: #666;
}

.footer-copyright a {
    margin-left: 10px;
    color: #666;
}