



/* ===== CSS变量定义 ===== */
:root {
    /* 主色调 */
    --primary-color: #4CAF50;
    --primary-dark: #45a049;
    --secondary-color: #333;

    /* 文本颜色 */
    --text-dark: #333;
    --text-medium: #666;
    --text-light: #999;
    --text-white: #fff;

    /* 背景颜色 */
    --bg-white: #fff;
    --bg-light: #f8f9fa;
    --bg-dark: #000;

    /* 间距 */
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 32px;
    --spacing-xl: 48px;

    /* 响应式断点 */
    --mobile: 480px;
    --tablet: 768px;
    --desktop: 1024px;
    --wide: 1200px;

    /* 动画速度 */
    --transition-fast: 0.3s;
    --transition-normal: 0.5s;
    --transition-slow: 0.8s;

    /* 阴影 */
    --shadow-light: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-medium: 0 4px 16px rgba(0,0,0,0.15);
    --shadow-heavy: 0 8px 30px rgba(0,0,0,0.2);

    /* 圆角 */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

/* ===== 重置和基础样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== 添加修复代码：修复页面布局 ===== */
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    overflow-x: hidden;
    background-color: white;
    /* 修复footer底部空白问题 */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
}

/* 确保内容区域能够撑开 */
main, .stats-section, .services-section, .cases-section, .clients-section, .about-container {
    flex: 1 0 auto;
}

/* ===== 视频播放优化 ===== */
video {
    -webkit-tap-highlight-color: transparent; /* 移除移动端点击高亮 */
    -webkit-user-select: none; /* 防止用户选择 */
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    background-color: #000; /* 视频加载前的背景色 */
}

/* 视频容器的备用图片 */
video:not([src]) {
    display: none;
}

video::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    z-index: -1;
}

/* ===== 案例详情页和关于我们页的导航栏样式 ===== */
body:not(.home-page) .nav-bar {
    position: fixed;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

body:not(.home-page) .menu-button {
    color: black;
}

body:not(.home-page) .logo-white {
    display: none;
}

body:not(.home-page) .logo-black {
    display: block;
}

/* 确保首页的样式不受影响 */
.home-page .nav-bar:not(.scrolled) {
    background-color: transparent;
    box-shadow: none;
}

.home-page .nav-bar:not(.scrolled) .menu-button {
    color: white;
}

.home-page .nav-bar:not(.scrolled) .logo-white {
    display: block;
}

.home-page .nav-bar:not(.scrolled) .logo-black {
    display: none;
}


/* ===== 视频部分 ===== */
.video-container {
    position: relative;
    height: 75vh; /* 占页面3/4高度 */
    overflow: hidden;
}

video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== 导航栏 ===== */
.nav-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    padding: 20px 10px;
    z-index: 10;
    transition: transform 0.3s ease, opacity 0.3s ease, background-color 0.3s ease;
    opacity: 1;
    background-color: transparent;
    height: 80px;
    box-sizing: border-box;
}

.nav-bar.hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
}

.nav-bar.scrolled {
    position: fixed;
    background-color: white;
    align-items: center;
    opacity: 1;
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                background-color 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.menu-button {
    background: none;
    border: none;
    color: white;
    font-size: 4em;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    margin: 0;
    transition: color 0.3s ease;
    position: relative;
    z-index: 11;
}

.menu-button.scrolled {
    color: black;
}

.logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 25px; /* 固定距离视频播放区域顶部25px */
    transition: transform 0.3s ease, top 0.3s ease;
}

/* 新增：设置两个logo图片的样式 */
.logo-white, .logo-black {
    height: 40px;
    transition: all 0.3s ease;
}

/* 默认显示白色logo，隐藏黑色logo */
.logo-black {
    display: none;
}

.logo-white {
    display: block;
}

/* 滚动状态：隐藏白色logo，显示黑色logo */
.logo.scrolled .logo-white {
    display: none;
}

.logo.scrolled .logo-black {
    display: block;
}

/* 视频播放区域外，向上滑动时调整位置 */
.video-container-out .logo {
    left: calc(50% - 5px); /* 向左移动5px */
    top: 25px; /* 保持固定距离 */
}

.logo img {
    height: 40px;
    transition: all 0.3s ease;
}


/* ===== 向下箭头 ===== */
.down-arrow {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    cursor: pointer;
    animation: bounce 1s infinite;
    transition: transform 0.3s ease, bottom 0.3s ease;
    bottom: 25px; /* 固定距离视频播放区域底部25px */
}

/* 视频播放区域外，向上滑动时调整位置 */
.video-container-out .down-arrow {
    left: calc(50% - 5px); /* 向左移动5px */
    bottom: 25px; /* 保持固定距离 */
}

.down-arrow img {
    height: 20px;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(10px); }
}

/* ===== 下拉菜单 ===== */
.dropdown {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 66.67vh; /* 占屏幕高的2/3 */
    background: rgba(0, 0, 0, 0.95);
    display: none;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    z-index: 20;
    box-sizing: border-box;
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.dropdown.active {
    display: flex;
    transform: translateY(0);
    opacity: 1;
}

.dropdown.closing {
    animation: slideUp 0.3s ease forwards;
}

@keyframes slideUp {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(-100%); opacity: 0; }
}

.close-button {
    position: absolute;
    top: 10px; /* 固定离下拉模块顶边10px */
    left: 10px;
    background: none;
    border: none;
    color: white;
    font-size: 4em;
    font-weight: 100 !important; /* 细体不加粗 */
    cursor: pointer;
    line-height: 1;
    padding: 0;
    margin: 0;
}

/* 下拉菜单logo向下移动5px */
.dropdown-logo {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
}

.dropdown-logo img {
    height: 2em;
    width: auto;
}

/* 下拉菜单中的logo切换 */
.dropdown-logo .logo-white {
    display: block;
}

.dropdown-logo .logo-black {
    display: none;
}

.nav-links {
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* 均匀分布 */
    align-items: center;
    width: 100%;
    height: calc(100% - 80px); /* 留出空间给logo和叉号 */
    margin-top: 80px; /* 为顶部的叉号和logo留出空间 */
    padding-bottom: 0px !important; /* "联系我们"选项离底0px */
}

.nav-link {
    color: white;
    font-family: 'SimSun', serif;
    font-weight: bold;
    font-size: 20px !important; /* 20号字体 */
    text-decoration: none;
    transition: all 0.3s ease;
    text-align: center;
    padding: 10px 0;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-link:hover {
    font-size: 21px !important; /* 鼠标划过变大到21号 */
    color: white; /* 字体颜色不变 */
}

/* ===== 统计部分 ===== */
.stats-section {
    text-align: center;
    padding: 40px 20px;
    background-color: #ffffff;
}

.stats-image {
    width: 66.67%;
    max-width: 800px;
    margin: 0 auto 30px;
    display: block;
}

.stats-title {
    font-weight: bold;
    font-size: 2em;
    margin-bottom: 40px;
    color: #333;
}

.stats-grid {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}

.stat-item {
    flex: 1 1 20%;
    margin: 10px;
    font-size: 1.2em;
    min-width: 150px;
}

.stat-number {
    font-weight: bold;
    font-size: 3em;
    display: block;
    transition: none !important;
}

.stat-label {
    color: #666;
    font-size: 1em;
    margin-top: 10px;
}

/* ===== 服务项目部分 ===== */
.services-section {
    text-align: center;
    padding: 40px 20px 70px 20px;
    background-color: white;
}

.services-title {
    font-weight: bold;
    font-size: 2em;
    margin-bottom: 50px;
    color: #333;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px; /* 增加到原来的2倍 (原为2px) */
    max-width: 100%;
    margin: 0 auto;
}

.service-item {
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2em;
    text-decoration: none;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    z-index: 1;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
}

.service-item:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    z-index: 2;
}

/* 修正：确保每行的第二个、第四个、第六个等元素下移100px（原高度的1/4） */
.service-item:nth-child(12n+2),
.service-item:nth-child(12n+4),
.service-item:nth-child(12n+6),
.service-item:nth-child(12n+8),
.service-item:nth-child(12n+10),
.service-item:nth-child(12n+12) {
    top: 100px; /* 原高度的1/4 */
}

.service-item:nth-child(1) { background-color: #4CAF50; }
.service-item:nth-child(2) { background-color: #8BC34A; }
.service-item:nth-child(3) { background-color: #303F9F; }
.service-item:nth-child(4) { background-color: #FFEB3B; color: #333; }
.service-item:nth-child(5) { background-color: #F44336; }
.service-item:nth-child(6) { background-color: #2196F3; }
.service-item:nth-child(7) { background-color: #009688; }
.service-item:nth-child(8) { background-color: #FF9800; }
.service-item:nth-child(9) { background-color: #3F51B5; }
.service-item:nth-child(10) { background-color: #4CAF50; }
.service-item:nth-child(11) { background-color: #FF5722; }
.service-item:nth-child(12) { background-color: #E91E63; }

/* ===== 经典案例部分 ===== */
.cases-section {
    text-align: center;
    padding: 75px 20px 40px 20px;
    background-color: white;
}

.cases-title {
    font-weight: bold;
    font-size: 2em;
    margin-bottom: 55px !important; /* 间距55px */
    color: #333;
}

.cases-subtitle {
    font-size: 1.2em;
    margin-bottom: 40px;
    color: #000000 !important; /* 黑色高亮 */
    font-weight: 300 !important; /* 字体变细 */
    opacity: 0.9;
}

.cases-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto 40px;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.cases-grid.visible {
    opacity: 1;
}

.case-item {
    text-align: center;
    padding: 15px;
    background: white;
    text-decoration: none;
    transition: transform 0.3s ease;
    border-radius: 0;
    box-shadow: none !important;
    border: none !important; /* 移除四边线条 */
}

.case-item:hover {
    transform: translateY(-5px);
    /* 移除鼠标划过时的边框颜色变化 */
}

.case-item img {
    width: 100%;
    height: auto; /* 改为auto以保持图片完整性 */
    object-fit: contain; /* 改为contain以显示完整图片 */
    margin-bottom: 15px;
    max-height: 300px; /* 限制最大高度 */
    background-color: #f5f5f5; /* 加载前的背景色 */
}

.case-desc {
    color: #000000 !important; /* 黑色高亮 */
    font-size: 1em;
    margin: 5px 0;
    text-decoration: none;
    font-weight: 300 !important; /* 字体变细 */
    opacity: 0.9;
}

.case-title {
    font-weight: normal !important; /* 不加粗 */
    font-size: 1.5em !important; /* 变大0.5倍 (原1.1em * 1.5 ≈ 1.65em，这里取1.5em) */
    color: #000000 !important; /* 黑色高亮 */
    text-decoration: none;
    line-height: 1.4;
    text-align: center;
    padding: 0 100px !important; /* 离图片左右边固定100px */
    margin: 15px 0;
    word-wrap: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* 最多3行 */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.more-button {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 30px;
    background-color: #4CAF50;
    color: white;
    text-decoration: none;
    font-weight: bold;
    border-radius: 5px;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.more-button:hover {
    background-color: #45a049;
    transform: translateY(-2px);
}

/* ===== 合作客户部分 ===== */
.clients-section {
    text-align: center;
    padding: 40px 20px;
    background-color: white;
}

.clients-title {
    font-weight: bold;
    font-size: 2em;
    margin-bottom: 55px !important; /* 间距55px */
    color: #333;
}

.clients-subtitle {
    font-size: 1.2em;
    margin-bottom: 40px;
    color: #666;
    font-weight: normal;
}

.clients-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.client-item {
    text-align: center;
    padding: 20px;
    background: transparent !important; /* 背景色改为透明 */
    border-radius: 5px;
    transition: transform 0.3s ease;
}

.client-item:hover {
    transform: translateY(-5px);
}

.client-item img {
    width: 150px;
    height: 100px;
    object-fit: contain;
    background: transparent; /* 图片背景也改为透明 */
}

/* ===== 页脚 - 修复底部空白问题 ===== */
footer {
    background: black url('https://www.zanchengad.com/Style/images/Footer.png') no-repeat center center;
    background-size: cover;
    background-color: black;
    color: white;
    padding: 40px 20px;
    text-align: center;
    /* 修复底部空白问题 */
    flex-shrink: 0;
    margin-top: auto;
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: auto;
}

.footer-top, .footer-bottom {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.footer-branch {
    width: 300px;
    margin: 20px;
    text-align: left;
}

.footer-branch h3 {
    text-transform: uppercase;
    font-size: 1.5em;
    margin-bottom: 15px;
    color: #fff;
}

.footer-branch p {
    font-family: 'SimSun', serif;
    font-weight: normal;
    color: #ddd;
    line-height: 1.6;
    margin: 5px 0;
}

.footer-qr {
    width: 200px;
    height: auto;
    margin-top: 10px;
    border: 2px solid white;
    border-radius: 5px;
}

.footer-copyright {
    margin-top: 20px;
    font-family: 'SimSun', serif;
    font-weight: normal;
    color: #aaa;
    padding-top: 0;
    border-top: none !important;
}

/* ===== 媒体查询 - 移动端优化 ===== */
@media (max-width: 768px) {
    .video-desktop { display: none; }
    .video-mobile {
        display: block !important;
        background-color: #000; /* 视频加载前的背景色 */
    }

    .video-desktop {
        display: none !important;
    }

    /* 移动端服务项目样式 - 修正为两列且保持错开布局 */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        max-width: 95%;
    }

    .service-item {
        height: 400px !important; /* 保持和PC端相同高度 */
        font-size: 1.2em !important; /* 保持和PC端相同字体大小 */
        padding: 20px !important;
    }

    /* 移动端两列布局的错开效果 */
    /* 第一列：偶数项下移100px */
    .service-item:nth-child(2),
    .service-item:nth-child(4),
    .service-item:nth-child(6),
    .service-item:nth-child(8),
    .service-item:nth-child(10),
    .service-item:nth-child(12) {
        top: 100px !important;
    }

    /* 第二列：奇数项下移100px */
    .service-item:nth-child(1),
    .service-item:nth-child(3),
    .service-item:nth-child(5),
    .service-item:nth-child(7),
    .service-item:nth-child(9),
    .service-item:nth-child(11) {
        top: 0 !important;
    }

    .stats-grid {
        flex-direction: column;
        align-items: center;
    }

    .stat-item {
        flex: 1 1 100%;
        margin: 20px 0;
    }

    .cases-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .case-title {
        padding: 0 20px !important; /* 移动端减少边距 */
        font-size: 1.3em !important;
        -webkit-line-clamp: 4; /* 移动端可显示更多行 */
    }

    .case-item img {
        max-height: 250px; /* 移动端调整最大高度 */
    }

    .clients-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .client-item {
        padding: 15px;
    }

    .client-item img {
        width: 120px;
        height: 80px;
    }

    .footer-top, .footer-bottom {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-branch {
        width: 100%;
        margin: 15px 0;
        text-align: center;
    }

    /* 移动端页脚优化 */
    footer {
        padding: 30px 15px;
        background-size: contain;
    }

    .footer-top, .footer-bottom {
        margin-bottom: 20px;
    }

    /* 移动端下拉菜单保持66.67vh高度 */
    .dropdown {
        height: 66.67vh;
    }

    /* 确保导航栏在下拉菜单中保持白色 */
    .dropdown .nav-link {
        color: white !important;
    }

    .dropdown .nav-link:hover {
        color: white !important;
    }

    .nav-link {
        font-size: 18px !important;
    }

    .nav-link:hover {
        font-size: 19px !important;
    }

    .close-button {
        font-size: 3em;
    }
}

@media (min-width: 769px) {
    .video-desktop {
        display: block !important;
    }
    .video-mobile {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .video-container {
        height: 60vh;
    }

    .menu-button {
        font-size: 3em;
    }

    .close-button {
        font-size: 3em;
    }

    .down-arrow {
        bottom: 15px;
    }

    .down-arrow img {
        height: 15px;
    }

    /* 小屏手机保持两列布局但调整高度 */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 4px;
        max-width: 95%;
    }

    .service-item {
        height: 400px !important; /* 保持和PC端相同高度 */
        font-size: 1em !important; /* 稍微减小字体以适应小屏幕 */
        padding: 15px !important;
    }

    /* 保持错开布局 */
    .service-item:nth-child(2),
    .service-item:nth-child(4),
    .service-item:nth-child(6),
    .service-item:nth-child(8),
    .service-item:nth-child(10),
    .service-item:nth-child(12) {
        top: 100px !important;
    }

    .clients-grid {
        grid-template-columns: 1fr;
    }

    .stats-title, .services-title, .cases-title, .clients-title {
        font-size: 1.5em;
    }

    .stats-image {
        width: 90%;
    }

    .stat-number {
        font-size: 2.5em;
    }

    .case-title {
        padding: 0 10px !important;
        font-size: 1.2em !important;
    }

    /* 移动端footer进一步优化 */
    footer {
        padding: 20px 10px;
    }

    .footer-branch {
        margin: 10px 0;
        width: 100%;
    }

    .footer-qr {
        width: 150px;
    }
}

@media (max-width: 360px) {
    .nav-links {
        gap: 15px;
    }

    .nav-link {
        font-size: 16px !important;
    }

    /* 超小屏幕保持两列布局 */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2px;
    }

    .service-item {
        height: 400px !important; /* 保持和PC端相同高度 */
        font-size: 0.9em !important;
        padding: 10px !important;
    }

    /* 保持错开布局 */
    .service-item:nth-child(2),
    .service-item:nth-child(4),
    .service-item:nth-child(6),
    .service-item:nth-child(8),
    .service-item:nth-child(10),
    .service-item:nth-child(12) {
        top: 100px !important;
    }
}

/* ===== 图片加载状态样式 ===== */
.img-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== 右侧悬浮联系按钮 ===== */
.floating-contact {
    position: fixed;
    right: 20px;
    bottom: 100px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contact-button {
    position: relative;
    width: 50px;
    height: 50px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-medium);
    cursor: pointer;
    transition: all var(--transition-fast) ease;
    border: 1px solid #eee;
}

.contact-button:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-heavy);
}

.contact-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    transition: opacity var(--transition-fast) ease;
}

.contact-qr {
    position: absolute;
    right: 60px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    width: 120px;
    height: 120px;
    border-radius: var(--radius-md);
    border: 1px solid #ddd;
    background: white;
    padding: 5px;
    opacity: 0;
    transition: all var(--transition-normal) ease;
    box-shadow: var(--shadow-medium);
}

.contact-button:hover .contact-qr {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

.contact-button:hover .contact-logo {
    opacity: 0.7;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .floating-contact {
        right: 15px;
        bottom: 80px;
    }

    .contact-button {
        width: 45px;
        height: 45px;
    }

    .contact-logo {
        width: 22px;
        height: 22px;
    }

    .contact-qr {
        width: 100px;
        height: 100px;
        right: 55px;
    }

    /* 移动端触摸激活 */
    .contact-button.active .contact-qr {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }

    .contact-button.active .contact-logo {
        opacity: 0.7;
    }
}

@media (max-width: 480px) {
    .floating-contact {
        right: 10px;
        bottom: 70px;
    }

    .contact-button {
        width: 40px;
        height: 40px;
    }

    .contact-logo {
        width: 20px;
        height: 20px;
    }

    .contact-qr {
        width: 90px;
        height: 90px;
        right: 50px;
    }
}