/*
 * 恒链BI统一鼠标提示图标：
 * 1) 默认：白底 + 灰色圆边 + 灰色“?”；
 * 2) 悬停/聚焦：深灰实心圆 + 白色“?”；
 * 3) 悬停提示触发器使用普通箭头光标（cursor: default），不使用带问号/help光标；
 * 4) 基准为库存管理“总库存”：14px，默认 #b8bec6 / #7b8087，经过 #666a70 / #fff。
 * 5) 只统一触发图标外观，不改各模块原有提示内容和弹层逻辑。
 * 6) 新提示图标使用无版本号 .hl-help-icon。兼容选择器保留现有模块结构。
 * 独立 cascade layer 的 important 规则优先于旧模块的未分层 important，
 * 包括利润分析彩色卡片、动态加载的库存表头；不靠修改主包或增加版本号处理。
 */
@layer hl-help-icons {
:is(
  .hl-help-icon,
  .inventory-help-button,
  .inventory-column-help,
  .cost-table-help-icon,
  .store-quota-help,
  .hl-his-info,
  .hl-analysis-v166-help,
  .order-help-mark-v148,
  .order-tax-help-v24,
  .cost-help:not(.link) > button,
  .ad-v111-info-mark,
  .hl-profit-help-mark-v189,
  .hl-profit-info,
  .ov-help,
  .hl-pa-help,
  .fs-help,
  .sr-help,
  .pr-help,
  .hl-dotd-question,
  .hl-as-time-help,
  .hl-rv-help,
  .hl-tip,
  .hl-tip-icon,
  .hl-fx-help,
  .realtime-heading h1 > span[title],
  .realtime-metric > span > small,
  .cost-clock > span,
  .competition-clock > span
){
  --hl-help-background:#fff;
  --hl-help-border:#b8bec6;
  --hl-help-ink:#7b8087;
  box-sizing:border-box!important;
  position:relative!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:14px!important;
  min-width:14px!important;
  height:14px!important;
  min-height:14px!important;
  flex:0 0 14px!important;
  padding:0!important;
  border:1px solid var(--hl-help-border)!important;
  border-radius:50%!important;
  background:var(--hl-help-background)!important;
  color:transparent!important;
  font-size:0!important;
  line-height:1!important;
  text-indent:0!important;
  overflow:visible!important;
  opacity:1!important;
  cursor:default!important;
  box-shadow:none!important;
  outline:none!important;
  vertical-align:middle!important;
  user-select:none!important;
  transition:background-color .12s ease,border-color .12s ease!important;

  &::before{
    content:"?"!important;
    display:block!important;
    color:var(--hl-help-ink)!important;
    font-size:10px!important;
    font-family:Arial,"Microsoft YaHei",sans-serif!important;
    font-style:normal!important;
    font-weight:700!important;
    line-height:12px!important;
    text-align:center!important;
    text-indent:0!important;
    pointer-events:none!important;
  }

  &:is(:hover,:focus-visible){
    --hl-help-background:#666a70;
    --hl-help-border:#666a70;
    --hl-help-ink:#fff;
  }
}

/* 以下提示由外层标签触发，保留其原有悬停/键盘触发范围。 */
.cost-table-help:is(:hover,:focus,:focus-within) .cost-table-help-icon,
.ad-v111-info-wrap:is(:hover,:focus-visible) .ad-v111-info-mark,
.hl-dotd-title-tip:is(:hover,:focus,:focus-within) .hl-dotd-question{
  --hl-help-background:#666a70;
  --hl-help-border:#666a70;
  --hl-help-ink:#fff;
}
}

/* 恒链BI：所有已统一的 Tooltip / Popover 弹层统一置顶。 */
.cost-table-help-pop,
.cost-withholding-help,
.store-quota-tooltip,
.hl-his-tooltip,
.hl-his-chart-tooltip-v157,
#hl-history-v150 .hl-his-chart-tooltip-v160,
.order-help-popover-v148,
.order-tax-popover-v24,
.ad-v109-tooltip,
.ad-v111-info-pop,
.inventory-help-popover,
.henglian-currency-popover,
.realtime-chart-tooltip{
  z-index:2147483647!important;
}
.cost-table-help,
.cost-help,
.ad-v111-info-wrap{
  z-index:2147483646!important;
}

/*
 * 最高层提示修复：
 * 仅提高 z-index 无法突破 table/overflow/transform 形成的层叠与裁剪上下文。
 * inline tooltip 由 tooltip-layer.js 复制到 body 顶层；这里统一顶层容器与已有 body tooltip 的层级。
 */
.hl-tooltip-portal-layer{
  position:fixed!important;
  z-index:2147483647!important;
  display:block!important;
  visibility:visible!important;
  opacity:1!important;
  pointer-events:none!important;
  transform:none!important;
  margin:0!important;
  max-height:calc(100vh - 16px)!important;
  overflow:auto!important;
  isolation:isolate!important;
}
.hl-tooltip-source-ported{
  visibility:hidden!important;
}

/* 已经直接挂到 body 的提示，也统一到最高层。 */
#store-quota-tooltip,
.store-quota-tooltip,
#hl-his-floating-tip,
.hl-his-floating-tip,
.order-help-popover-v148,
.order-tax-popover-v24,
.inventory-help-popover,
.inventory-sync-tip-v139,
.ad-v109-tooltip,
.realtime-chart-tooltip,
.henglian-currency-popover{
  z-index:2147483647!important;
}
