/**
 * ============================================================
 *  导航栏样式方案 - 银河晨曦（Galaxy Dawn）
 *  适用：RuYi 主题左侧栏导航
 *  风格：暗到明银河渐变 + 柔和辉光、晨曦微光、深邃到明亮过渡
 * ============================================================
 */

/* --------------------------------------------------
   配色变量 — 银河晨曦主题色
   -------------------------------------------------- */
:root {
    --gx-bg-1: #0f0c29;
    --gx-bg-2: #1a1a3e;
    --gx-bg-3: #2d2d5e;
    --gx-bg-4: #4a4a8a;
    --gx-bg-5: #7b7bbd;
    --gx-bg-6: #ddd6f3;
    --gx-accent: #9090d0;
    --gx-accent-rgb: 144, 144, 208;
    --gx-text: #8080b0;
    --gx-text-hover: #b0b0e0;
    --gx-text-active: #ddd6f3;
    --gx-border: rgba(144, 144, 208, 0.15);
    --gx-divider: rgba(144, 144, 208, 0.08);
}

/* --------------------------------------------------
   基础变量覆盖 — 强制紧凑模式 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: linear-gradient(135deg, #0f0c29 0%, #1a1a3e 20%, #2d2d5e 40%, #4a4a8a 55%, #7b7bbd 70%, #b0b0e0 85%, #ddd6f3 100%);
    border: 1px solid var(--gx-border);
    border-radius: 16px;
    padding: 8px 6px;
    overflow: hidden;
    position: relative;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    /* 微弱的柔和外发光 */
    box-shadow: 0 0 20px rgba(var(--gx-accent-rgb), 0.05);
}

/* 双重径向辉光叠加层 — 晨曦微光 */
.aside-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(
            ellipse at 60% 20%,
            rgba(255, 255, 255, 0.05) 0%,
            rgba(255, 255, 255, 0.02) 35%,
            transparent 65%
        ),
        radial-gradient(
            ellipse at 20% 70%,
            rgba(180, 160, 255, 0.06) 0%,
            rgba(180, 160, 255, 0.02) 35%,
            transparent 65%
        );
    pointer-events: none;
    z-index: 0;
}

/* --------------------------------------------------
   导航列表容器 — flex 布局
   -------------------------------------------------- */
.aside-card ul,
.aside-ul {
    display: flex;
    flex-direction: column;
    gap: 2px;
    list-style: none;
    padding: 0;
    margin: 0;
    position: relative;
    z-index: 1;
}

/* --------------------------------------------------
   导航按钮 — 纵向排列（图标在上，文字在下）
   -------------------------------------------------- */
.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, box-shadow 0.3s ease;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    color: var(--gx-text);
}

/* 清除原始 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(--gx-text);
    transition: color 0.25s ease, transform 0.25s ease, text-shadow 0.3s ease;
}

/* --------------------------------------------------
   按钮文字 — 始终可见（关键！）
   -------------------------------------------------- */
.aside-btn span {
    font-size: 11px;
    line-height: 1;
    white-space: nowrap;
    /* 强制可见，覆盖 aside-min 隐藏规则 */
    visibility: visible !important;
    opacity: 1 !important;
    color: var(--gx-text);
    transition: color 0.25s ease, text-shadow 0.3s 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(--gx-accent-rgb), 0.1);
}

.aside-btn:hover .icon-fw,
.aside-btn:hover span {
    color: var(--gx-text-hover);
    /* 微弱文字发光 */
    text-shadow: 0 0 8px rgba(var(--gx-accent-rgb), 0.3);
}

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

/* --------------------------------------------------
   激活/选中状态 — 银河左指示条 + 辉光
   -------------------------------------------------- */
.aside-item.active > .aside-btn,
.aside-btn.active {
    background: rgba(var(--gx-accent-rgb), 0.15);
    /* 柔和发光背景 */
    box-shadow:
        0 0 12px rgba(var(--gx-accent-rgb), 0.1),
        inset 0 0 12px rgba(var(--gx-accent-rgb), 0.05);
}

/* 左侧银河竖条指示器 — 带发光 box-shadow */
.aside-item.active > .aside-btn::after,
.aside-btn.active::after {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--gx-accent);
    border-radius: 0 3px 3px 0;
    /* 银河辉光效果 — 多层 box-shadow */
    box-shadow:
        0 0 6px rgba(var(--gx-accent-rgb), 0.35),
        0 0 12px rgba(var(--gx-accent-rgb), 0.25),
        0 0 20px rgba(var(--gx-accent-rgb), 0.1);
}

.aside-item.active > .aside-btn .icon-fw,
.aside-item.active > .aside-btn span,
.aside-btn.active .icon-fw,
.aside-btn.active span {
    color: var(--gx-text-active);
    font-weight: 600;
    /* 激活项文字辉光 */
    text-shadow: 0 0 10px rgba(var(--gx-accent-rgb), 0.3);
}

/* --------------------------------------------------
   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;
}

/* 分组分割线 — 银河半透明 */
.aside-card ul li.divider,
.aside-ul li.divider {
    height: 1px;
    margin: 4px 8px;
    background: var(--gx-divider);
    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: linear-gradient(
        90deg,
        transparent 0%,
        rgba(var(--gx-accent-rgb), 0.2) 50%,
        transparent 100%
    );
}

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

/* --------------------------------------------------
   响应式：移动端适配
   -------------------------------------------------- */
@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;
}
