:root {
    --theme-style: #325398;
}

a {
    color: black;
    text-decoration: none;
}

/* 基础头部外壳 */
.header-container {
    width: 80vw;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 auto;
    padding: 10px 0;
    position: relative;
}

.header-container .logo {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
}

/* 小三角通用样式 */
.caret-pc {
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 4px;
    vertical-align: middle;
    border-top: 4px solid;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
    transition: transform 0.2s ease;
}


/* ================================================================= */
/* 【大屏幕样式控制】(>= 768px) */
/* ================================================================= */
@media (min-width: 768px) {

    /* 强行隐藏小屏幕特有菜单组件 */
    .nav-mobile-actions,
    .nav-mobile-collapse {
        display: none !important;
    }

    /* 显示 PC 端菜单组件 */
    .nav-pc {
        display: flex;
        align-items: center;
        flex: 1;
        justify-content: flex-end;
    }

    .menu-pc {
        list-style: none;
        display: flex;
        gap: 30px;
        margin: 0;
        padding: 0;
    }

    .menu-pc li {
        border-bottom: 3px solid transparent;
        border-top: 3px solid transparent;
        padding: 5px 0;
        transition: .3s;
        white-space: nowrap;
    }

    .menu-pc li.active {
        border-bottom: 3px solid var(--theme-style);
    }

    .menu-pc li.active a {
        color: var(--theme-style);
    }

    .menu-pc li:hover {
        border-bottom: 3px solid var(--theme-style);
    }

    .menu-pc li:hover a {
        color: var(--theme-style);
    }

    /* PC 搜索框 */
    .search-wrapper-pc {
        display: flex;
        align-items: center;
        margin-left: 20px;
    }

    .search-form-pc {
        position: relative;
        display: flex;
        align-items: center;
        border: 1px solid transparent;
        border-radius: 20px;
        padding: 2px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .search-input-pc {
        width: 0px;
        height: 32px;
        border: none;
        background: none;
        outline: none;
        padding: 0;
        font-size: 13px;
        color: #1e293b;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        opacity: 0;
    }

    .search-btn-pc {
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        border-radius: 50%;
        transition: background-color 0.2s;
    }

    .search-btn-pc:hover {
        background-color: #e2e8f0;
    }

    .search-form-pc.open {
        background-color: #ffffff;
        border-color: var(--theme-style, #0052a3);
        box-shadow: 0 2px 10px rgba(0, 51, 102, 0.08);
    }

    .search-form-pc.open .search-input-pc {
        width: 180px;
        padding: 0 10px 0 15px;
        opacity: 1;
    }

    .search-form-pc .search-btn-pc svg path {
        fill: var(--theme-style);
    }

    /* PC 语言切换悬浮 */
    /* PC 语言切换容器 */
    .lang-switch-pc {
        list-style: none;
        margin: 0 0 0 20px;
        padding: 0;
        display: flex;
        align-items: center;
        height: 100%;
        /* 确保撑满高度，增大鼠标感应区 */
    }

    .dropdown-pc {
        position: relative;
        padding: 10px 0;
        /* 给父级上下加一点内边距，让悬停感应区域无缝连接 */
    }

    .dropdown-menu-pc {
        display: none;
        position: absolute;
        right: 0;
        left: auto;
        top: 100%;
        /* 紧贴父级底部 */
        z-index: 1050;
        min-width: 120px;
        padding: 5px 0;
        margin: 0;
        /* 彻底清除额外的 margin，防止断开 */
        list-style: none;
        background-color: #fff;
        border-radius: 4px;
        box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
    }

    /* 【核心黑魔法】：给下拉菜单顶部加一个透明的“隐形桥梁” */
    .dropdown-menu-pc::before {
        content: "";
        position: absolute;
        top: -20px;
        /* 向上延伸 20px 的透明感应区 */
        left: 0;
        width: 100%;
        height: 20px;
        background: transparent;
        /* 透明的，用户看不见，但鼠标移过去不会断开 hover */
    }

    .dropdown-menu-pc a {
        display: block;
        padding: 8px 15px;
        color: #333;
        white-space: nowrap;
    }

    .dropdown-menu-pc a:hover {
        color: var(--theme-style);
        background-color: #f8fafc;
    }

    /* 触发悬停显示 */
    .dropdown-pc:hover .dropdown-menu-pc {
        display: block !important;
    }

    .dropdown-pc:hover .caret-pc {
        transform: rotate(180deg);
    }
}


@media (max-width: 767px) {

    .nav-pc {
        display: none !important;
    }

    .header-container {
        width: 100%;
        padding: 10px 15px;
        box-sizing: border-box;
    }

    .nav-mobile-actions {
        display: flex;
        align-items: center;
        gap: 15px;
    }

    .menu-toggle-mobile {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        width: 26px;
        height: 18px;
        cursor: pointer;
        background: transparent;
        border: none;
        padding: 0;
    }

    .menu-toggle-mobile span {
        display: block;
        width: 100%;
        height: 2.5px;
        background-color: #475569;
        border-radius: 3px;
        transition: all 0.3s ease;
    }

    .menu-toggle-mobile.active span:nth-child(1) {
        transform: translateY(7.5px) rotate(45deg);
    }

    .menu-toggle-mobile.active span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle-mobile.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* 移动端顶层右边 语言切换按钮样式 */
    .lang-switch-mobile {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    .dropdown-mobile {
        position: relative;
    }

    .dropdown-toggle-mobile {
        display: inline-block;
        padding: 5px 10px;
        background: #f1f5f9;
        border-radius: 4px;
        font-size: 13px;
        color: #475569;
    }

    /* 移动端点击语言弹出的气泡菜单 */
    .dropdown-menu-mobile {
        display: none;
        position: absolute;
        right: 0;
        top: 100%;
        margin-top: 8px;
        background: #ffffff;
        min-width: 100px;
        list-style: none;
        padding: 5px 0;
        border-radius: 4px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        z-index: 1100;
    }

    .dropdown-menu-mobile a {
        display: block;
        padding: 8px 15px;
        font-size: 13px;
        color: #333;
        text-align: center;
    }

    /* 手机端隐藏的折叠菜单栏（仅含主菜单和搜索） */
    .nav-mobile-collapse {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #ffffff;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
        padding: 15px 20px;
        box-sizing: border-box;
        z-index: 1000;
        flex-direction: column;
    }

    .nav-mobile-collapse.show {
        display: flex !important;
    }

    .menu-mobile {
        list-style: none;
        padding: 0;
        margin: 0;
        display: flex;
        flex-direction: column;
        width: 100%;
    }

    .menu-mobile li {
        width: 100%;
    }

    .menu-mobile li a {
        display: block;
        padding: 12px 0;
        border-bottom: 1px solid #f1f5f9;
        font-size: 15px;
    }

    .menu-mobile li.active a {
        color: var(--theme-style);
        font-weight: bold;
    }

    /* 手机端搜索栏：平铺整行 */
    .search-wrapper-mobile {
        width: 100%;
        margin-top: 15px;
    }

    .search-form-mobile {
        width: 100%;
    }

    .search-input-mobile {
        width: 100%;
        height: 38px;
        background-color: #f1f5f9;
        border: none;
        border-radius: 6px;
        padding: 0 15px;
        box-sizing: border-box;
        outline: none;
        font-size: 14px;
    }

    /* 手机端搜索外壳 */
    .search-wrapper-mobile {
        width: 100%;
        margin-top: 15px;
    }

    /* 让表单容器具备相对定位，以便让按钮绝对定位在右侧 */
    .search-form-mobile {
        position: relative;
        width: 100%;
        display: flex;
        align-items: center;
    }

    /* 输入框样式微调：留出右侧 45px 的空间防止文字盖住按钮 */
    .search-input-mobile {
        width: 100%;
        height: 40px;
        background-color: #f1f5f9;
        border: none;
        border-radius: 20px;
        /* 改用圆角和整体风格更搭 */
        padding: 0 45px 0 15px;
        box-sizing: border-box;
        outline: none;
        font-size: 14px;
        color: #1e293b;
    }

    .search-btn-mobile {
        position: absolute;
        right: 5px;
        top: 50%;
        transform: translateY(-50%);
        width: 34px;
        height: 34px;
        background: transparent;
        border: none;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

    .search-btn-mobile:active svg path {
        fill: var(--theme-style);
    }
}