﻿/**
 * Description页面专用侧边栏样式
 * @version 1.0.0
 * 专为description页面设计的现代化侧边栏
 */

/* ===== 侧边栏容器 ===== */
.haide {
    grid-template-columns: 280px 1fr !important; /* 侧边栏宽度 + 25px间距 */
    gap: 25px !important; /* 精确的25px间距 */
}

/* 大屏幕进一步优化 */
@media (min-width: 1400px) {
    .haide {
        grid-template-columns: 280px 1fr !important;
        gap: 25px !important;
    }
}

/* 移除宽度限制 */
.content-wrapper {
    max-width: none !important;
    width: 100% !important;
}
.desc-sidebar-container {
    display: block;
    max-width: none;
    margin: 0;
    padding: 2rem;
    padding-left: 0; /* 移除左侧padding，让内容紧贴侧边栏 */
}

/* ===== 主侧边栏 ===== */
.desc-sidebar {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 280px;
    max-height: calc(100vh - 140px);
    z-index: 1000;
    
    /* 渐变背景 */
    background: linear-gradient(135deg,
        rgba(104, 242, 194, 0.4) 0%,
        rgba(89, 202, 247, 0.4) 48.33%,
        rgba(250, 205, 245, 0.4) 100%
    );
    
    border: 2px solid rgba(104, 242, 194, 0.6);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(20px);
    
    /* 阴影效果 */
    box-shadow:
        0 15px 45px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 0 30px rgba(104, 242, 194, 0.2);
    
    /* 初始状态 */
    opacity: 0;
    visibility: hidden;
    transform: translateX(-30px) translateY(-50%) scale(0.95);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
    
    /* 延迟显示动画 */
    animation: descSidebarSlideIn 1s cubic-bezier(0.34, 1.56, 0.64, 1) 1.5s forwards;
}

/* 侧边栏可见状态 */
.desc-sidebar.visible {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(0) translateY(-50%) scale(1) !important;
}

/* 侧边栏隐藏状态 */
.desc-sidebar.hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateX(-30px) translateY(-50%) scale(0.95) !important;
    transition: all 0.3s ease-out !important;
}

/* 光效动画 */
.desc-sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: left 2s ease;
    z-index: 1;
}

.desc-sidebar:hover::before {
    left: 100%;
}

/* 悬停效果 */
.desc-sidebar:hover {
    transform: translateY(-50%) scale(1.02);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        0 0 40px rgba(104, 242, 194, 0.4);
}

/* ===== 动画定义 ===== */
@keyframes descSidebarSlideIn {
    0% {
        opacity: 0;
        transform: translateX(-30px) translateY(-50%) scale(0.95);
    }
    60% {
        opacity: 0.8;
        transform: translateX(5px) translateY(-50%) scale(1.02);
    }
    80% {
        transform: translateX(-2px) translateY(-50%) scale(0.99);
    }
    100% {
        opacity: 1;
        transform: translateX(0) translateY(-50%) scale(1);
    }
}

/* ===== 标题样式 ===== */
.desc-sidebar-title {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    padding: 12px 0;
    background: linear-gradient(90deg,
        rgba(104, 242, 194, 0.3) 0%,
        rgba(89, 202, 247, 0.3) 48.33%,
        rgba(250, 205, 245, 0.3) 100%
    );
    border-radius: 8px;
    border: 1px solid rgba(104, 242, 194, 0.4);
    box-shadow:
        0 4px 15px rgba(104, 242, 194, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    opacity: 0;
    transform: translateY(10px);
    animation: descTitleFadeIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 1.8s forwards;
    position: relative;
    overflow: hidden;
    z-index: 2;
}

/* 标题光效动画 */
.desc-sidebar-title::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.4),
        transparent
    );
    animation: descTitleGlow 3s ease-in-out infinite;
    z-index: -1;
}

@keyframes descTitleGlow {
    0%, 100% {
        left: -100%;
    }
    50% {
        left: 100%;
    }
}

@keyframes descTitleFadeIn {
    0% {
        opacity: 0;
        transform: translateY(10px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===== 目录容器 ===== */
.desc-catalog {
    max-height: calc(100vh - 300px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(104, 242, 194, 0.6) transparent;
}

.desc-catalog::-webkit-scrollbar {
    width: 6px;
}

.desc-catalog::-webkit-scrollbar-track {
    background: transparent;
}

.desc-catalog::-webkit-scrollbar-thumb {
    background: #FFE8FF;
    border-radius: 3px;
}

/* ===== 目录项 ===== */
.desc-catalog-item {
    margin-bottom: 8px;
    opacity: 0;
    transform: translateX(-15px);
    animation: descCatalogItemFadeIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* 不同等级标题的缩放效果 */
.desc-catalog-item[data-level="1"] {
    transform: translateX(-15px) scale(1.1);
    font-weight: bold;
}

.desc-catalog-item[data-level="2"] {
    transform: translateX(-15px) scale(1.05);
    font-weight: 600;
    margin-left: 15px;
}

.desc-catalog-item[data-level="3"] {
    transform: translateX(-15px) scale(1.0);
    font-weight: 500;
    margin-left: 30px;
}

.desc-catalog-item[data-level="4"] {
    transform: translateX(-15px) scale(0.95);
    font-weight: 400;
    margin-left: 45px;
}

.desc-catalog-item[data-level="5"] {
    transform: translateX(-15px) scale(0.9);
    font-weight: 300;
    margin-left: 60px;
}

.desc-catalog-item[data-level="6"] {
    transform: translateX(-15px) scale(0.85);
    font-weight: 300;
    margin-left: 75px;
}

/* 目录项动画延迟 */
.desc-catalog-item:nth-child(1) { animation-delay: 2.0s; }
.desc-catalog-item:nth-child(2) { animation-delay: 2.1s; }
.desc-catalog-item:nth-child(3) { animation-delay: 2.2s; }
.desc-catalog-item:nth-child(4) { animation-delay: 2.3s; }
.desc-catalog-item:nth-child(5) { animation-delay: 2.4s; }
.desc-catalog-item:nth-child(6) { animation-delay: 2.5s; }
.desc-catalog-item:nth-child(7) { animation-delay: 2.6s; }
.desc-catalog-item:nth-child(8) { animation-delay: 2.7s; }
.desc-catalog-item:nth-child(9) { animation-delay: 2.8s; }
.desc-catalog-item:nth-child(10) { animation-delay: 2.9s; }

@keyframes descCatalogItemFadeIn {
    0% {
        opacity: 0;
        transform: translateX(-15px) scale(0.95);
    }
    60% {
        opacity: 0.8;
        transform: translateX(3px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* 目录项链接 */
.desc-catalog-item a {
    display: block;
    padding: 10px 15px;
    color: #555;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-size: 14px;
    position: relative;
    overflow: hidden;
    z-index: 2;
}

/* 不同等级标题的基础样式 */
.desc-catalog-item[data-level="1"] a {
    font-size: 16px;
    padding: 12px 18px;
    font-weight: bold;
}

.desc-catalog-item[data-level="2"] a {
    font-size: 15px;
    padding: 11px 16px;
    font-weight: 600;
}

.desc-catalog-item[data-level="3"] a {
    font-size: 14px;
    padding: 10px 15px;
    font-weight: 500;
}

.desc-catalog-item[data-level="4"] a {
    font-size: 13px;
    padding: 9px 14px;
    font-weight: 400;
}

.desc-catalog-item[data-level="5"] a {
    font-size: 12px;
    padding: 8px 13px;
    font-weight: 300;
}

.desc-catalog-item[data-level="6"] a {
    font-size: 11px;
    padding: 7px 12px;
    font-weight: 300;
}

/* 链接悬停效果 */
.desc-catalog-item a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        rgba(104, 242, 194, 0.3) 0%,
        rgba(89, 202, 247, 0.3) 48.33%,
        rgba(250, 205, 245, 0.3) 100%
    );
    transition: left 0.5s ease;
    z-index: -1;
}

/* 不同等级标题的悬停效果 */
.desc-catalog-item[data-level="1"] a:hover {
    color: #333;
    transform: translateX(8px) scale(1.15);
    box-shadow:
        0 8px 25px rgba(104, 242, 194, 0.3),
        0 0 30px rgba(104, 242, 194, 0.2);
}

.desc-catalog-item[data-level="2"] a:hover {
    color: #333;
    transform: translateX(8px) scale(1.1);
    box-shadow:
        0 6px 20px rgba(104, 242, 194, 0.25),
        0 0 25px rgba(104, 242, 194, 0.15);
}

.desc-catalog-item[data-level="3"] a:hover {
    color: #333;
    transform: translateX(8px) scale(1.05);
    box-shadow:
        0 5px 15px rgba(104, 242, 194, 0.2),
        0 0 20px rgba(104, 242, 194, 0.1);
}

.desc-catalog-item[data-level="4"] a:hover {
    color: #333;
    transform: translateX(8px) scale(1.0);
    box-shadow:
        0 4px 12px rgba(104, 242, 194, 0.15),
        0 0 15px rgba(104, 242, 194, 0.08);
}

.desc-catalog-item[data-level="5"] a:hover {
    color: #333;
    transform: translateX(8px) scale(0.95);
    box-shadow:
        0 3px 10px rgba(104, 242, 194, 0.12),
        0 0 12px rgba(104, 242, 194, 0.06);
}

.desc-catalog-item[data-level="6"] a:hover {
    color: #333;
    transform: translateX(8px) scale(0.9);
    box-shadow:
        0 2px 8px rgba(104, 242, 194, 0.1),
        0 0 10px rgba(104, 242, 194, 0.05);
}

.desc-catalog-item a:hover::before {
    left: 0;
}

/* 活跃状态样式 - 不同等级标题的活跃效果 */
.desc-catalog-item[data-level="1"].active a {
    background: linear-gradient(90deg,
        rgba(104, 242, 194, 0.8) 0%,
        rgba(89, 202, 247, 0.8) 48.33%,
        rgba(250, 205, 245, 0.8) 100%
    );
    color: #333;
    font-weight: bold;
    transform: translateX(5px) scale(1.2);
    box-shadow:
        0 12px 35px rgba(104, 242, 194, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        0 0 40px rgba(104, 242, 194, 0.3);
    border: 2px solid rgba(104, 242, 194, 0.6);
}

.desc-catalog-item[data-level="2"].active a {
    background: linear-gradient(90deg,
        rgba(104, 242, 194, 0.7) 0%,
        rgba(89, 202, 247, 0.7) 48.33%,
        rgba(250, 205, 245, 0.7) 100%
    );
    color: #333;
    font-weight: bold;
    transform: translateX(5px) scale(1.15);
    box-shadow:
        0 10px 30px rgba(104, 242, 194, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        0 0 35px rgba(104, 242, 194, 0.25);
    border: 2px solid rgba(104, 242, 194, 0.5);
}

.desc-catalog-item[data-level="3"].active a {
    background: linear-gradient(90deg,
        rgba(104, 242, 194, 0.6) 0%,
        rgba(89, 202, 247, 0.6) 48.33%,
        rgba(250, 205, 245, 0.6) 100%
    );
    color: #333;
    font-weight: bold;
    transform: translateX(5px) scale(1.1);
    box-shadow:
        0 8px 25px rgba(104, 242, 194, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 0 30px rgba(104, 242, 194, 0.2);
    border: 1px solid rgba(104, 242, 194, 0.4);
}

.desc-catalog-item[data-level="4"].active a {
    background: linear-gradient(90deg,
        rgba(104, 242, 194, 0.5) 0%,
        rgba(89, 202, 247, 0.5) 48.33%,
        rgba(250, 205, 245, 0.5) 100%
    );
    color: #333;
    font-weight: bold;
    transform: translateX(5px) scale(1.05);
    box-shadow:
        0 6px 20px rgba(104, 242, 194, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        0 0 25px rgba(104, 242, 194, 0.15);
    border: 1px solid rgba(104, 242, 194, 0.3);
}

.desc-catalog-item[data-level="5"].active a {
    background: linear-gradient(90deg,
        rgba(104, 242, 194, 0.4) 0%,
        rgba(89, 202, 247, 0.4) 48.33%,
        rgba(250, 205, 245, 0.4) 100%
    );
    color: #333;
    font-weight: bold;
    transform: translateX(5px) scale(1.0);
    box-shadow:
        0 4px 15px rgba(104, 242, 194, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        0 0 20px rgba(104, 242, 194, 0.1);
    border: 1px solid rgba(104, 242, 194, 0.25);
}

.desc-catalog-item[data-level="6"].active a {
    background: linear-gradient(90deg,
        rgba(104, 242, 194, 0.3) 0%,
        rgba(89, 202, 247, 0.3) 48.33%,
        rgba(250, 205, 245, 0.3) 100%
    );
    color: #333;
    font-weight: bold;
    transform: translateX(5px) scale(0.95);
    box-shadow:
        0 3px 12px rgba(104, 242, 194, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 0 15px rgba(104, 242, 194, 0.08);
    border: 1px solid rgba(104, 242, 194, 0.2);
}

/* 活跃项光效动画 */
.desc-catalog-item.active a::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: descActiveItemGlow 2s ease-in-out infinite;
    z-index: -1;
}

@keyframes descActiveItemGlow {
    0%, 100% {
        left: -100%;
    }
    50% {
        left: 100%;
    }
}

/* ===== 响应式设计 ===== */
@media (max-width: 1200px) {
    .desc-sidebar-container {
        padding-left: 320px;
    }

    .desc-sidebar {
        width: 260px;
    }
}

@media (max-width: 992px) {
    .desc-sidebar-container {
        padding-left: 2rem;
    }

    .desc-sidebar {
        position: static;
        left: auto;
        top: auto;
        width: 100%;
        max-height: none;
        margin: 2rem auto;
        opacity: 1;
        transform: none;
        animation: none;
    }

    .desc-catalog {
        max-height: 200px;
    }
}

@media (max-width: 768px) {
    .desc-sidebar {
        padding: 15px;
        margin-bottom: 1rem;
    }

    .desc-sidebar-title {
        font-size: 18px;
    }

    .desc-catalog-item a {
        font-size: 13px;
        padding: 8px 12px;
    }
}

/* ===== 波纹动画 ===== */
@keyframes descRipple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}
