﻿/* 全局清除浮动工具类 */
.clearfix::after {
    content: "";
    display: block;
    clear: both;
    visibility: hidden;
    height: 0;
}

.clearfix {
    zoom: 1;
}

ul, li {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* 全局变量统一管理颜色，方便后期改主题 */
:root {
    --nav-main: #3498db;
    --nav-hover: #0f4e83;
    --nav-border: #03712F;
    --text-dark: #383838;
    --text-blue: #06c;
    --white: #fff;
    --container-width: 1200px;
}

.top-nav {
    width: 100%;
    margin: 0 0 10px;
}

/* 固定1200px 居中 */
.top-contact {
    width: 1200px;
    margin: 0 auto;
    padding: 0;
    height: 80px;
    display: flex;
    align-items: center;
    /* 删掉 space-between，改用 margin-left:auto 实现靠右 */
}

/* ========== 新增修改：logo区域弹性布局，图片文字同行 ========== */
.top-logo {
    display: flex;
    align-items: center;
    gap: 10px; /* logo图和文字间距 */
}

    .top-logo img {
        width: 168px;
        height: 55px;
        display: block;
    }

    /* logo副标题样式，可自行调整字号颜色 */
    .top-logo span {
        font-size: 18px;
        color: var(--text-dark);
        white-space: nowrap; /* 强制不换行 */
        font-weight: 500;
        margin-top:17px;
    }

/* 右侧联系栏关键 */
.top-tel {
    margin-left: auto; /* 自动占满剩余空间，推到最右 */
    display: flex;
    gap: 20px;
    flex-shrink: 0; /* 不压缩宽度 */
    margin-top: 15px;
}

    .top-tel li {
        font-size: 12px;
        color: var(--text-dark);
        white-space: nowrap;
        display: flex;
        align-items: center; /* 图标文字垂直居中 */
        gap: 6px; /* 图标和文字距离 */
    }

        /* Layui图标统一大小、颜色 */
        .top-tel li .layui-icon {
            font-size: 14px;
            color: var(--text-blue);
        }

    .top-tel span {
        color: var(--text-blue);
    }

/* 导航栏容器 */
.kc-nav {
    background-color: var(--nav-main);
    width: 100%;
}

.nav-list {
    max-width: var(--container-width);
    margin: 0 auto;
    display: flex; /* 弃用float，弹性布局无塌陷 */
}

.nav-item {
    flex: 0 0 150px;
    height: 60px;
    line-height: 60px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease; /* 同时过渡背景+边框 */
}

    .nav-item a {
        display: block;
        width: 100%;
        height: 100%;
        color: var(--white);
        font-size: 16px;
        text-decoration: none;
    }
    /* hover 样式 */
    .nav-item:hover {
        background-color: var(--nav-hover);
        border-bottom: 5px solid var(--nav-border);
    }
    /* 当前激活页 */
    .nav-item.active {
        background-color: var(--nav-hover);
        border-bottom: 5px solid var(--nav-border);
    }



/* ============ 移动端媒体查询【优化重写】 ============ */
@media screen and (max-width: 1240px) {
    .top-contact, .nav-list {
        padding: 0 15px;
    }
}

@media screen and (max-width: 768px) {
    .top-contact {
        width: 100%;
        flex-direction: column;
        height: auto;
        padding: 15px;
        gap: 12px;
    }
    /* Logo居中 */
    .top-logo {
        justify-content: center;
    }

        .top-logo img {
            width: 140px;
            height: auto;
        }

        .top-logo span {
            font-size: 16px;
        }

    .top-tel {
        margin-left: unset;
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px 16px;
    }

        .top-tel li {
            font-size: 11px;
        }

    /* 导航适配 */
    .nav-list {
        flex-wrap: wrap;
        padding: 0;
    }

    .nav-item {
        flex: 1 0 calc(50% - 2px);
        min-width: auto;
        height: 50px;
        line-height: 50px;
    }
}