/**
 * 侧边栏布局样式文件
 * 
 * @file layout/sidebar.css
 * @description 侧边栏导航组件的完整样式定义，包括Logo、导航菜单、响应式适配
 * @author CodeBuddy
 * @created 2025-01-13
 * @version 2.0.0
 * 
 * 功能说明：
 * - 固定宽度侧边栏布局
 * - 毛玻璃效果和现代化设计
 * - Logo区域和导航菜单
 * - 悬停和激活状态
 * - 退出按钮特殊样式
 * - 响应式适配（桌面端）
 * 
 * 注意：移动端响应式样式在 responsive/mobile.css 中定义
 */

/* ================================
   侧边栏主容器
   ================================ */

/* 侧边栏主容器 - 固定宽度，毛玻璃效果 */
.sidebar {
    width: 260px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    padding: 25px 15px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 100;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
}

/* 侧边栏滚动条样式 */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 153, 0, 0.3);
    border-radius: 3px;
    transition: background 0.2s ease;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 153, 0, 0.5);
}

/* ================================
   侧边栏头部 - Logo区域
   ================================ */

/* 侧边栏头部 - Logo区域 */
.sidebar-header {
    display: flex;
    align-items: center;
    padding: 0 10px 25px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    margin-bottom: 25px;
    flex-shrink: 0; /* 防止Logo区域被压缩 */
}

/* Logo容器 - 图标和文字组合 */
.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.logo:hover {
    transform: scale(1.02);
    text-decoration: none;
}

/* Logo图标 - 圆角背景，居中显示 */
.logo-icon {
    background: linear-gradient(135deg, #ff9900, #ff7700);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    box-shadow: 0 4px 12px rgba(255, 153, 0, 0.3);
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.logo:hover .logo-icon {
    box-shadow: 0 6px 16px rgba(255, 153, 0, 0.4);
    transform: translateY(-1px);
}

/* Logo文字 - 渐变色文字效果 */
.logo-text {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, #ff9900, #ff7700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
    transition: all 0.2s ease;
}

/* ================================
   用户信息区域
   ================================ */

/* ================================
   用户信息区域 - 美化版本
   ================================ */

/* 用户信息容器 - 现代化设计 */
.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 16px;
    margin: 15px 0 8px;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.95) 0%, 
        rgba(248, 250, 252, 0.9) 50%, 
        rgba(241, 245, 249, 0.85) 100%);
    border-radius: 16px;
    border: 1px solid rgba(255, 152, 0, 0.15);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.08),
        0 2px 4px rgba(255, 152, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* 用户信息容器悬停效果 */
.user-info:hover {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 1) 0%, 
        rgba(248, 250, 252, 0.95) 50%, 
        rgba(241, 245, 249, 0.9) 100%);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.12),
        0 4px 8px rgba(255, 152, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    border-color: rgba(255, 152, 0, 0.25);
}

/* 用户信息背景装饰 */
.user-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 152, 0, 0.6) 20%, 
        rgba(255, 193, 7, 0.8) 50%, 
        rgba(255, 152, 0, 0.6) 80%, 
        transparent 100%);
    border-radius: 16px 16px 0 0;
}

/* 用户头像 - 增强版 */
.user-avatar {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, 
        #ff9900 0%, 
        #ff7700 50%, 
        #e65100 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 
        0 4px 12px rgba(255, 153, 0, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    position: relative;
}

/* 头像悬停效果 */
.user-info:hover .user-avatar {
    transform: scale(1.05) rotate(5deg);
    box-shadow: 
        0 6px 16px rgba(255, 153, 0, 0.4),
        0 3px 6px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* 头像发光效果 */
.user-avatar::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, 
        rgba(255, 153, 0, 0.4), 
        rgba(255, 119, 0, 0.2));
    border-radius: 50%;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.user-info:hover .user-avatar::after {
    opacity: 1;
}

/* 用户详细信息 */
.user-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 积分和充值按钮区域 */
.user-points-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 用户名 - 美化版 */
.username {
    font-size: 16px;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.85);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: linear-gradient(135deg, 
        rgba(0, 0, 0, 0.85) 0%, 
        rgba(0, 0, 0, 0.7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: all 0.2s ease;
}

.user-info:hover .username {
    background: linear-gradient(135deg, 
        #ff9900 0%, 
        #ff7700 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 用户积分 - 增强版 */
.user-points {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.6);
    padding: 6px 10px;
    background: linear-gradient(135deg, 
        rgba(255, 193, 7, 0.1) 0%, 
        rgba(255, 152, 0, 0.08) 100%);
    border-radius: 20px;
    border: 1px solid rgba(255, 152, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

/* 积分区域悬停效果 */
.user-info:hover .user-points {
    background: linear-gradient(135deg, 
        rgba(255, 193, 7, 0.15) 0%, 
        rgba(255, 152, 0, 0.12) 100%);
    border-color: rgba(255, 152, 0, 0.3);
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.15);
}

/* 积分星星图标 */
.user-points i {
    color: #ffc107;
    font-size: 16px;
    animation: starPulse 2s ease-in-out infinite;
    filter: drop-shadow(0 0 4px rgba(255, 193, 7, 0.4));
}

/* 星星脉冲动画 */
@keyframes starPulse {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 4px rgba(255, 193, 7, 0.4));
    }
    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 8px rgba(255, 193, 7, 0.6));
    }
}

/* 积分数值 */
.points-value {
    font-weight: 700;
    font-size: 16px;
    color: #ff9900;
    text-shadow: 0 1px 2px rgba(255, 153, 0, 0.2);
    transition: all 0.2s ease;
}

.user-info:hover .points-value {
    color: #e65100;
    text-shadow: 0 1px 3px rgba(230, 81, 0, 0.3);
}

/* 积分标签 */
.points-label {
    color: rgba(0, 0, 0, 0.6);
    font-weight: 500;
    font-size: 13px;
    transition: color 0.2s ease;
}

.user-info:hover .points-label {
    color: rgba(0, 0, 0, 0.8);
}

/* 积分区域闪光效果 */
.user-points::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.4) 50%, 
        transparent 100%);
    transition: left 0.6s ease;
}

.user-info:hover .user-points::before {
    left: 100%;
}

/* ================================
   充值按钮样式
   ================================ */

/* 充值按钮 - 现代化设计 */
.recharge-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    background: linear-gradient(135deg, 
        #4CAF50 0%, 
        #45a049 50%, 
        #3d8b40 100%);
    color: white;
    border: none;
    border-radius: 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 2px 8px rgba(76, 175, 80, 0.3),
        0 1px 3px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    min-width: 70px;
}

/* 充值按钮悬停效果 */
.recharge-btn:hover {
    background: linear-gradient(135deg, 
        #5CBF60 0%, 
        #4CAF50 50%, 
        #45a049 100%);
    transform: translateY(-1px);
    box-shadow: 
        0 4px 12px rgba(76, 175, 80, 0.4),
        0 2px 6px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* 充值按钮按下效果 */
.recharge-btn:active {
    transform: translateY(0);
    box-shadow: 
        0 2px 6px rgba(76, 175, 80, 0.3),
        0 1px 2px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* 充值按钮图标 */
.recharge-btn i {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.recharge-btn:hover i {
    transform: rotate(90deg);
}

/* 充值按钮闪光效果 */
.recharge-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.3) 50%, 
        transparent 100%);
    transition: left 0.6s ease;
}

.recharge-btn:hover::before {
    left: 100%;
}

/* 充值按钮文字 */
.recharge-btn span {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* ================================
   导航菜单区域
   ================================ */

/* 导航链接容器 - 垂直排列，占满剩余空间 */
.nav-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    padding: 0;
    margin: 0;
    list-style: none;
}

/* 导航项目 - 可点击的菜单项 */
.nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.7);
    text-decoration: none;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

/* 导航项目悬停效果 */
.nav-item:hover {
    background: rgba(229, 242, 255, 0.8);
    color: #0056b3;
    text-decoration: none;
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(0, 86, 179, 0.1);
}

/* 导航项目激活状态 */
.nav-item.active {
    background: linear-gradient(135deg, rgba(229, 242, 255, 0.9), rgba(229, 242, 255, 0.7));
    color: #0056b3;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 3px 12px rgba(0, 86, 179, 0.15);
    border-left: 3px solid #ff9900;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, #ff9900, #ff7700);
    border-radius: 0 2px 2px 0;
}

/* 导航图标 - 固定宽度，居中对齐 */
.nav-item i {
    width: 24px;
    text-align: center;
    font-size: 18px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.nav-item:hover i,
.nav-item.active i {
    color: #ff9900;
    transform: scale(1.1);
}

/* 导航文字 */
.nav-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.2s ease;
}

/* ================================
   导航分组和分隔符
   ================================ */

/* 导航分组标题 */
.nav-group-title {
    font-size: 12px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 20px 20px 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* 导航分隔符 */
.nav-spacer {
    flex-grow: 1;
    min-height: 20px;
}

.nav-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
    margin: 15px 20px;
}

/* ================================
   特殊导航项目
   ================================ */


/* 退出按钮的视觉分离 */
.logout-btn {
    margin-top: 12px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding-top: 14px;
    color: var(--danger, #dc3545);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger, #dc3545);
    text-decoration: none;
    transform: translateX(3px);
}

.logout-btn i {
    color: var(--danger, #dc3545);
    width: 24px;
    text-align: center;
    font-size: 18px;
    transition: all 0.2s ease;
}

.logout-btn:hover i {
    transform: scale(1.1);
}

/* ================================
   侧边栏状态指示器
   ================================ */

/* 通知徽章 */
.nav-item .badge {
    background: #ff9900;
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: auto;
    min-width: 18px;
    text-align: center;
    line-height: 1.2;
}

.nav-item .badge.danger {
    background: var(--danger, #dc3545);
}

.nav-item .badge.success {
    background: var(--success, #28a745);
}

.nav-item .badge.warning {
    background: var(--warning, #ffc107);
    color: #000;
}

/* 在线状态指示器 */
.nav-item .status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #28a745;
    margin-left: auto;
    flex-shrink: 0;
}

.nav-item .status-indicator.offline {
    background: #6c757d;
}

.nav-item .status-indicator.busy {
    background: #dc3545;
}

.nav-item .status-indicator.away {
    background: #ffc107;
}

/* ================================
   桌面端响应式适配
   ================================ */

/* 大桌面屏幕 (1200px 以上) - 默认样式 */
@media (min-width: 1201px) {
    .sidebar {
        width: 260px;
    }
    
    .logo-text,
    .nav-text {
        display: block;
    }
    
    .nav-item {
        justify-content: flex-start;
        padding: 14px 20px;
    }
}

/* 中等桌面屏幕 (1025px - 1200px) - 收缩侧边栏 */
@media (min-width: 1025px) and (max-width: 1200px) {
    .sidebar {
        width: 80px;
        padding: 25px 10px;
    }
    
    .logo-text,
    .nav-text {
        display: none;
    }
    
    /* 收缩状态下的用户信息 - 美化版 */
    .user-info {
        justify-content: center;
        padding: 12px 8px;
        margin: 10px 0 6px;
        flex-direction: column;
        gap: 8px;
        background: linear-gradient(135deg, 
            rgba(255, 255, 255, 0.9) 0%, 
            rgba(248, 250, 252, 0.85) 100%);
    }
    
    .user-details {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        width: 100%;
    }
    
    .user-avatar {
        width: 36px;
        height: 36px;
        font-size: 16px;
        margin-bottom: 4px;
    }
    
    /* 收缩状态下的用户名 */
    .username {
        font-size: 12px;
        text-align: center;
        max-width: 60px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    /* 收缩状态下的积分显示 */
    .user-points {
        padding: 4px 6px;
        font-size: 11px;
        border-radius: 12px;
        gap: 4px;
        min-width: 50px;
        justify-content: center;
    }
    
    .user-points i {
        font-size: 12px;
    }
    
    .points-value {
        font-size: 12px;
    }
    
    .points-label {
        display: none;
    }
    
    .logo {
        justify-content: center;
    }
    
    .nav-item {
        justify-content: center;
        padding: 18px 0;
        gap: 0;
    }
    
    .nav-item i {
        margin: 0;
    }
    
    .sidebar-header {
        padding: 0 0 25px;
        justify-content: center;
    }
    
    .nav-group-title {
        display: none;
    }
    

    .logout-btn {
        justify-content: center;
        padding: 18px 0;
        gap: 0;
    }
    
    /* 工具提示显示完整文字 */
    .nav-item[title]:hover::after {
        content: attr(title);
        position: absolute;
        left: 100%;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(0, 0, 0, 0.9);
        color: white;
        padding: 8px 12px;
        border-radius: 6px;
        font-size: 14px;
        white-space: nowrap;
        z-index: 1000;
        margin-left: 10px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    
    .nav-item[title]:hover::before {
        content: '';
        position: absolute;
        left: 100%;
        top: 50%;
        transform: translateY(-50%);
        border: 6px solid transparent;
        border-right-color: rgba(0, 0, 0, 0.9);
        margin-left: 4px;
        z-index: 1000;
    }
}

/* ================================
   侧边栏动画效果
   ================================ */

/* 侧边栏展开/收缩动画 */
.sidebar.collapsed {
    width: 80px;
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-text {
    opacity: 0;
    transform: translateX(-20px);
}

.sidebar.collapsed .nav-item {
    justify-content: center;
}

/* 导航项目加载动画 */
@keyframes navItemSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* .nav-item {
    animation: navItemSlideIn 0.3s ease forwards;
}

.nav-item:nth-child(1) { animation-delay: 0.1s; }
.nav-item:nth-child(2) { animation-delay: 0.2s; }
.nav-item:nth-child(3) { animation-delay: 0.3s; }
.nav-item:nth-child(4) { animation-delay: 0.4s; }
.nav-item:nth-child(5) { animation-delay: 0.5s; }
.nav-item:nth-child(6) { animation-delay: 0.6s; } */

/* ================================
   可访问性优化
   ================================ */

/* 键盘导航支持 */
.nav-item:focus {
    outline: 2px solid #ff9900;
    outline-offset: 2px;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .sidebar {
        border-right: 2px solid #000;
        background: #fff;
        backdrop-filter: none;
    }
    
    .nav-item {
        border: 1px solid transparent;
    }
    
    .nav-item:hover,
    .nav-item.active {
        border-color: #000;
        background: #f0f0f0;
    }
    
    .logo-icon {
        border: 2px solid #000;
    }
}

/* 减少动画模式 */
@media (prefers-reduced-motion: reduce) {
    .sidebar,
    .nav-item,
    .logo,
    .logo-icon {
        transition: none;
        animation: none;
    }
}

/* ================================
   打印样式
   ================================ */

@media print {
    .sidebar {
        display: none;
    }
}

/* ================================
   深色模式支持 (预留)
   ================================ */

@media (prefers-color-scheme: dark) {
    .sidebar {
        background: rgba(30, 30, 30, 0.95);
        border-right-color: rgba(255, 255, 255, 0.1);
    }
    
    .nav-item {
        color: rgba(255, 255, 255, 0.8);
    }
    
    .nav-item:hover,
    .nav-item.active {
        background: rgba(255, 153, 0, 0.2);
        color: #ff9900;
    }
    
    .sidebar-header {
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }
    
    .nav-group-title {
        color: rgba(255, 255, 255, 0.6);
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }
    
    .nav-divider {
        background: rgba(255, 255, 255, 0.1);
    }
}