/* 统一顶栏：积分余额、快捷入口 */
.wx-balance-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 13px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 999px;
    background: rgba(255, 255, 255, .06);
    color: #dfe6e9;
    font-size: 12.5px;
    white-space: nowrap;
    transition: background-color .18s ease, border-color .18s ease;
}

.wx-balance-chip strong {
    color: #ffd15c;
    font-size: 13.5px;
    font-weight: 700;
}

.wx-balance-chip em {
    color: #9aa2ac;
    font-size: 11px;
    font-style: normal;
}

.wx-balance-chip:hover {
    border-color: rgba(255, 255, 255, .24);
    background: rgba(255, 255, 255, .13);
}

.wx-icon-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 50%;
    background: rgba(255, 255, 255, .06);
    color: #e9eef0;
    overflow: hidden;
    transition: background-color .18s ease, border-color .18s ease;
}

.wx-icon-btn svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.wx-icon-btn:hover {
    border-color: rgba(255, 255, 255, .24);
    background: rgba(255, 255, 255, .13);
}

.wx-avatar-btn img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 用户下拉菜单 */
.wx-user-menu {
    position: relative;
}

.wx-user-trigger {
    cursor: pointer;
}

.wx-user-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 80;
    min-width: 150px;
    padding: 6px;
    border: 1px solid rgba(18, 23, 29, .08);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(11, 18, 32, .18);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .16s ease, transform .16s ease, visibility .16s;
}

.wx-user-menu.is-open .wx-user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.wx-user-dropdown a {
    display: flex;
    align-items: center;
    height: 38px;
    padding: 0 12px;
    border-radius: 8px;
    color: #333;
    font-size: 13.5px;
    white-space: nowrap;
}

.wx-user-dropdown a:hover {
    background: #f5f7fa;
    color: #038f86;
}

.wx-user-dropdown a.is-logout {
    margin-top: 4px;
    border-top: 1px solid #eef1f4;
    border-radius: 0;
    color: #c2410c;
}

@media (max-width: 600px) {
    .wx-balance-chip {
        gap: 4px;
        padding: 0 10px;
    }

    .wx-balance-chip em {
        display: none;
    }
}

@media (max-width: 400px) {
    .wx-balance-chip > span {
        display: none;
    }
}

/* 顶栏站点图标：后台「系统设置 - 网站图标」上传后自动替换 */
.wx-brand-mark {
    position: relative;
    overflow: hidden;
}

.wx-brand-mark img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 9px;
}

/* 左侧导航收起时，内容区自适应铺满剩余空间 */
.wx-shell.is-sidebar-collapsed .wx-container {
    max-width: none;
}

/* 页面滚动后：白色紧凑导航栏 */
.wx-topbar {
    transition: background-color .2s ease, box-shadow .2s ease, padding-top .2s ease;
}

.wx-topbar-inner {
    transition: height .2s ease, border-radius .2s ease, background-color .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.wx-topbar-nav {
    display: none;
}

.wx-topbar.is-scrolled {
    padding-top: 0;
    background: #fff;
    box-shadow: 0 1px 0 rgba(18, 23, 29, .06), 0 6px 18px rgba(11, 18, 32, .06);
}

.wx-topbar.is-scrolled .wx-topbar-inner {
    width: 100%;
    height: 56px;
    padding: 0 20px;
    border-color: transparent;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.wx-topbar.is-scrolled .wx-brand {
    color: #12171d;
}

.wx-topbar.is-scrolled .wx-topbar-nav {
    display: flex;
    align-items: center;
    gap: clamp(14px, 2vw, 28px);
    margin: 0 auto;
}

.wx-topbar.is-scrolled .wx-top-actions {
    margin-left: 0;
}

.wx-topbar.is-scrolled .wx-topbar-nav a,
.wx-topbar.is-scrolled .wx-topbar-nav button {
    padding: 0;
    border: 0;
    background: transparent;
    color: #4b5563;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: color .18s ease;
}

.wx-topbar.is-scrolled .wx-topbar-nav a:hover,
.wx-topbar.is-scrolled .wx-topbar-nav button:hover {
    color: #038f86;
}

@media (max-width: 1200px) {
    .wx-topbar.is-scrolled .wx-topbar-nav {
        gap: 14px;
    }

    .wx-topbar.is-scrolled .wx-topbar-nav a,
    .wx-topbar.is-scrolled .wx-topbar-nav button {
        font-size: 12.5px;
    }
}

.wx-topbar.is-scrolled .wx-balance-chip {
    border-color: #e2e6ec;
    background: #f5f7fa;
    color: #666;
}

.wx-topbar.is-scrolled .wx-balance-chip strong {
    color: #038f86;
}

.wx-topbar.is-scrolled .wx-icon-btn {
    border-color: #e2e6ec;
    background: #f5f7fa;
    color: #333;
}

.wx-topbar.is-scrolled .wx-icon-btn:hover {
    background: #eef1f4;
}

@media (max-width: 1024px) {
    .wx-topbar.is-scrolled .wx-topbar-nav {
        display: none;
    }

    .wx-topbar.is-scrolled .wx-top-actions {
        margin-left: auto;
    }
}

@media (max-width: 900px) {
    .wx-topbar.is-scrolled {
        padding-top: env(safe-area-inset-top);
    }

    .wx-topbar.is-scrolled .wx-topbar-inner {
        height: 56px;
        padding: 0 16px;
    }
}
