/*
 * LinsGeek ERP —— 页头下拉菜单：外观和开合动画（配合 25-nav-dropdown.js）
 * ------------------------------------------------------------------
 * 管两类下拉（都是 Element Plus 的 popover，挂在 body 下，靠内部结构来认）：
 *   · 主导航下拉（订单、发票、商品、仓库、客户、营销、报表）：多栏，每栏一个带分组图标的标题；
 *   · 列表下拉（设置、语言、头像账号）：单列，每行一个图标 + 文字。
 * 原来：直角白板、1px 灰边、0.2 秒线性淡入淡出；菜单项只变文字颜色；从一个菜单移到旁边的菜单时，
 *       旧的要等 0.2 秒才消失，两个下拉会叠在一起。
 * 现在：圆角 + 柔和阴影；打开时从上方轻微滑入、各栏依次跟进；关闭更快；
 *       菜单项整行高亮；当前所在页面的那一项标出来；正在展开的导航项有底色。
 * 只改外观和动画，位置、内容、点击都是原来的。回滚：删除 25-nav-dropdown.css + 25-nav-dropdown.js。
 */

/* ---------- 页头上的导航项：悬停 / 展开时的底色 ---------- */
#app header > div li > .el-tooltip__trigger {
  border-radius: 8px;
  transition: background-color .16s ease, color .16s ease;
}
#app header > div li > .el-tooltip__trigger:hover,
#app header > div li > .el-tooltip__trigger[aria-describedby] {
  background: rgba(255, 255, 255, .18);
  color: #fff !important;
}

/* ---------- 两类下拉共用：外框 + 开合动画 ---------- */
.el-popover:has(> .flex > div > p > .icon-fenzu),
.el-popover:has(> ul.py-main) {
  border: 0 !important;
  border-radius: 14px !important;
  box-shadow: 0 16px 40px rgba(15, 35, 52, .14), 0 2px 6px rgba(15, 35, 52, .06) !important;
  transform-origin: 24px top;
  animation: lg-dd-in .2s cubic-bezier(.2, .85, .3, 1);
  will-change: transform, opacity;
}
.el-popover[data-popper-placement="bottom-end"]:has(> ul.py-main) { transform-origin: calc(100% - 24px) top; }
.el-popover[data-popper-placement="bottom"]:has(> ul.py-main) { transform-origin: center top; }
/* 下拉和页头之间有 5～16px 的缝，鼠标经过时容易"掉下去"导致菜单收起：补一块看不见的桥 */
.el-popover:has(> .flex > div > p > .icon-fenzu)::before,
.el-popover:has(> ul.py-main)::before {
  content: ""; position: absolute; left: 0; right: 0; top: -18px; height: 18px;
}
@keyframes lg-dd-in {
  from { opacity: 0; transform: translateY(-8px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
/* 关闭：比打开快一点，向上收 */
.el-popover.el-fade-in-linear-leave-active:has(> .flex > div > p > .icon-fenzu),
.el-popover.el-fade-in-linear-leave-active:has(> ul.py-main) {
  transition: opacity .13s ease, transform .13s ease !important;
}
.el-popover.el-fade-in-linear-leave-to:has(> .flex > div > p > .icon-fenzu),
.el-popover.el-fade-in-linear-leave-to:has(> ul.py-main) {
  opacity: 0; transform: translateY(-6px);
}
/* 鼠标已经移到另一个导航项上：旧的下拉立刻让位（脚本加的 class），不和新的叠在一起 */
.el-popover.lg-dd-out { opacity: 0 !important; pointer-events: none !important; transition: opacity .09s ease !important; animation: none !important; }

/* ---------- 主导航下拉 ---------- */
.el-popover:has(> .flex > div > p > .icon-fenzu) { padding: 10px !important; }
.el-popover:has(> .flex > div > p > .icon-fenzu) > .flex > div {
  padding: 6px 4px !important; min-width: 164px;
  animation: lg-dd-col .28s cubic-bezier(.2, .85, .3, 1) both;
}
.el-popover:has(> .flex > div > p > .icon-fenzu) > .flex > div + div {
  margin-left: 6px; padding-left: 10px !important; border-left: 1px solid #f0f3f5;
}
.el-popover:has(> .flex > div > p > .icon-fenzu) > .flex > div:nth-child(2) { animation-delay: .03s; }
.el-popover:has(> .flex > div > p > .icon-fenzu) > .flex > div:nth-child(3) { animation-delay: .06s; }
.el-popover:has(> .flex > div > p > .icon-fenzu) > .flex > div:nth-child(4) { animation-delay: .09s; }
.el-popover:has(> .flex > div > p > .icon-fenzu) > .flex > div:nth-child(n+5) { animation-delay: .12s; }
@keyframes lg-dd-col {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}
/* 分组标题：小一号、灰色，当作栏目标签 */
.el-popover:has(> .flex > div > p > .icon-fenzu) > .flex > div > p {
  display: flex; align-items: center; margin: 0 0 4px !important; padding: 4px 10px;
  font-size: 12px; color: #7a8594; white-space: nowrap;
}
.el-popover:has(> .flex > div > p > .icon-fenzu) > .flex > div > p b { font-weight: 600; }
.el-popover:has(> .flex > div > p > .icon-fenzu) > .flex > div > p .iconfont { margin-right: 6px !important; font-size: 12px !important; }
/* 菜单项：整行可点、整行高亮 */
.el-popover:has(> .flex > div > p > .icon-fenzu) > .flex > div > ul { padding-left: 0 !important; }
.el-popover:has(> .flex > div > p > .icon-fenzu) > .flex > div > ul > li { margin: 0 !important; }
.el-popover:has(> .flex > div > p > .icon-fenzu) > .flex > div > ul > li > a {
  display: block; padding: 8px 10px; border-radius: 8px;
  color: #1f2a37; font-size: 14px; line-height: 1.35; white-space: nowrap;
  transition: background-color .12s ease, color .12s ease;
}
.el-popover:has(> .flex > div > p > .icon-fenzu) > .flex > div > ul > li > a:hover,
.el-popover:has(> .flex > div > p > .icon-fenzu) > .flex > div > ul > li > a:focus-visible {
  background: #eef7f5; color: #0d7b6d; outline: none;
}
.el-popover:has(> .flex > div > p > .icon-fenzu) > .flex > div > ul > li > a:active { background: #dff0ec; }
/* 当前所在的页面（脚本加的 class） */
.el-popover:has(> .flex > div > p > .icon-fenzu) > .flex > div > ul > li > a.lg-dd-cur {
  background: #f1f9f7; color: #0d7b6d; font-weight: 600;
}

/* ---------- 列表下拉（设置、语言、账号） ---------- */
.el-popover:has(> ul.py-main) { padding: 6px !important; }
.el-popover:has(> ul.py-main) > ul.py-main { padding: 0 !important; }
.el-popover:has(> ul.py-main) > ul.py-main > li {
  padding: 9px 12px !important; border-radius: 8px; white-space: nowrap; color: #1f2a37;
  transition: background-color .12s ease, color .12s ease;
}
.el-popover:has(> ul.py-main) > ul.py-main > li:hover { background: #eef7f5; color: #0d7b6d; }
.el-popover:has(> ul.py-main) > ul.py-main > li:active { background: #dff0ec; }
.el-popover:has(> ul.py-main) > ul.py-main > li .iconfont { color: #94a0ae; transition: color .12s ease; }
.el-popover:has(> ul.py-main) > ul.py-main > li:hover .iconfont { color: #0d7b6d; }

/* 系统设置了"减少动态效果"：不做滑入 */
@media (prefers-reduced-motion: reduce) {
  .el-popover:has(> .flex > div > p > .icon-fenzu),
  .el-popover:has(> ul.py-main),
  .el-popover:has(> .flex > div > p > .icon-fenzu) > .flex > div { animation: none !important; }
}
