/* ============================================================
   侧边栏样式（PC可折叠 + 移动端抽屉）
   文件名：sidebar.css
   ============================================================ */

/* ---------- 汉堡按钮（仅移动端） ---------- */
.hamburger-btn {
    position: fixed;
    top: 50%;               /* 垂直居中 */
    right: 15px;            /* 距离右侧 15px */
    transform: translateY(-50%);  /* 精确垂直居中 */
    z-index: 999;
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    padding: 5px 4px;
    background: rgba(255, 255, 255, 0.85);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    backdrop-filter: blur(6px);
    transition: background 0.2s;
    align-items: center;
}
.hamburger-btn:hover {
    background: rgba(255, 255, 255, 0.95);
}
.hamburger-line {
    display: block;
    width: 20px;
    height: 2.5px;
    border-radius: 2px;
    background: #333;
    transition: 0.3s;
    flex-shrink: 0;
}
.hamburger-btn.active .hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.hamburger-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.hamburger-btn.active .hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* ---------- PC 侧边栏 ---------- */
.sidebar-pc {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    width: 220px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: saturate(180%) blur(16px);
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.08);
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
/* 折叠状态 */
.sidebar-pc.collapsed {
    width: 64px;
}
.sidebar-pc.collapsed .sidebar-pc-brand {
    opacity: 0;
    transform: scale(0.8);
    width: 0;
    overflow: hidden;
    margin: 0;
}
.sidebar-pc.collapsed .sidebar-pc-label {
    opacity: 0;
    width: 0;
    overflow: hidden;
    margin-left: 0;
}
.sidebar-pc.collapsed .sidebar-pc-link {
    justify-content: center;
    padding: 14px 0;
}
.sidebar-pc.collapsed .sidebar-pc-icon {
    margin-right: 0;
}
.sidebar-pc.collapsed #toggleIcon {
    transform: rotate(180deg);
}

.sidebar-pc-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px 0 20px 0;
    width: 100%;
    flex-shrink: 0;
}

.sidebar-pc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px 20px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
    min-height: 56px;
    gap: 8px;
}
.sidebar-pc-brand {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, #f436a1, #ff6b9d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    transition: opacity 0.3s, transform 0.3s, width 0.3s;
    white-space: nowrap;
    letter-spacing: 0.5px;
    overflow: hidden;
    flex-shrink: 0;
}
.sidebar-pc-toggle {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(244, 54, 161, 0.12);
    color: #f436a1;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.3s;
    flex-shrink: 0;
    margin-left: auto;
}
.sidebar-pc-toggle:hover {
    background: rgba(244, 54, 161, 0.22);
}
.sidebar-pc-toggle:active {
    transform: scale(0.92);
}
.sidebar-pc-toggle i {
    transition: transform 0.35s;
    pointer-events: none;
}

.sidebar-pc-nav {
    flex: 1;
    padding: 12px 10px 0 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.sidebar-pc-link {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    border-radius: 10px;
    color: #444;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, padding 0.3s;
    white-space: nowrap;
    min-height: 48px;
    overflow: hidden;
}
.sidebar-pc-link:hover {
    background: rgba(244, 54, 161, 0.10);
    color: #f436a1;
}
.sidebar-pc-link:active {
    background: rgba(244, 54, 161, 0.18);
    transform: scale(0.97);
}
.sidebar-pc-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
    margin-right: 12px;
    transition: margin 0.3s;
    background: rgba(0, 0, 0, 0.04);
    padding: 2px;
}
.sidebar-pc-label {
    font-size: 15px;
    font-weight: 500;
    transition: opacity 0.3s, width 0.3s, margin 0.3s;
    overflow: hidden;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ---------- 移动端抽屉 ---------- */
.sidebar-mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s, visibility 0.35s;
}
.sidebar-mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

.sidebar-mobile {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    max-width: 80vw;
    height: 100%;
    z-index: 2001;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: saturate(180%) blur(20px);
    box-shadow: -4px 0 30px rgba(0, 0, 0, 0.12);
    transition: right 0.40s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}
.sidebar-mobile.open {
    right: 0;
}

.sidebar-mobile-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 20px 0;
}

.sidebar-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px 18px 18px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
    min-height: 60px;
}
.sidebar-mobile-brand {
    font-size: 19px;
    font-weight: 700;
    background: linear-gradient(135deg, #f436a1, #ff6b9d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.5px;
}
.sidebar-mobile-close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.05);
    color: #555;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}
.sidebar-mobile-close:hover {
    background: rgba(0, 0, 0, 0.10);
}
.sidebar-mobile-close:active {
    transform: scale(0.90);
}

.sidebar-mobile-nav {
    flex: 1;
    padding: 14px 12px 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.sidebar-mobile-link {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-radius: 12px;
    color: #444;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.15s;
    min-height: 52px;
}
.sidebar-mobile-link:hover {
    background: rgba(244, 54, 161, 0.08);
    color: #f436a1;
}
.sidebar-mobile-link:active {
    background: rgba(244, 54, 161, 0.16);
    transform: scale(0.96);
}
.sidebar-mobile-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
    margin-right: 14px;
    background: rgba(0, 0, 0, 0.04);
    padding: 2px;
}
.sidebar-mobile-label {
    font-size: 16px;
    font-weight: 500;
    flex-shrink: 0;
}

/* ============================================================
   响应式切换
   ============================================================ */
@media (min-width: 769px) {
    .sidebar-pc {
        display: flex;
    }
    .hamburger-btn {
        display: none !important;
    }
    .sidebar-mobile-overlay,
    .sidebar-mobile {
        display: none !important;
    }
    body {
        padding-left: 220px;
        transition: padding-left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }
    body.sidebar-pc-collapsed {
        padding-left: 64px;
    }
}

@media (max-width: 768px) {
    .sidebar-pc {
        display: none !important;
    }
    .hamburger-btn {
        display: flex !important;
    }
    .sidebar-mobile-overlay,
    .sidebar-mobile {
        display: flex !important;
    }
    .sidebar-mobile-overlay {
        display: block !important;
    }
    body {
        padding-left: 0 !important;
    }
    .header {
        padding-left: 50px !important;
    }
}

@media (max-width: 480px) {
    .sidebar-mobile {
        width: 260px;
        max-width: 82vw;
    }
    .sidebar-mobile-brand {
        font-size: 17px;
    }
    .sidebar-mobile-label {
        font-size: 15px;
    }
    .sidebar-mobile-link {
        padding: 12px 14px;
        min-height: 46px;
    }
    .sidebar-mobile-icon {
        width: 24px;
        height: 24px;
        margin-right: 12px;
    }
}

/* 滚动条美化 */
.sidebar-pc-nav::-webkit-scrollbar,
.sidebar-mobile-nav::-webkit-scrollbar {
    width: 4px;
}
.sidebar-pc-nav::-webkit-scrollbar-track,
.sidebar-mobile-nav::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar-pc-nav::-webkit-scrollbar-thumb,
.sidebar-mobile-nav::-webkit-scrollbar-thumb {
    background: rgba(244, 54, 161, 0.25);
    border-radius: 4px;
}
.sidebar-pc-nav::-webkit-scrollbar-thumb:hover,
.sidebar-mobile-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(244, 54, 161, 0.40);
}