/*
 * LinsGeek ERP —— 帮助中心：右侧悬浮"？"按钮 + 贴着按钮弹出的帮助卡片（配合 21-side-help.js）
 * 只有脚本确认接管之后（body.lg-help-side）才收起页头的文字入口和原面板，
 * 所以脚本没生效时原入口照常可用，不会出现两边都没有入口的情况。
 */

/* 页头的"帮助中心 ▾"文字入口：收起。
 * 用箭头的结构来认这个 <li>（和脚本里的 ARROW 选择器一致），不往 <li> 上加 class：Vue 会重写它的 class。 */
body.lg-help-side #app header > ul > li:has(.transition-transform[class*="rotate-"]) { display: none !important; }
/* 原来那块整行宽、从顶部滑下来的面板：不再显示（内容由卡片接手，节点留着供脚本读取和转发点击） */
body.lg-help-side #app .fixed.z-\[105\] { visibility: hidden !important; pointer-events: none !important; }

/* ---------- 悬浮的"？"按钮 ---------- */
/* 外观沿用原悬浮按钮的 scoped 样式；下面是兜底，防止 scoped 属性对不上时走样 */
.layout-right-quick-actions .lg-help-btn {
  width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: #fff; color: #0d7b6d; cursor: pointer;
}
.layout-right-quick-actions .lg-help-btn.is-on { background: #0d7b6d !important; color: #fff !important; }
.layout-right-quick-actions .lg-help-btn.is-on svg,
.layout-right-quick-actions .lg-help-btn.is-on svg * { color: #fff !important; stroke: #fff !important; }
.layout-right-quick-actions .lg-help-btn svg {
  width: 22px; height: 22px;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- 帮助卡片 ---------- */
#lg-help-pop {
  --lg-arrow-y: 50%;
  position: fixed; z-index: 1000; top: 0; right: 64px;
  width: 560px; max-width: calc(100vw - 88px);
  display: flex; flex-direction: column;
  background: #fff; color: #1f2a37;
  border: 1px solid #e3e8ee; border-radius: 14px;
  box-shadow: 0 18px 48px rgba(15, 35, 52, .16), 0 2px 8px rgba(15, 35, 52, .06);
  font-size: 13px; line-height: 1.45;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateX(10px) scale(.98); transform-origin: right var(--lg-arrow-y);
  transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
}
#lg-help-pop.is-open {
  opacity: 1; visibility: visible; pointer-events: auto; transform: none;
  transition: opacity .16s ease, transform .16s ease;
}
/* 指向"？"按钮的小箭头 */
#lg-help-pop::after {
  content: ""; position: absolute; right: -7px; top: var(--lg-arrow-y);
  width: 12px; height: 12px; margin-top: -6px;
  background: #fff; border: 1px solid #e3e8ee; border-left: 0; border-bottom: 0;
  transform: rotate(45deg); border-top-right-radius: 3px;
}
#lg-help-pop svg {
  fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
  flex: none;
}

#lg-help-pop .lg-help-hd {
  display: flex; align-items: center; gap: 8px; flex: none;
  padding: 12px 12px 12px 16px; border-bottom: 1px solid #eef1f4;
}
#lg-help-pop .lg-help-hd-ico {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: #e6f4f1; color: #0d7b6d;
}
#lg-help-pop .lg-help-hd-ico svg { width: 17px; height: 17px; }
#lg-help-pop .lg-help-hd strong { flex: 1; font-size: 15px; font-weight: 700; color: #111827; }
#lg-help-pop .lg-help-x {
  width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: transparent; color: #6b7280; cursor: pointer;
}
#lg-help-pop .lg-help-x:hover { background: #f1f4f6; color: #111827; }
#lg-help-pop .lg-help-x svg { width: 18px; height: 18px; }

/* 分组：两栏瀑布排，每组不拆开 */
#lg-help-pop .lg-help-bd {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 14px 12px 6px; columns: 2; column-gap: 12px;
}
#lg-help-pop .lg-help-g { break-inside: avoid; margin: 0 0 12px; padding: 0 4px; }
#lg-help-pop .lg-help-g h4 { margin: 0; font-size: 13px; font-weight: 700; color: #111827; }
#lg-help-pop .lg-help-g p { margin: 2px 0 0; font-size: 12px; color: #7a8594; }
#lg-help-pop .lg-help-g ul { list-style: none; margin: 6px -8px 0; padding: 0; }
#lg-help-pop .lg-help-g li { margin: 0; }
#lg-help-pop .lg-help-g a,
#lg-help-pop .lg-help-g li > button {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px;
  padding: 5px 8px; border: 0; border-radius: 8px; background: transparent;
  color: #1f2a37; font: inherit; text-align: left; text-decoration: none; cursor: pointer;
}
#lg-help-pop .lg-help-g a > svg,
#lg-help-pop .lg-help-g li > button > svg { width: 16px; height: 16px; color: #94a0ae; }
#lg-help-pop .lg-help-g a > span,
#lg-help-pop .lg-help-g li > button > span { flex: 1; min-width: 0; }
#lg-help-pop .lg-help-g i { display: flex; opacity: 0; color: #0d7b6d; transition: opacity .12s; }
#lg-help-pop .lg-help-g i svg { width: 14px; height: 14px; }
#lg-help-pop .lg-help-g a:hover,
#lg-help-pop .lg-help-g li > button:hover,
#lg-help-pop .lg-help-g a:focus-visible,
#lg-help-pop .lg-help-g li > button:focus-visible { background: #eef7f5; color: #0d7b6d; outline: none; }
#lg-help-pop .lg-help-g a:hover > svg,
#lg-help-pop .lg-help-g li > button:hover > svg { color: #0d7b6d; }
#lg-help-pop .lg-help-g a:hover i,
#lg-help-pop .lg-help-g li > button:hover i { opacity: 1; }

/* 宽屏但悬浮按钮组收进了抽屉（汉堡菜单模式）：停在右下角，不画箭头 */
#lg-help-pop.is-corner {
  top: auto; right: 16px; bottom: 16px; max-height: calc(100vh - 32px);
  max-width: calc(100vw - 32px); transform-origin: right bottom;
}
#lg-help-pop.is-corner::after { display: none; }

/* 窗口不够宽：单栏 */
@media (max-width: 760px) {
  #lg-help-pop { width: 320px; }
  #lg-help-pop .lg-help-bd { columns: 1; }
}

/* 窄屏（悬浮按钮组收进抽屉）：从底部升起的面板 */
#lg-help-pop.is-sheet {
  left: 0; right: 0; top: auto; bottom: 0; width: auto; max-width: none; max-height: 82vh;
  border-radius: 16px 16px 0 0; border-width: 1px 0 0;
  box-shadow: 0 -12px 40px rgba(15, 35, 52, .22);
  transform: translateY(24px); transform-origin: center bottom;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
#lg-help-pop.is-sheet.is-open { transform: none; }
#lg-help-pop.is-sheet::after { display: none; }
#lg-help-pop.is-sheet .lg-help-bd { columns: 1; padding: 12px 12px 10px; }
#lg-help-pop.is-sheet .lg-help-g a,
#lg-help-pop.is-sheet .lg-help-g li > button { min-height: 42px; font-size: 14px; }
#lg-help-pop.is-sheet .lg-help-g i { opacity: 1; color: #b3bcc7; }

@media (prefers-reduced-motion: reduce) {
  #lg-help-pop, #lg-help-pop.is-open { transition: none; }
}
