/* 作者专区 - 现代化侧边栏样式 */

.author-sidebar {
    width: 280px;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fc 100%);
    border-radius: 16px;
    padding: 0;
    border: 1px solid #e5e7eb;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 120px);
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    overflow: hidden;
}

/* ===== 侧边栏头部 ===== */
.sidebar-header {
    padding: 24px 20px;
    background: linear-gradient(135deg, #5D9968 0%, #4C8055 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #ffffff;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.brand-text {
    flex: 1;
}

.brand-title {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
    margin-bottom: 2px;
}

.brand-subtitle {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.2;
}

/* ===== 侧边栏内容 ===== */
.sidebar-content {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
    overflow-x: hidden;
}

/* 自定义滚动条 */
.sidebar-content::-webkit-scrollbar {
    width: 6px;
}

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

.sidebar-content::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

/* ===== 导航区域 ===== */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.nav-section {
    padding: 0 12px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 0 12px 8px 12px;
    margin-bottom: 4px;
}

.section-title i {
    font-size: 12px;
    opacity: 0.6;
}

/* ===== 导航菜单 ===== */
.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    margin: 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 12px;
    color: #4b5563;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* 悬停动画背景 */
.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(93, 153, 104, 0.05), transparent);
    transition: left 0.5s ease;
}

.nav-link:hover::before {
    left: 100%;
}

.nav-link:hover {
    background: linear-gradient(135deg, #f0f7f2 0%, #e8f4ec 100%);
    color: #5D9968;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(93, 153, 104, 0.1);
}

.nav-link.active {
    background: linear-gradient(135deg, #5D9968 0%, #4C8055 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(93, 153, 104, 0.25);
}

.nav-link.active .link-icon i {
    animation: iconPulse 2s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* ===== 链接图标 ===== */
.link-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(93, 153, 104, 0.08);
    border-radius: 8px;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.nav-link:hover .link-icon {
    background: rgba(93, 153, 104, 0.15);
    transform: rotate(-5deg) scale(1.05);
}

.nav-link.active .link-icon {
    background: rgba(255, 255, 255, 0.2);
}

.link-icon i {
    font-size: 18px;
    transition: transform 0.3s ease;
}

/* ===== 链接文本 ===== */
.link-text {
    flex: 1;
    line-height: 1.4;
}

/* ===== 徽章样式 ===== */
.link-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    line-height: 1;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.link-badge.new {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
    animation: badgePulse 2s ease-in-out infinite;
}

.link-badge.hot {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
    animation: badgePulse 2s ease-in-out infinite;
}

.link-badge.count {
    background: #e5e7eb;
    color: #6b7280;
    min-width: 24px;
    text-align: center;
}

.nav-link.active .link-badge.count {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}

@keyframes badgePulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.9;
    }
}

/* ===== 侧边栏底部 ===== */
.sidebar-footer {
    padding: 20px;
    background: linear-gradient(180deg, #f9fafb 0%, #f3f4f6 100%);
    border-top: 1px solid #e5e7eb;
    margin-top: auto;
}

.footer-stats {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-item {
    background: #ffffff;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
}

.stat-item:hover {
    border-color: #5D9968;
    box-shadow: 0 2px 8px rgba(93, 153, 104, 0.1);
    transform: translateY(-2px);
}

.stat-label {
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 4px;
    font-weight: 500;
}

.stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #5D9968;
    line-height: 1.2;
}

/* ===== 移动端适配 ===== */
@media (max-width: 768px) {
    .author-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 300px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        border-radius: 0;
        border: none;
        box-shadow: 8px 0 24px rgba(0, 0, 0, 0.15);
        min-height: 100vh;
    }
    
    .author-sidebar.mobile-open {
        left: 0;
    }
    
    .mobile-sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.6);
        z-index: 999;
        display: none;
        backdrop-filter: blur(4px);
        transition: opacity 0.3s ease;
    }
    
    .mobile-sidebar-overlay.show {
        display: block;
    }
    
    .mobile-sidebar-toggle {
        position: fixed;
        bottom: 24px;
        right: 24px;
        z-index: 1001;
        background: linear-gradient(135deg, #5D9968 0%, #4C8055 100%);
        color: white;
        border: none;
        border-radius: 50%;
        width: 56px;
        height: 56px;
        font-size: 20px;
        cursor: pointer;
        box-shadow: 0 4px 16px rgba(93, 153, 104, 0.4);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .mobile-sidebar-toggle:hover {
        background: linear-gradient(135deg, #4C8055 0%, #3d6644 100%);
        transform: scale(1.1);
        box-shadow: 0 6px 20px rgba(93, 153, 104, 0.5);
    }

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

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

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

    .brand-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .brand-title {
        font-size: 16px;
    }
}

/* ===== 小屏幕优化 ===== */
@media (max-width: 480px) {
    .author-sidebar {
        width: 280px;
    }
}

/* ===== 深色模式支持 ===== */
@media (prefers-color-scheme: dark) {
    .author-sidebar {
        background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
        border-color: #374151;
    }

    .sidebar-header {
        background: linear-gradient(135deg, #4C8055 0%, #3d6644 100%);
    }

    .section-title {
        color: #9ca3af;
    }

    .nav-link {
        color: #d1d5db;
    }

    .nav-link:hover {
        background: linear-gradient(135deg, rgba(93, 153, 104, 0.15) 0%, rgba(76, 128, 85, 0.1) 100%);
        color: #86efac;
    }

    .link-icon {
        background: rgba(93, 153, 104, 0.15);
    }

    .sidebar-footer {
        background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
        border-color: #374151;
    }

    .stat-item {
        background: #1f2937;
        border-color: #374151;
    }

    .stat-label {
        color: #9ca3af;
    }
}
