/* /Resources/Css/Common/Sliderbar.css */
.sidebar {
    position: fixed;
    left: 0;
    top: 60px;
    width: 70px;
    background: rgba(25, 25, 35, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 999;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 60px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 5px 0 25px rgba(0, 0, 0, 0.3);
    border-radius: 0 15px 15px 0;
}

.sidebar:hover,
.sidebar.expanded {
    width: 240px;
    background: rgba(30, 30, 40, 0.9);
}

/* ========== 新版 Toggle 按钮样式 ========== */
.sidebar-toggle {
    color: #ff79c6;
    font-size: 24px;
    padding: 18px;
    text-align: center;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    height: 24px; /* 固定高度防止跳动 */
}

.sidebar-toggle .icon {
    display: inline;
    position: absolute;
    transition: all 0.3s ease;
}

.sidebar-toggle .text {
    display: none;
    font-size: 16px;
    font-weight: 500;
    white-space: nowrap;
    color: #e2e2ff;
}

/* 展开状态 */
.sidebar:hover .sidebar-toggle .icon,
.sidebar.expanded .sidebar-toggle .icon {
    opacity: 0;
    transform: translateX(-20px);
}

.sidebar:hover .sidebar-toggle .text,
.sidebar.expanded .sidebar-toggle .text {
    display: inline;
    animation: textFadeIn 0.4s ease forwards;
}

@keyframes textFadeIn {
    from {
        opacity: 0;
        transform: translateX(10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.sidebar-toggle:hover {
    color: #ff9ac1;
    background: rgba(255, 121, 198, 0.15);
}

/* 卡通风格的星星装饰 */
.sidebar-toggle::after {
    content: '✦';
    position: absolute;
    right: 10px;
    opacity: 0;
    transition: all 0.3s ease;
    color: #bd93f9;
    font-size: 16px;
}

.sidebar:hover .sidebar-toggle::after,
.sidebar.expanded .sidebar-toggle::after {
    opacity: 0.8;
    transform: rotate(15deg);
    right: 20px;
}

/* ========== 导航菜单样式 ========== */
.sidebar-nav ul {
    list-style: none;
    padding: 15px 0;
    margin: 0;
}

.sidebar-nav li {
    position: relative;
    overflow: hidden;
    margin: 5px 10px;
    border-radius: 10px;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #e2e2ff;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-nav li a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #ff79c6, #bd93f9);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    border-radius: 10px 0 0 10px;
}

.sidebar-nav li a:hover {
    background: rgba(255, 121, 198, 0.15);
    color: #fff;
    padding-left: 25px;
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(189, 147, 249, 0.2);
}

.sidebar-nav li a:hover::before {
    transform: translateX(0);
}

/* 图标样式 */
.sidebar-nav li a i {
    margin-right: 15px;
    font-size: 20px;
    min-width: 24px;
    text-align: center;
    color: #ffb86c;
    text-shadow: 0 0 5px rgba(255, 184, 108, 0.5);
    transition: all 0.3s ease;
}

.sidebar-nav li a:hover i {
    color: #ff79c6;
    transform: scale(1.2) rotate(5deg);
}

/* Active状态 */
.sidebar-nav li.active a {
    background: rgba(189, 147, 249, 0.2);
    color: #fff;
    box-shadow: 0 0 10px rgba(189, 147, 249, 0.3);
}

.sidebar-nav li.active a::before {
    transform: translateX(0);
    background: linear-gradient(to bottom, #ff79c6, #ffb86c);
}

.sidebar-nav li.active a i {
    color: #ff79c6;
    animation: iconWobble 0.6s ease infinite alternate;
}

@keyframes iconWobble {
    0% { transform: rotate(-5deg) scale(1.1); }
    100% { transform: rotate(5deg) scale(1.1); }
}

/* 卡通装饰元素 */
.sidebar::before {
    content: '';
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path fill="%23ff79c6" opacity="0.2" d="M50 0 Q75 30 50 60 Q25 30 50 0"/></svg>') no-repeat;
    background-size: contain;
    opacity: 0.3;
    transition: all 0.5s ease;
}

.sidebar:hover::before {
    transform: scale(1.2) rotate(10deg);
    opacity: 0.5;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .sidebar {
        width: 0;
        box-shadow: none;
        border-radius: 0;
    }

    .sidebar.expanded {
        width: 240px;
        box-shadow: 5px 0 25px rgba(0, 0, 0, 0.4);
        border-radius: 0 15px 15px 0;
    }

    .sidebar-toggle {
        padding: 15px;
    }
}

/* 项目动画 */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: translateX(-30px) scale(0.8);
    }
    70% {
        transform: translateX(10px) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.sidebar-nav li {
    animation: bounceIn 0.6s ease forwards;
    opacity: 0;
}

.sidebar-nav li:nth-child(1) { animation-delay: 0.02s; }
.sidebar-nav li:nth-child(2) { animation-delay: 0.04s; }
.sidebar-nav li:nth-child(3) { animation-delay: 0.06s; }
.sidebar-nav li:nth-child(4) { animation-delay: 0.08s; }
.sidebar-nav li:nth-child(5) { animation-delay: 0.1s; }
.sidebar-nav li:nth-child(6) { animation-delay: 0.12s; }
.sidebar-nav li:nth-child(7) { animation-delay: 0.14s; }
.sidebar-nav li:nth-child(8) { animation-delay: 0.16s; }
.sidebar-nav li:nth-child(9) { animation-delay: 0.18s; }
.sidebar-nav li:nth-child(10) { animation-delay: 0.2s; }
.sidebar-nav li:nth-child(11) { animation-delay: 0.22s; }
.sidebar-nav li:nth-child(12) { animation-delay: 0.24s; }
.sidebar-nav li:nth-child(13) { animation-delay: 0.26s; }
.sidebar-nav li:nth-child(14) { animation-delay: 0.28s; }
.sidebar-nav li:nth-child(15) { animation-delay: 0.3s; }

/* 鼠标悬停时的卡通气泡效果 */
.sidebar-nav li a::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
}

.sidebar-nav li a:hover::after {
    transform: translate(-50%, -50%) scale(15);
    opacity: 0.1;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: #ff79c6 rgba(255, 255, 255, 0.05); /* Firefox */
    padding-bottom: 20px; /* 底部留白 */
}

/* Chrome/Edge/Safari 滚动条样式 */
.sidebar-nav::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background-color: #ff79c6;
    border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background-color: #ff9ac1;
}

/* 平滑滚动 */
.sidebar-nav ul {
    scroll-behavior: smooth;
}

/* 添加底部渐变遮罩 */
.sidebar-nav::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(to top,
    rgba(30, 30, 40, 0.9) 0%,
    rgba(30, 30, 40, 0) 100%);
    pointer-events: none;
    z-index: 2;
}

/* 在现有样式后添加 */

/* 高亮效果 */
.sidebar-nav li.highlight a {
    background: rgba(255, 121, 198, 0.3) !important;
    box-shadow: 0 0 15px rgba(255, 121, 198, 0.4) !important;
    transform: scale(1.02) !important;
    transition: all 0.3s ease !important;
}

/* 确保滚动时不会出现水平滚动条 */
.sidebar-nav {
    overscroll-behavior-y: contain;
}

.sidebar-nav .submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-left: 5px;
    background: rgba(40, 40, 50, 0.5);
    margin: 3px 5px;
    border-radius: 0 0 8px 8px;
    will-change: transform, opacity; /* 提示浏览器优化 */
    transform: translateZ(0); /* 强制硬件加速 */
}

.sidebar-nav .toggle-submenu.active + .submenu {
    max-height: 1000px; /* 足够大的值确保能显示所有内容 */
}

.sidebar-nav .dropdown-icon {
    margin-left: 8px;
    font-size: 10px;
    transition: transform 0.3s ease;
}

.sidebar-nav .toggle-submenu.active .dropdown-icon {
    transform: rotate(180deg);
}

.sidebar-nav .submenu a {
    padding: 12px 15px !important;
    font-size: 14px !important;
    background: transparent !important;
    border: none !important;
}

.sidebar-nav .submenu a:hover {
    background: rgba(74, 158, 255, 0.1) !important;
}




.sidebar-actions {
    display: flex;
    flex-direction: row; /* 从column改为row */
    justify-content: space-between; /* 让两个按钮平均分布 */
    padding: 0 18px 15px;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin: 10px 0; /* 合并margin-top和margin-bottom */
}

/* 调整按钮宽度，使它们能并排显示 */
.sidebar-action-btn {
    flex: 1; /* 让两个按钮平分可用空间 */
    min-width: 0; /* 防止文本溢出 */
    /* 其他样式保持不变 */
    background: rgba(255, 121, 198, 0.1);
    color: #e2e2ff;
    border: 1px solid rgba(255, 121, 198, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

/* 默认隐藏，只在展开时显示 */
.sidebar-actions {
    display: none;
}

.sidebar:hover .sidebar-actions,
.sidebar.expanded .sidebar-actions {
    display: flex;
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 按钮样式 */
.sidebar-action-btn {
    background: rgba(255, 121, 198, 0.1);
    color: #e2e2ff;
    border: 1px solid rgba(255, 121, 198, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.sidebar-action-btn:hover {
    background: rgba(255, 121, 198, 0.2);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(255, 121, 198, 0.2);
}

.sidebar-action-btn i {
    margin-right: 8px;
    font-size: 14px;
}

/* 按钮图标动画 */
.sidebar-action-btn:hover i {
    animation: bounce 0.5s ease infinite alternate;
}

@keyframes bounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-3px); }
}

/* 搜索框容器 */
.sidebar-search {
    padding: 0 18px 15px;
    margin: 0 0 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: none;
}

.sidebar:hover .sidebar-search,
.sidebar.expanded .sidebar-search {
    display: block;
    animation: fadeIn 0.3s ease forwards;
}

.search-container {
    display: flex;
    align-items: center;
    position: relative;
    margin-bottom: 5px;
    gap: 5px; /* 添加间隙 */
}

.search-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 121, 198, 0.3);
    border-radius: 8px;
    padding: 8px 12px; /* 移除右侧内边距 */
    color: #e2e2ff;
    font-size: 13px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #ff79c6;
    box-shadow: 0 0 0 2px rgba(255, 121, 198, 0.2);
}

.search-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-left: 5px; /* 添加与搜索框的间距 */
}

.search-nav-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 121, 198, 0.3);
    border-radius: 4px;
    color: #e2e2ff;
    cursor: pointer;
    font-size: 12px;
    padding: 3px 6px;
    line-height: 1;
    opacity: 0.8;
    transition: all 0.2s ease;
}

.search-nav-btn:hover {
    opacity: 1;
    background: rgba(255, 121, 198, 0.2);
    color: #ff79c6;
    transform: scale(1.1);
}

.search-status {
    font-size: 12px;
    color: #ffb86c;
    text-align: center;
    min-height: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.search-status.show {
    opacity: 1;
}

.sidebar-nav li.search-highlight a {
    background: rgba(255, 184, 108, 0.3) !important;
    box-shadow: 0 0 0 2px rgba(255, 184, 108, 0.5) !important;
    animation: pulse 1s infinite alternate;
    transition: all 0.3s ease;
}

.sidebar-nav li:not(.search-highlight) a {
    transition: all 0.3s ease; /* 确保取消高亮也有过渡效果 */
}

@keyframes pulse {
    from { transform: scale(1); }
    to { transform: scale(1.02); }
}