/* 全局样式 */
body {
    font-family: 'Rubik', sans-serif;
    background-color: #f8f9fa;
    color: #333;
}

/* 导航栏样式 */
.navbar {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.navbar-container {
    padding: 0.5rem 1rem;
}

.navbar .d-flex.align-items-center {
    gap: 1rem;
}

.search-container {
    margin: 0 1.5rem;
}

.navbar-left {
    flex: 1;
}

.search-container {
    flex: 2;
    max-width: 500px;
}

.search-form {
    width: 100%;
}

.search-input-group {
    display: flex;
    width: 100%;
}

.rounded-r-none {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.rounded-l-none {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.search-btn {
    padding: 0.375rem 0.75rem;
}

.user-avatar-small {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

/* 自定义容器 */
.custom-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 15px;
    margin-top: 10px;
    padding-top: 40px;
    padding-bottom: 40px; /* 增加底部内边距防止底部内容被遮挡 */
}

/* 侧边栏样式 */
.sidebar {
    border-radius: 10px;
    overflow: hidden;
    position: static;
    margin-top: 20px;
    height: auto;
}

.sidebar .card-body {
    padding: 1.5rem 1rem 0rem 1rem;
}

/* 确保侧边栏在桌面端可见且不被遮挡 */
@media (min-width: 992px) {
    .sidebar {
        position: sticky;
        top: 20px;
        height: fit-content;
        max-height: calc(100vh - 40px);
    }
}

.avatar-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin-bottom: 5px;
}

.avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.avatar-upload-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.avatar-upload-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.avatar-upload-btn:active {
    transform: scale(0.95);
}

.avatar-upload-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.sidebar-menu {
    margin-top: 0;
}

#editProfile {
    margin-bottom: 0 !important;
}

.sidebar .list-group-flush {
    margin-top: -20px !important;
    padding-top: 0 !important;
}

/* 确保导航项完全可见 */
.sidebar-menu .list-group-item {
    padding: 0.875rem 1.25rem;
    position: relative;
    z-index: 10;
}

/* 确保侧边栏底部不被遮挡 */
.sidebar {
    padding-bottom: 20px;
}

/* 确保最后一个导航项完全可见 */
.sidebar-menu .list-group-item:last-child {
    margin-bottom: 15px;
    padding-bottom: 1rem;
}

.sidebar-menu .list-group-item {
    border-left: 0;
    border-right: 0;
    padding: 0.75rem 1.25rem;
    transition: all 0.3s ease;
}

.sidebar-menu .list-group-item:first-child {
    border-top: 1px solid rgba(0, 0, 0, 0.125);
}

.sidebar-menu .list-group-item.active {
    background-color: #007bff;
    border-color: #007bff;
}

.sidebar-menu .list-group-item:hover:not(.active) {
    background-color: #f8f9fa;
}

/* 欢迎卡片 */
.welcome-card {
    border-radius: 10px;
    overflow: hidden;
    margin-top: 20px;
}

/* 统计卡片 */
.stat-card {
    border-radius: 10px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 20px;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.bg-primary-light {
    background-color: rgba(0, 123, 255, 0.1);
}

.bg-success-light {
    background-color: rgba(40, 167, 69, 0.1);
}

.bg-warning-light {
    background-color: rgba(255, 193, 7, 0.1);
}

.bg-info-light {
    background-color: rgba(23, 162, 184, 0.1);
}

/* 活动列表 */
.activity-list {
    max-height: 400px;
    overflow-y: auto;
}

/* 活动时间线 */
.activity-timeline {
    position: relative;
    padding-left: 0;
}

.activity-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
    min-width: 0;
}

.activity-content h6 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.activity-content p {
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.activity-time {
    display: inline-block;
    font-size: 0.75rem;
    color: #999;
    margin-top: 0.25rem;
}

/* 博客列表 */
.blog-list, .favorite-list {
    max-height: 600px;
    overflow-y: auto;
}

.blog-item, .favorite-item {
    transition: background-color 0.3s ease;
}

.blog-item:hover, .favorite-item:hover {
    background-color: #f8f9fa;
}

/* 消息列表 */
.message-list {
    max-height: 500px;
    overflow-y: auto;
}

.message-item {
    transition: background-color 0.3s ease;
}

.message-item.unread {
    background-color: rgba(0, 123, 255, 0.05);
}

.message-item:hover {
    background-color: #f8f9fa;
}

.message-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

/* 表单样式 */
.form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* 响应式调整 - 使用更现代的断点系统和弹性布局 */

/* 移动优先设计 - 基础样式 */
.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    height: 100vh;
    width: 280px;
    z-index: 1050;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    background-color: #fff;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    transform: translateX(0);
}

.sidebar.active {
    left: 0;
    transform: translateX(0);
}

.content-wrapper {
    margin-left: 0;
    padding-top: 64px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.active + .content-wrapper {
    transform: translateX(280px);
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1040;
    height: 64px;
    display: flex;
    align-items: center;
}

.toggle-sidebar {
    display: block;
    margin-right: 15px;
    border: none;
    background: transparent;
    font-size: 1.5rem;
    color: #495057;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s;
}

.toggle-sidebar:hover {
    color: #007bff;
}

/* 平板和桌面断点 */
@media (min-width: 768px) {
    .sidebar {
        left: 0;
        width: 240px;
    }
    
    .content-wrapper {
        margin-left: 240px;
        padding-top: 0;
    }
    
    .header {
        position: static;
        padding-left: 240px;
    }
    
    .toggle-sidebar {
        display: none;
    }
}

/* 中等屏幕优化 */
@media (max-width: 1199.98px) {
    .sidebar {
        width: 220px;
    }
    
    .content-wrapper {
        margin-left: 220px;
    }
    
    .header {
        padding-left: 220px;
    }
    
    .search-bar {
        width: 250px;
        max-width: 100%;
    }
    
    .nav-link {
        font-size: 0.95rem;
    }
}

/* 平板优化 */
@media (max-width: 991.98px) {
    .sidebar {
        width: 200px;
        left: -200px;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .content-wrapper {
        margin-left: 0;
        padding-top: 64px;
    }
    
    .header {
        position: fixed;
        padding-left: 0;
    }
    
    .toggle-sidebar {
        display: block;
    }
    
    .search-bar {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .navbar-collapse {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #fff;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        padding: 15px;
        z-index: 1030;
    }
    
    .user-info {
        display: flex;
        align-items: center;
    }
}

/* 移动端优化 */
@media (max-width: 767.98px) {
    .sidebar {
        width: 100%;
        left: -100%;
    }
    
    .navbar-nav {
        flex-direction: column;
    }
    
    .nav-item {
        margin-right: 0;
        margin-bottom: 8px;
    }
    
    .card {
        margin-bottom: 16px;
        border-radius: 8px;
    }
    
    .activity-item,
    .blog-item,
    .message-item {
        padding: 12px;
        border-radius: 6px;
    }
    
    .user-avatar {
        width: 36px;
        height: 36px;
    }
    
    .avatar-container {
        width: 70px;
        height: 70px;
    }
    
    .nav-link {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .content-wrapper {
        padding: 16px 12px;
    }
    
    .dashboard-cards {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .table-responsive {
        border-radius: 8px;
        overflow: hidden;
    }
    
    /* 触摸友好的交互元素 */
    .btn,
    .form-control,
    .input-group-text {
        min-height: 44px;
        font-size: 16px;
    }
    
    /* 标签页优化 */
    .nav-tabs .nav-link {
        padding: 12px 16px;
        font-size: 0.9rem;
    }
    
    /* 减少动画效果以提升性能 */
    .card-hover {
        transition: none;
    }
}

/* 动画效果 */
.btn {
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* 页脚样式 */
footer {
    border-top: 1px solid #eee;
}