/* ============================================
   AI 面试官 v2.0 - 活泼产品风侧边栏
   深紫渐变背景 + 品牌绿点缀 + 大圆角 + 弹性动效
   ============================================ */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--gradient-sidebar);
    color: #e9d5ff;
    padding: var(--space-6) var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    z-index: 1000;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

/* 顶部光晕装饰 */
.sidebar::before {
    content: '';
    position: absolute;
    top: -80px;
    right: -80px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(88, 204, 2, 0.18) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.sidebar::after {
    content: '';
    position: absolute;
    bottom: 100px;
    left: -60px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(255, 107, 53, 0.14) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

/* === Logo 区域 === */
.sidebar-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3) var(--space-5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    z-index: 1;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: var(--gradient-brand);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: var(--shadow-brand), 0 0 0 4px rgba(88, 204, 2, 0.15);
    transition: transform var(--transition-bounce);
    cursor: pointer;
}

.logo-icon:hover {
    transform: scale(1.08) rotate(-6deg);
}

.logo-text {
    font-family: var(--font-display);
    font-size: 19px;
    font-weight: var(--weight-extrabold);
    background: linear-gradient(135deg, #ffffff 0%, #89e219 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.3px;
}

.version-tag {
    display: inline-block;
    padding: 2px 10px;
    background: rgba(88, 204, 2, 0.18);
    color: #89e219;
    border: 1px solid rgba(88, 204, 2, 0.3);
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: var(--weight-semibold);
    margin-top: var(--space-1);
    letter-spacing: 0.5px;
}

/* === 导航菜单 === */
.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    position: relative;
    z-index: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    color: rgba(233, 213, 255, 0.7);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    font-weight: var(--weight-medium);
    font-size: var(--text-sm);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
}

/* 左侧装饰色条 */
.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    height: 0;
    width: 3px;
    background: var(--gradient-brand);
    border-radius: 0 var(--radius-full) var(--radius-full) 0;
    transform: translateY(-50%);
    transition: height var(--transition-bounce);
}

/* 背景光泽 */
.nav-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(88, 204, 2, 0.12) 0%, transparent 100%);
    opacity: 0;
    transition: opacity var(--transition-base);
    border-radius: var(--radius-md);
}

.nav-item:hover {
    color: #ffffff;
    transform: translateX(2px);
}

.nav-item:hover::before {
    height: 60%;
}

.nav-item:hover::after {
    opacity: 1;
}

.nav-item.active {
    color: #ffffff;
    background: rgba(88, 204, 2, 0.16);
    border-color: rgba(88, 204, 2, 0.3);
    box-shadow: 0 4px 14px -4px rgba(88, 204, 2, 0.35);
}

.nav-item.active::before {
    height: 70%;
}

.nav-item.active::after {
    opacity: 1;
}

.nav-icon {
    font-size: 18px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex-shrink: 0;
    transition: transform var(--transition-bounce);
}

.nav-item:hover .nav-icon {
    transform: scale(1.15);
}

.nav-item.active .nav-icon {
    transform: scale(1.1);
}

.nav-label {
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    letter-spacing: 0.2px;
}

.nav-badge {
    margin-left: auto;
    padding: 2px 8px;
    background: var(--gradient-cta);
    color: white;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: var(--weight-bold);
    box-shadow: 0 2px 6px rgba(255, 107, 53, 0.4);
}

/* === 底部用户区 === */
.sidebar-footer {
    padding: var(--space-4) var(--space-3) 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    z-index: 1;
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2);
    border-radius: var(--radius-md);
    transition: background var(--transition-base);
    cursor: pointer;
}

.user-info:hover {
    background: rgba(255, 255, 255, 0.06);
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    background: var(--gradient-brand);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: var(--weight-bold);
    color: white;
    box-shadow: var(--shadow-brand);
    border: 2px solid rgba(255, 255, 255, 0.15);
    transition: transform var(--transition-bounce);
}

.user-info:hover .user-avatar {
    transform: scale(1.08);
}

.user-name {
    font-size: var(--text-sm);
    font-weight: var(--weight-semibold);
    color: #ffffff;
}

.user-role {
    font-size: 11px;
    color: rgba(233, 213, 255, 0.6);
    margin-top: 2px;
}

/* === 移动端汉堡按钮 === */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: var(--space-4);
    left: var(--space-4);
    z-index: 1001;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    background: var(--gradient-brand);
    color: white;
    border: none;
    font-size: 20px;
    cursor: pointer;
    box-shadow: var(--shadow-brand);
    transition: transform var(--transition-bounce);
}

.mobile-menu-btn:hover {
    transform: scale(1.05);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(30, 27, 75, 0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    transition: opacity var(--transition-base);
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* === 响应式：移动端显示汉堡菜单 === */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-base);
        width: 260px;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.active {
        display: block;
    }
}
