/* 侧栏统一化 CSS（v1）
 * 目的：让 admin.js 注入的「账户管理 / 角色管理 / 菜单管理」
 *       和 dl.js 注入的「文件分发」看起来跟原生菜单完全一致
 * 用法：在 index.html 里放在 admin.js / dl.js 之后
 */

/* ① admin.js 的注入块：去掉自己的内边距，跟自己所在的侧栏同一底色，不要留缝 */
#yl-admin-nav {
  padding: 0 8px !important;
  background: transparent !important;
}

/* ② 注入项：高度/圆角/字号/颜色向原生 antd 菜单项看齐 */
#yl-admin-nav .yl-nav-item {
  display: flex !important;
  align-items: center !important;
  height: 40px !important;
  line-height: 40px !important;
  margin: 4px 0 !important;
  padding: 0 16px !important;
  border-radius: 6px !important;
  font-size: 14px !important;
  color: var(--yl-sider-text, #a9b6c6) !important;
  cursor: pointer;
  transition: background .16s ease, color .16s ease;
}
#yl-admin-nav .yl-nav-item:hover {
  background: rgba(255, 255, 255, .06) !important;
  color: #fff !important;
}
#yl-admin-nav .yl-nav-ico {
  font-size: 16px !important;
  margin-right: 12px;
  opacity: .9;
  display: inline-flex;
  align-items: center;
  min-width: 16px;
}
#yl-admin-nav .yl-nav-txt {
  font-size: 14px !important;
  letter-spacing: .2px;
}

/* ③ 文件分发这一项（原生 React 菜单项）：图标与文字间距对齐其它项 */
.ant-menu-item .anticon.ant-menu-item-icon {
  margin-right: 10px;
  font-size: 16px;
  vertical-align: -0.125em;
}

/* ④ 我们的视图打开时，把原生选中态的底色压平（高亮交给 .yl-dl-selected） */
body.yl-dl-open .ant-menu-item-selected:not(.yl-dl-selected) {
  background: transparent !important;
}
body.yl-dl-open .ant-menu-item-selected:not(.yl-dl-selected) .ant-menu-title-content {
  color: inherit !important;
  font-weight: 400 !important;
}


/* ⑤ 皮肤层用的是 "#root .ant-menu-item-selected"（ID 选择器 + !important），
      必须同样带上 #root 才能压过去，否则"服务器状态"的黄底清不掉 */
body.yl-dl-open #root .ant-menu-item-selected:not(.yl-dl-selected) {
  background: transparent !important;
  color: var(--yl-sider-text, #a9b6c6) !important;
  font-weight: 400 !important;
}
body.yl-dl-open #root .ant-menu-item-selected:not(.yl-dl-selected) .anticon,
body.yl-dl-open #root .ant-menu-item-selected:not(.yl-dl-selected) svg {
  color: var(--yl-sider-text, #a9b6c6) !important;
  opacity: .85 !important;
}
body.yl-dl-open #root .ant-menu-item-selected:not(.yl-dl-selected) .ant-menu-title-content {
  color: var(--yl-sider-text, #a9b6c6) !important;
  font-weight: 400 !important;
}

/* ⑥ 我们自己的菜单项：黄色高亮也要压过皮肤的 !important */
body.yl-dl-open #root .ant-menu-item.yl-dl-selected {
  background: rgba(255, 196, 0, .16) !important;
  color: #ffc400 !important;
}
body.yl-dl-open #root .ant-menu-item.yl-dl-selected .ant-menu-title-content {
  color: #ffc400 !important;
  font-weight: 600 !important;
}
body.yl-dl-open #root .ant-menu-item.yl-dl-selected .anticon,
body.yl-dl-open #root .ant-menu-item.yl-dl-selected svg {
  color: #ffc400 !important;
  opacity: 1 !important;
}
