/* 全局重置 */
* {
    box-sizing: border-box;
}

:root {
    --header-height: 64px;
}

body {
    margin: 0;
    padding: 0;
}

/* --- Header 主体 --- */
header {
    height: var(--header-height);
    width: 100%;
    background: #fff;
    position: fixed; /* 关键：固定定位 */
    left: 0;
    top: 0;
    z-index: 1000;
    transition: background 0.3s ease, box-shadow 0.3s ease;
    box-shadow: none;
}
body.sticky header{
    position: sticky;
}

/* 滚动后仅添加阴影，其余样式与默认一致 */
header.scrolled {
    box-shadow: 0px 2px 10px 0px rgba(0,0,0,0.1);
}

.header-container {
    width: 100%;
    max-width: 1200px;
    height: 100%;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Logo */
.header-container .logo {
    width: 160px;
    height: 32px;
    flex-shrink: 0;
}

.header-container .logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 桌面端导航链接 */
.header-container .nav-links {
    display: flex;
    align-items: center;
    flex: 1;
    margin-left: 40px;
    justify-content: flex-start;
}

.header-container .nav-links p {
    margin: 0;
    margin-right: 30px;
}

.header-container .nav-links p:last-child {
    margin-right: 0;
}

.header-container .nav-links a {
    font-size: 16px;
    color: #333333;
    text-decoration: none;
    transition: color 0.3s;
    white-space: nowrap;
}

.header-container .nav-links .active a {
    color: #4671FE;
    font-weight: bold;
}

.header-container .nav-links a:hover {
    color: #4671FE;
}

/* 桌面端按钮组 */
.header-container .nav-btns { 
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.header-container .nav-btns .nav-phone {
    display: flex;
    align-items: center;
    text-decoration: none;
    margin-right: 8px;
    white-space: nowrap;
}

.header-container .nav-btns .nav-phone img {
    width: 20px;
    height: 20px;
    margin-right: 6px;
    flex-shrink: 0;
}

.header-container .nav-btns .nav-phone-num {
    font-size: 16px;
    font-weight: 600;
    color: #333333;
    transition: color 0.3s;
}

.header-container .nav-btns .nav-phone:hover .nav-phone-num {
    color: #4671FE;
}

.header-container .nav-btns .btn {
    width: 104px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 4px;
    background: #4671FE;
    font-size: 14px;
    color: #FFFFFF;
    margin-left: 12px;
    border: none;
    cursor: pointer;
    transition: opacity 0.3s;
}

.header-container .nav-btns .btn:hover {
    opacity: 0.9;
}

.header-container .nav-btns .btn-outline {
    border: 1px solid #4671FE;
    background-color: transparent;
    color: #4671FE;
}


/* --- 移动端菜单按钮 (汉堡图标) --- */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    cursor: pointer;
    z-index: 1001;
}

.mobile-menu-btn span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #333;
    border-radius: 2px;
    transition: all 0.3s ease;
    pointer-events: none;
}

/* 汉堡菜单激活状态动画 */
.mobile-menu-btn.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}
.mobile-menu-btn.open span:nth-child(2) {
    opacity: 0;
}
.mobile-menu-btn.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}


/* 首页、产品介绍、解决方案：为固定头部预留空间，避免顶部内容被遮挡 */
body.page-index main,
body.page-product main,
body.page-solution main {
    padding-top: var(--header-height);
}

/* --- 移动端下拉菜单 --- */
.mobile-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    flex-direction: column;
    padding: 20px;
    z-index: 999;
    max-height: 80vh;
    overflow-y: auto;
}

.mobile-nav a {
    display: block;
    padding: 12px 0;
    color: #333;
    text-decoration: none;
    font-size: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.mobile-nav a:last-of-type {
    border-bottom: none;
}

.mobile-nav a.active {
    color: #4671FE;
    font-weight: bold;
}

.mobile-btn-group {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-phone {
    display: block;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    padding: 8px 0;
}

.mobile-btn-row {
    display: flex;
    gap: 10px;
}

.mobile-btn-row .btn {
    flex: 1;
    margin-left: 0;
}


/* --- 响应式媒体查询 --- */

/* 平板及手机 (<= 992px) */
@media screen and (max-width: 992px) {
    .header-container .nav-links,
    .header-container .nav-btns {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }
    
    .header-container {
        justify-content: space-between;
    }
}

/* 小手机 (<= 768px) 的额外微调 */
@media screen and (max-width: 768px) {
    .header-container .logo {
        width: 140px;
        height: 28px;
    }
}