/* =========================================================
   V250 利润分析细节：固定图标、MXN字号、顶部层级
   ========================================================= */

/* 固定图标改成参考图的描边图钉。 */
#hl-profit-v189 .hl-profit-fix-pin-v246{
  width:13px!important;
  height:13px!important;
  min-width:13px!important;
  flex:0 0 13px!important;
  transform:none!important;
  background:currentColor!important;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M9.5 3.5l7 7-2.2 2.2.7 3.8-1.1 1.1-4.2-4.2-5.4 5.4-.9-.9 5.4-5.4-4.2-4.2 1.1-1.1 3.8.7zM15.8 4.2l4 4'/%3E%3C/svg%3E") center/contain no-repeat!important;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M9.5 3.5l7 7-2.2 2.2.7 3.8-1.1 1.1-4.2-4.2-5.4 5.4-.9-.9 5.4-5.4-4.2-4.2 1.1-1.1 3.8.7zM15.8 4.2l4 4'/%3E%3C/svg%3E") center/contain no-repeat!important;
}
#hl-profit-v189 .hl-profit-fix-pin-v246:before,
#hl-profit-v189 .hl-profit-fix-pin-v246:after{display:none!important;content:none!important;}

/* 销售额/采购成本/净利润中的币种前缀缩小，数值保持旧BI字号。 */
#hl-profit-v189 .hl-profit-metricstrip article>strong .hl-profit-mxn-small-v250{
  display:inline-block!important;
  margin-right:4px!important;
  color:#9a9a9a!important;
  font-size:10px!important;
  line-height:1!important;
  font-weight:400!important;
  vertical-align:baseline!important;
  transform:translateY(-1px)!important;
}
#hl-profit-v189 .hl-profit-metricstrip article.active>strong .hl-profit-mxn-small-v250{
  color:rgba(255,255,255,.82)!important;
}
#hl-profit-v189 .hl-profit-metricstrip article>strong .hl-profit-money-number-v250{
  color:inherit!important;
  font-size:inherit!important;
  font-weight:inherit!important;
}

/* 顶栏必须永远压在利润固定层之上，避免币种选择被盖住。 */
.system-bar{z-index:1000!important;}
.tabs-line{z-index:900!important;}
#hl-analysis-global-toolbar-v166{z-index:850!important;}
#hl-profit-v189 .hl-profit-sticky-group-v239.is-fixed-v239{z-index:700!important;}

/* V250：profit-ui 在 global-layout 之后加载，不能把 system-bar 层级重新压低。 */
.system-bar{
  z-index:1000000!important;
  overflow:visible!important;
  isolation:isolate!important;
}
.system-bar .top-links,
.system-bar .henglian-currency-v20{
  position:relative!important;
  z-index:1000010!important;
  overflow:visible!important;
}
.system-bar .henglian-currency-popover{
  z-index:1000020!important;
}

/* 利润分析自己的分页同样是 fixed，给商品区域留出分页+横向条空间，避免最后一行被盖住。 */
#hl-profit-v189 .hl-profit-products{
  padding-bottom:66px!important;
  box-sizing:border-box!important;
}

/* V252：利润分析币种选择必须覆盖 KPI / sticky 表头 / 底部分页等所有业务层。 */
.system-bar{
  z-index:2147483000!important;
  overflow:visible!important;
  isolation:isolate!important;
}
.system-bar .top-links,
.system-bar .henglian-currency-v20{
  position:relative!important;
  z-index:2147483100!important;
  overflow:visible!important;
}
.system-bar .henglian-currency-popover{
  z-index:2147483600!important;
}

/* =========================================================
   V253：利润分析横向滚动条细化 + 币种弹层真正置顶
   ========================================================= */

/* 仅利润分析：固定横向滚动条改细、改浅。 */
body > #hl-profit-fixed-hscroll-v239{
  height:11px!important;
  background:#fbfcfd!important;
  border-top:1px solid #eef2f5!important;
  border-bottom:1px solid #eef2f5!important;
  box-shadow:none!important;
  scrollbar-width:thin!important;
  scrollbar-color:#c8d0d8 #f5f7f9!important;
}
body > #hl-profit-fixed-hscroll-v239::-webkit-scrollbar{
  height:7px!important;
}
body > #hl-profit-fixed-hscroll-v239::-webkit-scrollbar-track{
  background:#f5f7f9!important;
  border-radius:4px!important;
}
body > #hl-profit-fixed-hscroll-v239::-webkit-scrollbar-thumb{
  background:#c8d0d8!important;
  border-radius:4px!important;
  border:1px solid #f5f7f9!important;
}
body > #hl-profit-fixed-hscroll-v239::-webkit-scrollbar-thumb:hover{
  background:#b8c2cc!important;
}

/* 有横向滚动条时，给商品表格底部留出足够可滚动空间，最后一行不会被横向条/分页盖住。 */
#hl-profit-v189 .hl-profit-products.hl-profit-has-hscroll-v239{
  padding-bottom:80px!important;
}

/*
 * 币种弹层根因修复：
 * 原 popover 一直挂在 .system-bar/.top-links 的内部层叠上下文里；利润页又存在 fixed KPI/表头。
 * 仅继续提高 z-index 仍可能受祖先 stacking context / clipping 影响。
 * V253 在利润分析打开币种时，把一个交互镜像 portal 直接挂到 body 顶层。
 */
body > .hl-currency-portal-v253{
  position:fixed!important;
  z-index:2147483647!important;
  display:block!important;
  visibility:visible!important;
  opacity:1!important;
  pointer-events:auto!important;
  overflow:visible!important;
  isolation:isolate!important;
  transform:none!important;
  margin:0!important;
}

/* =========================================================
   V254：利润分析横向滚动条 1.3x + 币种弹层稳定 portal
   ========================================================= */

/* 用户要求：仅利润分析横向条在 V253 基础上放大约 1.3 倍。
   V253 外层 11px -> 14px；Chrome 实际 scrollbar 7px -> 9px。 */
body > #hl-profit-fixed-hscroll-v239{
  height:14px!important;
  background:#fbfcfd!important;
  border-top:1px solid #eef2f5!important;
  border-bottom:1px solid #eef2f5!important;
  box-shadow:none!important;
  scrollbar-color:#c8d0d8 #f5f7f9!important;
}
body > #hl-profit-fixed-hscroll-v239::-webkit-scrollbar{
  height:9px!important;
}
body > #hl-profit-fixed-hscroll-v239::-webkit-scrollbar-track{
  background:#f5f7f9!important;
  border-radius:5px!important;
}
body > #hl-profit-fixed-hscroll-v239::-webkit-scrollbar-thumb{
  background:#c8d0d8!important;
  border-radius:5px!important;
  border:1px solid #f5f7f9!important;
}
body > #hl-profit-fixed-hscroll-v239::-webkit-scrollbar-thumb:hover{
  background:#b8c2cc!important;
}

/* 横向条出现时补真实文档流空间：最后一行可以继续往上滚，不会被横向条/分页覆盖。 */
#hl-profit-v189 .hl-profit-products.hl-profit-has-hscroll-v239{
  padding-bottom:96px!important;
}
#hl-profit-v189 .hl-profit-products.hl-profit-has-hscroll-v239 .profit-table-wrap{
  margin-bottom:18px!important;
}

/*
 * 币种弹层稳定处理：
 * 点击 trigger 的捕获阶段先加 OPEN_CLASS，把 system-bar 内原 popover 隐藏；
 * 真正显示的是直接挂在 body 的 portal，因此不再参与利润固定 KPI 的层叠上下文。
 */
html.hl-profit-currency-portal-opening-v254 .system-bar .henglian-currency-popover{
  visibility:hidden!important;
  pointer-events:none!important;
}
body > .hl-currency-portal-v254{
  position:fixed!important;
  z-index:2147483647!important;
  display:block!important;
  visibility:visible!important;
  opacity:1!important;
  pointer-events:auto!important;
  box-sizing:border-box!important;
  right:auto!important;
  bottom:auto!important;
  transform:none!important;
  margin:0!important;
  isolation:isolate!important;
  overflow-x:hidden!important;
  overscroll-behavior:contain!important;
}
body > .hl-currency-portal-v254[hidden]{
  display:none!important;
}
