@import url('https://fonts.googleapis.com/css2?family=ZCOOL+KuaiLe&display=swap');

* {
    margin: 0;
    padding: 0;
    /* 加上，彻底消除浏览器默认间距 */
    box-sizing: border-box;
}

.box {
    margin: 0 auto;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 9px;
    height: 50px;
    margin-right: 60px;
}

.logo img {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    display: block;
}

.logo_name {
    font-family: "ZCOOL KuaiLe", "楷体", "KaiTi", "STKaiti", serif;
    font-size: 22px;
    font-weight: 700;
    color: #1a202c;
    letter-spacing: 1px;
    white-space: nowrap;
    line-height: 1;
}

/* 名字后半"点解"用主色强调，微倾斜破板正 */
.logo_name em {
    font-style: normal;
    color: #ff7f50;
    font-size: 25px;
    display: inline-block;
    transform: rotate(-4deg);
}

/* 尾部问号点缀："点解"=为什么，俏皮点题 */
.logo_name::after {
    content: "?";
    color: #ff7f50;
    font-size: 15px;
    font-weight: 700;
    margin-left: 2px;
}

.menu_chunk {
    height: 70px;
    justify-content: center;
    align-items: center;
    display: flex;
    position: sticky;
    top: 0;
    background-color: #ffffff;
    z-index: 999;
    border-bottom: 1px solid #eef0f3;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    margin: 0;
    padding: 0;
}

.menu_bar {
    width: 1200px;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.menu_bar ul{
    list-style: none;
    display: flex;
    color: #333;
    gap: 8px;
}

.menu_bar li {
    font-size: 15px;
    color: #333;
}

.menu_bar ul li a {
    position: relative;
    display: block;
    text-decoration: none;
    color: #2c3e50;
    line-height: 70px;
    padding: 0 18px;
    transition: color 0.25s ease;
    white-space: nowrap; /* 导航项中文不换行：ul 被压缩时宁可整体缩也不让单项竖排 */
}

/* 底部下划线（默认隐藏） */
.menu_bar ul li a::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #3498db, #2980b9);
    border-radius: 2px;
    transform: translateX(-50%);
    transition: width 0.3s ease;
}

.menu_bar ul li a:hover {
    color: #3498db;
}

.menu_bar ul li a:hover::after {
    width: 60%;
}

/* 当前页高亮 */
.menu_bar ul li a.active {
    color: #3498db;
    font-weight: 600;
}

.menu_bar ul li a.active::after {
    width: 60%;
}

/* 搜索按钮美化 */
/* 搜索区整体：可被压缩（空间不足时先缩输入框），但按钮必须完整横排——桌面/移动共用 */
.search {
    display: flex;
    align-items: center;
    flex: 0 1 auto;
    min-width: 0;
}
.search button{
    height: 30px;
    padding: 0 16px;
    border-radius: 12px;
    outline: none;
    background-color: #3498db;
    color: #ffffff;
    border: none;
    margin-left: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.25s ease;
    flex-shrink: 0;        /* 按钮不被 flex 压缩 */
    white-space: nowrap;   /* 「确认」两字永不换行 */
    min-width: 54px;       /* 保底宽度：两字 26px + padding */
}

.search button:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(52, 152, 219, 0.3);
}

.search button:active {
    transform: translateY(0);
}

.search input {
  width: 100%;
  max-width: 220px;
  min-width: 120px;    /* 保底宽度：空间不足时输入框先缩，缩到 120px 为止 */
  height: 30px;
  padding: 12px;
  border-radius: 12px;
  border: 1.5px solid #e0e4e8;
  outline: none;
  transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
  box-shadow: 0px 0px 20px -18px;
}

.search input:hover {
  border-color: #c8d0d8;
}

.search input:active {
  transform: scale(0.95);
}

.search input:focus {
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
}

/* ==================== 移动端适配（断点 768px） ==================== */
/* 核心思路：导航宽度从写死 1200px 改为自适应，内部横向滚动而不是挤压换行 */
@media (max-width: 768px) {
    /* 导航容器：保持 sticky 固定顶部，纯白背景防穿透 */
    .menu_chunk {
        height: 56px;
        position: sticky;
        top: 0;
        left: 0;
        right: 0;
        width: 100%;
        z-index: 999;
        background-color: #ffffff;
        overflow: hidden; /* 防止子元素溢出 */
    }

    /* 导航条：宽度改为 100% + 左右安全内边距，内部允许横向滚动 */
    .menu_bar {
        width: 100%;
        max-width: none;
        height: 100%;
        padding: 0 12px;
        display: flex;
        justify-content: flex-start;
        align-items: center;
        gap: 8px;
    }

    /* Logo：缩小尺寸，右边距从 60px 大幅收敛 */
    .logo {
        height: 40px;
        margin-right: 0;
        flex-shrink: 0;
        gap: 6px;
    }

    .logo img {
        width: 28px;
        height: 28px;
    }

    .logo_name {
        font-size: 17px;
        white-space: nowrap;
    }

    .logo_name em {
        font-size: 19px;
    }

    .logo_name::after {
        font-size: 12px;
    }

    /* 导航链接列表：flex:1 1 0 + min-width:0 让 ul 只占据剩余空间，
       内容超出时 ul 自身内部横向滚动，不再把 .search 挤爆 */
    .menu_bar ul {
        flex: 1 1 0;
        min-width: 0;
        flex-wrap: nowrap;
        gap: 2px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox 隐藏滚动条 */
    }

    .menu_bar ul::-webkit-scrollbar {
        display: none; /* Chrome/Safari 隐藏滚动条 */
    }

    .menu_bar li {
        font-size: 13px;
        flex-shrink: 0;
    }

    .menu_bar ul li a {
        line-height: 56px;
        padding: 0 10px;
        font-size: 13px;
        white-space: nowrap;
        min-height: 40px; /* 触控区域 ≥ 40px */
        display: inline-flex;
        align-items: center;
    }

    /* 搜索区：整体可压缩与按钮保护（flex-shrink:0/nowrap/min-width）已上提为通用规则，
       这里只留移动端差异：输入框允许压到更窄、按钮内边距与字号收敛 */
    .search input {
        flex: 1 1 auto;
        min-width: 0;   /* 覆盖通用 120px：移动端空间紧，输入框可压到更窄 */
        width: auto;
        max-width: none;
        height: 30px;
        padding: 0 8px;
        font-size: 12px;
    }

    .search button {
        height: 30px;
        line-height: 30px;
        padding: 0 12px;
        margin-left: 6px;
        font-size: 12px;
    }
}