/**
 * ============================================================
 *  导航栏样式方案 - 矩阵绿（Matrix Green Scan Lines）
 *  适用：RuYi 主题左侧栏导航
 *  风格：纯黑渐变底 + 绿色霓虹辉光、矩阵扫描线、赛博朋克
 * ============================================================
 */

/* --------------------------------------------------
   配色变量 — 矩阵绿主题色
   -------------------------------------------------- */
:root {
    --mx-bg-1: #000000;
    --mx-bg-2: #0a1a0a;
    --mx-bg-3: #003300;
    --mx-bg-4: #005500;
    --mx-bg-5: #00aa00;
    --mx-accent: #00cc44;
    --mx-accent-rgb: 0, 204, 68;
    --mx-text: #408040;
    --mx-text-hover: #00cc44;
    --mx-text-active: #66ff88;
    --mx-border: rgba(0, 204, 68, 0.15);
    --mx-divider: rgba(0, 204, 68, 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, var(--mx-bg-1) 0%, var(--mx-bg-2) 30%, var(--mx-bg-3) 60%, var(--mx-bg-4) 85%, var(--mx-bg-5) 100%);
    border: 1px solid var(--mx-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(--mx-accent-rgb), 0.05);
}

/* 矩阵扫描线叠加层 — repeating-linear-gradient */
.aside-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 0, 0.03) 2px,
        rgba(0, 255, 0, 0.03) 4px
    );
    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(--mx-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(--mx-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(--mx-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(--mx-accent-rgb), 0.1);
}

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

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

/* --------------------------------------------------
   激活/选中状态 — 绿色左指示条 + 霓虹辉光
   -------------------------------------------------- */
.aside-item.active > .aside-btn,
.aside-btn.active {
    background: rgba(var(--mx-accent-rgb), 0.15);
    /* 绿色发光背景 */
    box-shadow:
        0 0 12px rgba(var(--mx-accent-rgb), 0.1),
        inset 0 0 12px rgba(var(--mx-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(--mx-accent);
    border-radius: 0 3px 3px 0;
    /* 霓虹绿发光效果 — 多层 box-shadow */
    box-shadow:
        0 0 6px rgba(var(--mx-accent-rgb), 0.35),
        0 0 12px rgba(var(--mx-accent-rgb), 0.25),
        0 0 20px rgba(var(--mx-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(--mx-text-active);
    font-weight: 600;
    /* 激活项文字霓虹辉光 */
    text-shadow: 0 0 10px rgba(var(--mx-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(--mx-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(--mx-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;
}
