<template>
  <!-- 直接使用 QianniuMenu 的双栏结构 -->
  <app-children-menu :menuStyle="menuStyle" />
</template>

<script setup>
  import { useApp } from '@/sheep/hooks';
  import AppChildrenMenu from './style/index.vue';

  const { menuStyle } = useApp();
</script>
<style lang="scss" scoped>
  .app-menu {
    width: 56px;
    height: 100%;
    padding: 10px 0 2px;
    background: var(--t-bg-app);
    display: flex;
    flex-direction: column;
    align-items: center;
    .line {
      width: 32px;
      height: 1px;
      background: var(--sa-background-assist);
      border-radius: 4px;
    }
    --el-menu-active-color: var(--el-color-primary);
    --el-menu-text-color: var(--el-text-color-primary);
    --el-menu-hover-text-color: var(--el-color-primary);
    --el-menu-bg-color: transparent; //
    --el-menu-hover-bg-color: transparent; //
    --el-menu-item-height: 40px; //
    --el-menu-sub-item-height: calc(var(--el-menu-item-height) - 6px);
    --el-menu-horizontal-sub-item-height: 36px;
    --el-menu-item-font-size: var(--el-font-size-base);
    --el-menu-item-hover-fill: var(--el-color-primary-light-9);
    --el-menu-border-color: var(--el-border-color);
    --el-menu-base-level-padding: 0; //
    --el-menu-level-padding: 12px;
    --el-menu-icon-width: 24px;
    --el-menu-icon-transform-closed: none;
    --el-menu-icon-transform-open: rotateZ(180deg);
    .el-menu {
      border-right: none;
      &--collapse {
        width: 56px;
      }
    }
    :deep() {
      .el-menu-item {
        width: 40px;
        height: 40px;
        padding: 0;
        margin: 0 8px 8px;
        position: relative;
        &::before {
          pointer-events: none;
          content: '';
          width: 3px;
          height: 0;
          background: var(--el-color-primary);
          border-radius: 0 3px 3px 0;
          position: absolute;
          top: 20px;
          left: -8px;
          transition: all 0.2s ease-in-out;
        }
        &:hover {
          &::before {
            height: 24px;
            top: 8px;
          }
          .el-menu-tooltip__trigger {
            border-radius: 12px;
          }
        }
        &.is-active {
          &::before {
            height: 40px;
            top: 0;
          }
          .el-menu-tooltip__trigger {
            border-radius: 12px;
            color: var(--sa-background-assist);
            background: var(--el-color-primary);
          }
        }
        .el-menu-tooltip__trigger {
          width: 40px;
          height: 40px;
          padding: 0;
          border-radius: 20px;
          background: var(--sa-background-assist);
          overflow: hidden;
          display: flex;
          align-items: center;
          justify-content: center;
          transition: all 0.2s ease-in-out;
          .sa-image {
            width: 40px !important;
            height: 40px !important;
          }
        }
      }
    }
    .menu-footer {
      display: flex;
      flex-direction: column;
      align-items: center;
    }
  }
</style>
<style lang="scss">
  .el-menu-tooltip {
    color: var(--sa-font);
    background: var(--sa-background-assist);
    filter: drop-shadow(0 0 12px rgba(0, 0, 0, 0.12));
    border: none !important;

    @media only screen and (max-width: 768px) {
      display: none !important;
    }
  }
</style>
