/* ====== 全局样式 ====== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
/* 修改：为 body 增加 padding-top: 70px，防止 fixed 导航栏遮挡顶部内容 */
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif; line-height: 1.6; color: #333; background-color: #f9f9f9; padding-top: 70px; }

/* ====== 导航栏 (Fixed + 自动隐藏) ====== */
/* 修改：使用 fixed 定位，增加宽度和过渡动画 */
nav { position: fixed; top: 0; left: 0; width: 100%; z-index: 1000; background: white; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); padding: 0 5%; transition: transform 0.3s ease-in-out; }
/* 新增：隐藏导航栏的类（通过JS触发） */
nav.nav-hidden { transform: translateY(-100%); }

nav .container { display: flex; justify-content: space-between; align-items: center; height: 70px; max-width: 1400px; margin: 0 auto; }
.logo { font-size: 18px; font-weight: 700; color: #0066cc; text-decoration: none; display: flex; flex-direction: column; line-height: 1.2; }
.logo-main { font-size: 16px; font-weight: 700; }
.logo-sub { font-size: 11px; color: #666; }
nav ul { display: flex; list-style: none; gap: 40px; align-items: center; }
nav ul li { position: relative; } /* 为下拉菜单定位提供基准 */
nav a { text-decoration: none; color: #333; font-weight: 500; font-size: 14px; transition: color 0.3s; }
nav a:hover, nav a.active { color: #0066cc; }

/* ====== 下拉菜单样式 ====== */
.dropdown-menu { display: none; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); background-color: #ffffff; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); border-radius: 8px; padding: 10px 0; min-width: 200px; z-index: 1000; list-style: none; margin-top: 15px; }
.dropdown-menu::before { content: ""; position: absolute; top: -15px; left: 0; width: 100%; height: 15px; background: transparent; }
.dropdown-menu li { display: block; margin: 0; width: 100%; }
.dropdown-menu li a { display: block; padding: 12px 20px; color: #333333; font-size: 15px; text-align: center; transition: background-color 0.3s ease, color 0.3s ease; text-decoration: none; }
.dropdown-menu li a:hover { background-color: #f4f7fc; color: #0066cc; }
.dropdown:hover .dropdown-menu { display: block; }

/* ====== 容器与通用 ====== */
.container { max-width: 1400px; margin: 0 auto; padding: 0 5%; }
.section-title { font-size: 36px; font-weight: 700; text-align: center; margin: 60px 0 20px; color: #1a1a1a; }
.section-subtitle { font-size: 16px; text-align: center; color: #666; margin-bottom: 60px; }

/* ====== Hero 区 ====== */
.hero { background: linear-gradient(135deg, #0066cc 0%, #004a99 100%); color: white; padding: 100px 5%; text-align: center; }
.hero h1 { font-size: 48px; font-weight: 700; margin-bottom: 20px; line-height: 1.3; }
.hero p { font-size: 18px; margin-bottom: 40px; max-width: 700px; margin-left: auto; margin-right: auto; line-height: 1.6; }
.hero-buttons { display: flex; gap: 20px; justify-content: center; flex-wrap: wrap; }
.btn { padding: 12px 32px; font-size: 16px; font-weight: 600; border: none; border-radius: 6px; cursor: pointer; text-decoration: none; transition: all 0.3s; display: inline-block; }
.btn-primary { background-color: white; color: #0066cc; }
.btn-primary:hover { background-color: #f0f0f0; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15); }
.btn-secondary { background-color: transparent; color: white; border: 2px solid white; }
.btn-secondary:hover { background-color: white; color: #0066cc; transform: translateY(-2px); }

/* ====== 核心优势卡片 ====== */
.advantages { padding: 80px 5%; background: white; }
.advantages-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 40px; max-width: 1400px; margin: 0 auto; }
.advantage-card { padding: 40px; border-radius: 12px; background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%); border: 1px solid #e0e0e0; transition: all 0.3s; text-align: center; }
.advantage-card:hover { transform: translateY(-8px); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1); border-color: #0066cc; }
.advantage-icon { font-size: 40px; margin-bottom: 20px; }
.advantage-card h3 { font-size: 20px; margin-bottom: 15px; color: #1a1a1a; }
.advantage-card p { color: #666; line-height: 1.7; }

/* ====== 服务卡片网格 ====== */
.services-section { padding: 80px 5%; background: white; }
.services-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 30px; max-width: 1400px; margin: 0 auto; }
.service-card { border-radius: 12px; overflow: hidden; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08); transition: all 0.3s; background: white; }
.service-card:hover { transform: translateY(-12px); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15); }
.service-card-header { height: 180px; background: linear-gradient(135deg, #0066cc 0%, #004a99 100%); display: flex; align-items: center; justify-content: center; color: white; font-size: 50px; }
.service-card-body { padding: 30px; }
.service-card h3 { font-size: 22px; margin-bottom: 12px; color: #1a1a1a; }
.service-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 15px; }
.tag { display: inline-block; padding: 4px 12px; background-color: #e8f0ff; color: #0066cc; border-radius: 20px; font-size: 12px; font-weight: 600; }
.service-card p { color: #666; font-size: 14px; line-height: 1.7; margin-bottom: 20px; min-height: 70px; }
.service-buttons { display: flex; gap: 10px; }
.btn-small { padding: 8px 16px; font-size: 14px; border-radius: 6px; border: none; cursor: pointer; text-decoration: none; transition: all 0.3s; flex: 1; text-align: center; }
.btn-small-primary { background-color: #0066cc; color: white; }
.btn-small-primary:hover { background-color: #0052a3; }
.btn-small-secondary { background-color: #f0f0f0; color: #0066cc; border: 1px solid #0066cc; }
.btn-small-secondary:hover { background-color: #e8f0ff; }

/* ====== 公司动态 (News) ====== */
.news-section { padding: 80px 5%; background: #f9f9f9; }
.news-list { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.news-item { background: white; padding: 30px; border-radius: 12px; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05); text-decoration: none; display: block; color: inherit; transition: all 0.3s; border-left: 4px solid transparent; }
.news-item:hover { transform: translateX(8px); box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1); border-left-color: #0066cc; }
.news-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.news-title { font-size: 20px; font-weight: 700; color: #1a1a1a; margin: 0; }
.news-date { font-size: 14px; color: #0066cc; font-weight: 600; }
.news-desc { color: #666; font-size: 15px; margin: 0; line-height: 1.6; }

/* ====== CTA 区 ====== */
.cta-banner { background: linear-gradient(135deg, #0066cc 0%, #004a99 100%); color: white; padding: 80px 5%; text-align: center; margin: 80px 0; }
.cta-banner h2 { font-size: 36px; margin-bottom: 20px; font-weight: 700; }
.cta-banner p { font-size: 18px; margin-bottom: 40px; line-height: 1.6; }

/* ====== 页脚 ====== */
footer { background-color: #1a1a1a; color: white; padding: 60px 5%; }
footer .container { max-width: 1400px; margin: 0 auto; }
footer-content { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 40px; margin-bottom: 40px; }
footer h4 { font-size: 16px; margin-bottom: 20px; font-weight: 700; }
footer p, footer a { color: #ccc; font-size: 14px; line-height: 1.8; text-decoration: none; transition: color 0.3s; }
footer a:hover { color: white; }
footer-bottom { border-top: 1px solid #333; padding-top: 30px; text-align: center; color: #999; font-size: 13px; display: block; }

/* ====== 页面内容区 (子页面) ====== */
.page-content { min-height: calc(100vh - 200px); padding: 60px 5%; background: white; }
.page-header { text-align: center; margin-bottom: 60px; }
.page-header h1 { font-size: 42px; font-weight: 700; margin-bottom: 15px; color: #1a1a1a; }
.page-header p { font-size: 16px; color: #666; max-width: 600px; margin: 0 auto; line-height: 1.7; }

/* ====== 响应式 & 移动端专项优化 ====== */
@media (max-width: 768px) {
    
    /* 1. 调整页面顶部间距，适应双行堆叠的导航栏（防止遮挡内容） */
    body { 
        padding-top: 105px !important; 
    }

    /* 2. 导航栏容器：Logo在上，菜单在下，获得充足横向空间 */
    nav .container { 
        /* flex-direction: column !important; */
        height: auto !important; 
        padding: 10px 15px !important; 
        gap: 8px !important;
        align-items: center !important;
    }

    /* 3. 导航菜单：强制单行不换行，且水平居中
    nav ul { 
        gap: 12px !important; 
        flex-wrap: nowrap !important; / * 绝对禁止折行 * /
        justify-content: center !important; 
        width: 100% !important;
        padding: 4px 0 !important;
    }
    */
nav ul { 
    gap: 12px !important; 
    flex-wrap: nowrap !important; /* 绝对禁止折行 */
    
    /* 1. 必须改成 flex-start（左对齐）*/
    /* 这样超出屏幕的菜单只会往右边排，用户才可以完美地向右滑动查看更多 */
    justify-content: flex-start !important; 
    
    width: 100% !important;
    padding: 4px 10px !important; /* 稍微加一点两侧内边距，滑到边缘时更好看 */
    
    /* 2. 核心：开启横向滚动 */
    overflow-x: auto !important; /* 当内容超出宽度时，自动允许横向滚动选择 */
    -webkit-overflow-scrolling: touch; /* 极大提升苹果手机（iOS）上滚动的丝滑感和回弹阻尼感 */
    
    /* 3. 隐藏 Firefox 默认的难看滚动条 */
    scrollbar-width: none !important; 
}

/* 4. 隐藏 Chrome, Safari 和 Edge 默认的难看滚动条，保持界面极简干净 */
nav ul::-webkit-scrollbar {
    display: none !important;
}

/* 5. 必须配合：防止里面的子项被挤扁 */
nav ul li {
    flex-shrink: 0 !important; /* 绝对禁止菜单项被自动压缩变窄，确保文字完整显示 */
    white-space: nowrap !important; /* 强制里面的文字不换行 */
}

    nav a { 
        font-size: 13px !important; 
        white-space: nowrap !important; /* 强制文字不换行 */
        padding: 4px 2px !important;
    }

    /* 4. 彻底解决二级菜单出屏、往上漂移的问题
       保持绝对定位（不撑开父级高度），靠右对齐（因为服务概览在右侧，向左展开绝不出屏） */
    .dropdown-menu {
        position: absolute !important;
        top: 100% !important; /* 紧贴“服务概览”下方 */
        left: auto !important; /* 移除原本的居中定位 */
        right: 0 !important;  /* 靠右对齐，确保向左侧安全展开 */
        transform: none !important; /* 清除居中偏移 */
        margin-top: 10px !important;
        background-color: #ffffff !important;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15) !important;
        border-radius: 8px !important;
        min-width: 180px !important;
        z-index: 1010 !important;
        display: none !important; /* 默认隐藏 */
    }

    /* 悬停/触摸展示二级菜单 */
    .dropdown:hover .dropdown-menu {
        display: block !important;
    }

    /* 二级菜单项样式微调 */
    .dropdown-menu li {
        width: 100% !important;
    }

    .dropdown-menu li a {
        padding: 10px 16px !important;
        font-size: 13px !important;
        text-align: left !important; /* 靠左对齐，更符合手机端阅读习惯 */
        background: transparent !important;
        color: #333333 !important;
    }

    .dropdown-menu li a:hover {
        background-color: #f4f7fc !important;
        color: #0066cc !important;
    }
    
    /* 5. 页面其他组件的移动端适配 */
    .hero h1 { font-size: 32px; }
    .hero p { font-size: 16px; }
    .hero-buttons { flex-direction: column; }
    .btn { width: 100%; }
    .section-title { font-size: 28px; }
    .services-grid { grid-template-columns: 1fr; }
    .news-header { flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* ====== 隐藏类（用于SPA页面切换，请务必保留） ====== */
.hidden { display: none; }
.visible { display: block; }