/* 项目页面抽屉侧边栏专用样式 */

/* 抽屉侧边栏主体 - 通用样式 */
.projects-drawer-sidebar {
    position: fixed;
    top: 0;
    height: 100vh;
    background: rgba(255, 255, 255, 0.85); /* 白色玻璃半透明，比顶栏更不透明 */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 998; /* 优先度低于顶栏 */
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* 左侧边栏样式 - 黑色玻璃效果 */
.projects-drawer-sidebar.left-sidebar {
    left: 0;
    width: 33.333vw; /* 页面1/3宽度 */
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateX(-100%);
}

/* 右侧边栏样式 - 背景图片显示 */
.projects-drawer-sidebar.right-sidebar {
    right: 0;
    width: 66.666vw; /* 页面2/3宽度 */
    background: transparent;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateX(100%);
}

/* 侧边栏展开状态 */
.projects-drawer-sidebar.open {
    transform: translateX(0);
}

/* 侧边栏内容区域 */
.drawer-content {
    padding: 80px 20px 20px; /* 顶部留出空间避免与顶栏重叠 */
    height: 100%;
    overflow-y: auto;
}

/* 侧边栏开关按钮 */
.drawer-toggle {
    position: fixed;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 40px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-left: none;
    border-radius: 0 8px 8px 0;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 开关按钮悬停效果 */
.drawer-toggle:hover {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-50%) translateX(2px);
}

/* 侧边栏展开时开关按钮位置 - 跟随左侧边栏 */
.projects-drawer-sidebar.left-sidebar.open ~ .drawer-toggle {
    left: calc(33.333vw - 1px);
}

/* 响应式设计 - 移动端适配 */
@media (max-width: 768px) {
    .projects-drawer-sidebar.left-sidebar {
        width: 40vw; /* 移动端左侧边栏占40% */
    }
    
    .projects-drawer-sidebar.right-sidebar {
        width: 60vw; /* 移动端右侧边栏占60% */
    }
    
    .projects-drawer-sidebar.left-sidebar.open ~ .drawer-toggle {
        left: calc(40vw - 1px);
    }
}

@media (max-width: 480px) {
    .projects-drawer-sidebar.left-sidebar {
        width: 35vw; /* 超小屏幕左侧边栏占35% */
    }
    
    .projects-drawer-sidebar.right-sidebar {
        width: 65vw; /* 超小屏幕右侧边栏占65% */
    }
    
    .projects-drawer-sidebar.left-sidebar.open ~ .drawer-toggle {
        left: calc(35vw - 1px);
    }
}

/* 开关按钮内的竖线 */
.toggle-lines {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

.toggle-lines .line {
    width: 2px;
    height: 16px;
    background: #666;
    border-radius: 1px;
    transition: all 0.3s ease;
}

/* 侧边栏展开时竖线动画 */
.projects-drawer-sidebar.left-sidebar.open ~ .drawer-toggle .toggle-lines .line:first-child {
    transform: rotate(15deg) translateX(1px);
}

.projects-drawer-sidebar.left-sidebar.open ~ .drawer-toggle .toggle-lines .line:last-child {
    transform: rotate(-15deg) translateX(1px);
}

/* 滚动条样式 */
.drawer-content::-webkit-scrollbar {
    width: 6px;
}

.drawer-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.drawer-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.drawer-content::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* 确保顶栏优先级 */
.blog-header {
    z-index: 1000 !important;
}

/* 动画性能优化 */
.projects-drawer-sidebar,
.drawer-toggle {
    will-change: transform;
}

/* 减少动画时的重绘 */
.projects-drawer-sidebar.animating {
    pointer-events: none;
}