/**
 * ============================================================
 *  导航栏样式方案 - 极简无边框（Minimal Borderless）
 *  适用：RuYi 主题左侧栏导航
 *  风格：无背景、无边框、无阴影，纯粹图标+文字，极简主义
 * ============================================================
 */

/* --------------------------------------------------
   基础变量覆盖 — 强制紧凑模式 68px
   -------------------------------------------------- */

/* 在 aside-min 状态下，将侧栏宽度设为 68px（显示图标+两字） */
.aside-min {
    --main-aside-width: 68px;
}

/* 侧栏主体：固定宽度 68px，平滑过渡 */
.aside-body {
    width: var(--main-aside-width);
    min-width: var(--main-aside-width);
    max-width: var(--main-aside-width);
    transition: width 0.3s ease, min-width 0.3s ease, max-width 0.3s ease, opacity 0.3s ease;
}

/* hover-show 展开时恢复原始宽度 */
.aside-min .aside-body.hover-show {
    width: var(--main-aside-basis-width);
    min-width: var(--main-aside-basis-width);
    max-width: var(--main-aside-basis-width);
}

/* --------------------------------------------------
   导航卡片容器 — 完全透明，无背景、无边框、无阴影
   -------------------------------------------------- */
.aside-card {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0;
    padding: 8px 6px;
    overflow: hidden;
    position: relative;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

/* 移除顶部装饰层 */
.aside-card::before {
    display: none;
}

/* --------------------------------------------------
   导航列表容器 — flex 布局，无背景
   -------------------------------------------------- */
.aside-card ul,
.aside-ul {
    display: flex;
    flex-direction: column;
    gap: 2px;
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
    background: transparent !important;
}

/* --------------------------------------------------
   导航按钮 — 纵向排列（图标在上，文字在下）
   -------------------------------------------------- */
.aside-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 10px 4px;
    border-radius: var(--theme-border-radius-md, 8px);
    transition: background 0.25s ease, color 0.25s ease, transform 0.2s ease;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    /* 默认颜色：使用柔和的静音色 */
    color: var(--muted-color, #8a8a99);
}

/* 清除原始 ml-2 的左偏移，确保图标和文字居中 */
.aside-card .aside-btn .ml-2 {
    margin-left: 0 !important;
}

/* 图标样式 */
.aside-card .icon-fw {
    font-size: 1.15em;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    flex-shrink: 0;
    /* 默认图标静音色 */
    color: var(--muted-color, #8a8a99);
    transition: color 0.25s ease, transform 0.25s ease;
}

/* --------------------------------------------------
   按钮文字 — 始终可见（关键！）
   -------------------------------------------------- */
.aside-btn span {
    font-size: 11px;
    line-height: 1;
    white-space: nowrap;
    /* 强制可见，覆盖 aside-min 隐藏规则 */
    visibility: visible !important;
    opacity: 1 !important;
    color: var(--muted-color, #8a8a99);
    transition: color 0.25s ease;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    text-align: center;
}

/* 列表项居中 */
.aside-card ul li {
    display: flex;
    justify-content: center;
}

/* --------------------------------------------------
   悬停状态 — 极淡主题色背景 + 图标文字变色
   -------------------------------------------------- */
.aside-btn:hover {
    background: rgba(var(--theme-color-rgb), 0.06);
}

.aside-btn:hover .icon-fw,
.aside-btn:hover span {
    color: var(--theme-color);
}

.aside-btn:hover .icon-fw {
    transform: scale(1.1);
}

/* --------------------------------------------------
   激活/选中状态 — 主题色文字 + 底部指示条
   -------------------------------------------------- */
.aside-item.active > .aside-btn,
.aside-btn.active {
    background: transparent;
}

/* 底部居中指示条 — 16px 宽、2px 高、圆角 */
.aside-item.active > .aside-btn::after,
.aside-btn.active::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 2px;
    width: 16px;
    height: 2px;
    background: var(--theme-color);
    border-radius: 2px;
}

.aside-item.active > .aside-btn .icon-fw,
.aside-item.active > .aside-btn span,
.aside-btn.active .icon-fw,
.aside-btn.active span {
    color: var(--theme-color);
    font-weight: 500;
}

/* --------------------------------------------------
   hover-show 展开时文字正常显示
   -------------------------------------------------- */
.aside-min .aside-body.hover-show .aside-btn span {
    visibility: visible !important;
    opacity: 1 !important;
}

.aside-min .aside-body.hover-show .aside-more {
    visibility: visible !important;
    opacity: 1 !important;
}

/* --------------------------------------------------
   导航分组分隔线
   -------------------------------------------------- */
.aside-card + .aside-card {
    margin-top: 6px;
}

/* 分组分割线（通过 li 分隔）— 极简风格 */
.aside-card ul li.divider,
.aside-ul li.divider {
    height: 1px;
    margin: 4px 8px;
    background: rgba(0, 0, 0, 0.06);
    list-style: none;
    pointer-events: none;
}

/* --------------------------------------------------
   底部区域 — 顶部分隔线
   -------------------------------------------------- */
.aside-bottom {
    position: relative;
}

.aside-bottom::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0;
    width: 80%;
    height: 1px;
    background: rgba(127, 127, 127, 0.1);
}

/* --------------------------------------------------
   更多按钮（子菜单箭头）— 紧凑模式下保持可见
   -------------------------------------------------- */
.aside-min .aside-body .aside-more {
    visibility: visible !important;
    opacity: 1 !important;
}

/* --------------------------------------------------
   暗色模式适配 — 极简风格保持透明
   -------------------------------------------------- */
[data-theme="dark"] .aside-card,
html.dark .aside-card {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

[data-theme="dark"] .aside-btn:hover,
html.dark .aside-btn:hover {
    background: rgba(var(--theme-color-rgb), 0.1);
}

[data-theme="dark"] .aside-item.active > .aside-btn,
html.dark .aside-btn.active {
    background: transparent;
}

[data-theme="dark"] .aside-card ul li.divider,
html.dark .aside-ul li.divider {
    background: rgba(255, 255, 255, 0.06);
}

/* --------------------------------------------------
   响应式：移动端适配
   -------------------------------------------------- */
@media screen and (max-width: 767.98px) {
    /* 移动端侧栏保持 68px */
    .aside-body {
        width: 68px !important;
        min-width: 68px !important;
        max-width: 68px !important;
    }

    /* 移动端文字始终可见 */
    .aside-btn span {
        visibility: visible !important;
        opacity: 1 !important;
    }

    .aside-min .aside-body .aside-more,
    .aside-min .aside-body span {
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* --------------------------------------------------
   平滑过渡动画
   -------------------------------------------------- */
.aside-card,
.aside-btn,
.aside-btn .icon-fw,
.aside-btn span,
.aside-body {
    transition-property: all;
    transition-duration: 0.25s;
    transition-timing-function: ease;
}
