/**
 * 网站前台侧边栏样式 - 电脑端美化版
 * 文件路径: assets/css/sidebar.css
 * 说明: 此文件专门用于美化前台电脑端侧边栏，包含现代设计元素
 */

/* ==================== 侧边栏基础布局 ==================== */
.app-container {
    display: flex;
    min-height: 100vh;
    transition: all 0.3s ease;
}

/* 侧边栏主体 */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-right: 1px solid #e2e8f0;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.06);
}

/* 侧边栏滚动条美化 */
.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* 主内容区域 */
.main-content {
    flex: 1;
    margin-left: 260px;
    width: calc(100% - 260px);
    padding: 20px;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 100vh;
    background: #f1f5f9;
}

/* ==================== 侧边栏头部区域 ==================== */
.sidebar-header {
    padding: 24px 20px;
    text-align: center;
    background: linear-gradient(135deg, #0f766e 0%, #14b8a6 50%, #2dd4bf 100%);
    position: relative;
    overflow: hidden;
}

/* 头部装饰效果 */
.sidebar-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.sidebar-header::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -20%;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

.sidebar-brand {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sidebar-brand:hover {
    color: #fff;
    text-decoration: none;
    transform: scale(1.02);
}

.sidebar-brand i {
    font-size: 26px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

/* ==================== 用户信息区域 ==================== */
.sidebar-user {
    padding: 24px 20px;
    text-align: center;
    background: linear-gradient(180deg, #f0fdfa 0%, #ffffff 100%);
    border-bottom: 1px solid #e2e8f0;
    position: relative;
}

.sidebar-user::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #14b8a6, transparent);
    border-radius: 2px;
}

.sidebar-user img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    margin-bottom: 12px;
    border: 4px solid #fff;
    box-shadow: 0 4px 15px rgba(20, 184, 166, 0.3);
    transition: all 0.3s ease;
    object-fit: cover;
}

.sidebar-user img:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(20, 184, 166, 0.4);
}

.sidebar-user .user-name {
    font-weight: 700;
    color: #1e293b;
    font-size: 16px;
    margin-bottom: 4px;
}

.sidebar-user .user-id {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

/* ==================== 菜单区域 ==================== */
.sidebar-menu {
    padding: 16px 12px;
    list-style: none;
    margin: 0;
}

.sidebar-menu li {
    margin-bottom: 4px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    color: #475569;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 12px;
    margin: 0 4px;
    font-weight: 500;
    font-size: 14px;
    position: relative;
    overflow: hidden;
}

/* 菜单项悬停效果 */
.sidebar-menu li a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(90deg, rgba(20, 184, 166, 0.1), transparent);
    transition: width 0.3s ease;
}

.sidebar-menu li a:hover::before,
.sidebar-menu li.active a::before {
    width: 100%;
}

.sidebar-menu li a:hover {
    background: rgba(20, 184, 166, 0.08);
    color: #0f766e;
    transform: translateX(4px);
}

.sidebar-menu li.active a {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.15) 0%, rgba(20, 184, 166, 0.05) 100%);
    color: #0f766e;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(20, 184, 166, 0.15);
}

/* 菜单图标 */
.sidebar-menu li a i {
    width: 24px;
    text-align: center;
    margin-right: 12px;
    font-size: 16px;
    color: #64748b;
    transition: all 0.3s ease;
}

.sidebar-menu li a:hover i,
.sidebar-menu li.active a i {
    color: #14b8a6;
    transform: scale(1.1);
}

/* 活跃指示器 */
.sidebar-menu li.active a::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: #14b8a6;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(20, 184, 166, 0.6);
}

/* 菜单分隔线 */
.sidebar-menu .menu-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
    margin: 16px 20px;
    list-style: none;
}

/* 退出登录特殊样式 */
.sidebar-menu li a.text-danger,
.sidebar-menu li a .text-danger {
    color: #dc2626;
}

.sidebar-menu li a.text-danger i,
.sidebar-menu li a .text-danger i {
    color: #dc2626;
}

.sidebar-menu li a:hover .text-danger {
    color: #b91c1c;
}

/* ==================== 侧边栏底部 ==================== */
.sidebar-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    text-align: center;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-top: 1px solid #e2e8f0;
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
}

.sidebar-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e2e8f0, transparent);
}

/* ==================== 移动端切换按钮 ==================== */
.mobile-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1001;
    background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
    border: none;
    border-radius: 10px;
    padding: 10px 12px;
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.35);
    color: #fff;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.mobile-toggle:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 6px 16px rgba(20, 184, 166, 0.45);
}

.mobile-toggle:active {
    transform: scale(0.98);
}

.mobile-toggle i {
    font-size: 20px;
}

/* ==================== 底部导航栏 - 移动端 ==================== */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    padding: 8px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
}

.bottom-nav-list {
    display: flex;
    justify-content: space-around;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 60px;
}

.bottom-nav-item {
    flex: 1;
    text-align: center;
    display: flex;
    justify-content: center;
}

.bottom-nav-item a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 12px;
    min-width: 56px;
}

.bottom-nav-item a i {
    font-size: 22px;
    margin-bottom: 3px;
    transition: all 0.3s ease;
}

.bottom-nav-item.active a,
.bottom-nav-item a:hover {
    color: #14b8a6 !important;
    background: rgba(20, 184, 166, 0.1);
}

.bottom-nav-item.active a i {
    transform: translateY(-2px);
}

/* 上传按钮特殊样式 */
.bottom-nav-item.upload-item {
    flex: 0 0 64px;
    margin-top: -24px;
}

.bottom-nav-item.upload-item a {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
    border-radius: 50%;
    color: #fff;
    box-shadow: 0 6px 20px rgba(20, 184, 166, 0.45);
    justify-content: center;
    margin: 0 auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bottom-nav-item.upload-item a i {
    font-size: 24px;
    margin-bottom: 0;
}

.bottom-nav-item.upload-item a:hover {
    background: linear-gradient(135deg, #0d6f68 0%, #12a69e 100%);
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(20, 184, 166, 0.55);
}

.bottom-nav-item.upload-item a:active {
    transform: scale(1.05);
}

/* ==================== 遮罩层 ==================== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

/* ==================== 移动端响应式 ==================== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
        width: 280px;
        background: #fff;
    }

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

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 16px;
        padding-top: 20px;
        padding-bottom: 80px;
    }

    .mobile-toggle {
        display: none;
    }

    .sidebar-header {
        padding: 20px 16px;
    }

    .sidebar-brand {
        font-size: 20px;
    }

    .sidebar-brand i {
        font-size: 24px;
    }

    .sidebar-user {
        padding: 20px 16px;
    }

    .sidebar-user img {
        width: 60px;
        height: 60px;
    }

    .sidebar-menu {
        padding: 12px 8px;
    }

    .sidebar-menu li a {
        padding: 12px 16px;
        font-size: 15px;
    }

    .sidebar-menu li a i {
        width: 22px;
        font-size: 18px;
        margin-right: 14px;
    }

    .sidebar-footer {
        position: relative;
        padding: 14px;
        font-size: 12px;
    }

    .app-container {
        padding-top: 0;
    }

    .bottom-nav {
        display: block;
    }

    .footer {
        display: none;
    }
}

/* ==================== 平板适配 ==================== */
@media (min-width: 769px) and (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }

    .main-content {
        margin-left: 240px;
        width: calc(100% - 240px);
    }

    .sidebar-menu li a {
        padding: 12px 14px;
        font-size: 13px;
    }
}

/* ==================== 大屏幕优化 ==================== */
@media (min-width: 1400px) {
    .sidebar {
        width: 280px;
    }

    .main-content {
        margin-left: 280px;
        width: calc(100% - 280px);
    }

    .sidebar-menu li a {
        padding: 16px 20px;
        font-size: 15px;
    }
}

/* ==================== 动画效果 ==================== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.sidebar-menu li {
    animation: slideIn 0.4s ease-out forwards;
    opacity: 0;
}

.sidebar-menu li:nth-child(1) { animation-delay: 0.05s; }
.sidebar-menu li:nth-child(2) { animation-delay: 0.1s; }
.sidebar-menu li:nth-child(3) { animation-delay: 0.15s; }
.sidebar-menu li:nth-child(4) { animation-delay: 0.2s; }
.sidebar-menu li:nth-child(5) { animation-delay: 0.25s; }
.sidebar-menu li:nth-child(6) { animation-delay: 0.3s; }
.sidebar-menu li:nth-child(7) { animation-delay: 0.35s; }
.sidebar-menu li:nth-child(8) { animation-delay: 0.4s; }

/* ==================== 特殊状态 ==================== */
/* 菜单项徽章 */
.menu-badge {
    margin-left: auto;
    background: linear-gradient(135deg, #0f766e 0%, #14b8a6 100%);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

/* 新功能标记 */
.menu-new::after {
    content: 'NEW';
    margin-left: 8px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #fff;
    font-size: 9px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}
