/* 顶栏 gate 区域公共样式：flex 消除「年度盘点」与搜索框之间的 float 空隙 */
#com-header > .gate {
    float: right;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 0;
    height: 4.5rem;
    font-size: 0;
}

#com-header > .gate > a.gate-promo,
#com-header > .gate > .com-search-zl,
#com-header > .gate > .notify,
#com-header > .gate > .user {
    font-size: 1rem;
}

/* 覆盖 xui：#com-header > .gate > * { float: left }，避免盘点图与搜索框之间留出 float 空隙 */
#com-header > .gate > * {
    float: none !important;
}

#com-header > .gate > a.gate-promo {
    display: flex;
    align-items: center;
    height: 4.5rem;
    padding: 0;
    margin: 0;
    border-right: 1px solid #5673ba;
    box-sizing: border-box;
    line-height: 0;
    flex-shrink: 0;
}

#com-header > .gate > a.gate-promo img {
    height: 4.5rem;
    width: auto;
    display: block;
    object-fit: contain;
}

#com-header > .gate > .com-search-zl {
    position: relative;
    margin: 0 !important;
    padding: 0 !important;
    flex-shrink: 0;
}

#com-header > .gate > .com-search-zl > .search-content {
    position: relative;
    overflow: visible;
    height: 4.5rem;
    width: 26rem;
    margin: 0;
    box-sizing: border-box;
}

#com-header > .gate .ajaxTextResult {
    z-index: 2002;
}

/* 未加载 xui.js 的页面（如 admin_users.php）：顶栏用户菜单与下拉 */
#com-header > .gate > .user {
    position: relative;
}

#com-header > .gate > .user > .dropdown-menu {
    display: none;
    z-index: 2105;
}

#com-header > .gate > .user:hover > .dropdown-menu,
#com-header > .gate > .user:focus-within > .dropdown-menu,
#com-header > .gate > .user.is-open > .dropdown-menu {
    display: block;
}

/*
 * 部分页面（xingtai.php / futures.php 等）在 head 引入了 Bootstrap 5，
 * 会覆盖 xui 顶栏配色（右上角通知/用户按钮变 Bootstrap 蓝、面包屑变暗等）。
 */
#com-header {
    background-color: #2c50a9 !important;
}

#com-header > .breadcrumb-wrap > .breadcrumb {
    background: transparent !important;
    --bs-breadcrumb-divider-color: rgba(255, 255, 255, 0.65);
}

#com-header > .breadcrumb-wrap > .breadcrumb,
#com-header > .breadcrumb-wrap > .breadcrumb a,
#com-header > .breadcrumb-wrap > .breadcrumb span,
#com-header > .breadcrumb-wrap > .breadcrumb > li,
#com-header > .breadcrumb-wrap > .breadcrumb .icon {
    color: #fff !important;
}

#com-header > .gate > .com-search-zl > .search-content {
    background-color: #233f85 !important;
}

#com-header > .gate #queryInput,
#com-header > .gate .ajaxTextInput {
    background-color: transparent !important;
    color: #fff !important;
    border: none !important;
    box-shadow: none !important;
}

#com-header > .gate .search-title {
    color: #fff !important;
}

/* 通知、用户两格：等高居中（覆盖 xui 对 .notify .icon 的 translateY） */
#com-header > .gate > .notify,
#com-header > .gate > .user {
    height: 4.5rem;
    box-sizing: border-box;
}

#com-header > .gate > .notify > .btn,
#com-header > .gate > .user > .btn.btn-primary {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: top !important;
    min-height: 4.5rem !important;
    max-height: 4.5rem !important;
    line-height: 1 !important;
}

#com-header > .gate > .notify > .btn > .icon,
#com-header > .gate > .user > .btn > .icon {
    transform: none !important;
    margin: 0 !important;
    line-height: 1 !important;
    font-size: 1.5rem;
    display: block;
}

#com-header > .gate .btn.btn-primary {
    width: 4.5rem;
    height: 4.5rem;
    padding: 0;
    line-height: 1;
    font-size: 1.5rem;
    color: #fff !important;
    background-color: transparent !important;
    background-image: none !important;
    border-radius: 0 !important;
    border-top: none !important;
    border-bottom: none !important;
    border-left: none !important;
    border-right: 1px solid #5673ba !important;
    box-shadow: none !important;
    --bs-btn-bg: transparent;
    --bs-btn-border-color: #5673ba;
    --bs-btn-color: #fff;
    --bs-btn-hover-bg: rgba(255, 255, 255, 0.1);
    --bs-btn-hover-border-color: #5673ba;
    --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: #234089;
    --bs-btn-active-border-color: #5673ba;
    --bs-btn-active-color: #fff;
}

#com-header > .gate > .user > .btn-primary {
    border-right: none !important;
}

#com-header > .gate > .user > .btn-primary:hover,
#com-header > .gate > .user > .btn-primary:focus,
#com-header > .gate > .user > .btn-primary:active {
    background-color: #234089 !important;
    color: #fff !important;
}

#com-header > .gate > .notify > .btn-primary:hover,
#com-header > .gate > .notify > .btn-primary:focus {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

#com-header > .gate > .notify .badge {
    background-color: #e53935 !important;
    color: #fff !important;
    font-size: 0.75rem;
    padding: 0.2em 0.45em;
    border-radius: 10px;
}

#com-header > .gate > .user > .dropdown-menu {
    background: #fff;
    border: 1px solid #e6eaf0;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(26, 35, 50, 0.12);
    min-width: 10rem;
    padding: 0.35rem 0;
    margin-top: 0;
}

#com-header > .gate > .user > .dropdown-menu > li > a {
    display: block;
    padding: 0.45rem 1rem;
    color: #1a2332 !important;
    text-decoration: none;
}

#com-header > .gate > .user > .dropdown-menu > li > a:hover {
    background: #f0f4fa;
    color: #2c50a9 !important;
}
