/* 项目网格布局 - 使用Bootstrap栅格系统 */
.project-items {
    margin-left: -15px;
    margin-right: -15px;
    display: flex;
    flex-wrap: wrap;	
}

.project-item {
    padding-left: 10px;
    padding-right: 10px;
    margin-bottom: 30px;
    box-sizing: border-box; /* 确保padding包含在宽度内 */
    display: flex; /* 让项目项也使用flex */	
}

/* 大屏幕 (≥1200px): 4列 */
@media (min-width: 1200px) {
    .project-item {
        width: 25%;
        float: left;
    }
}

/* 中等屏幕 (992px-1199px): 3列 */
@media (min-width: 992px) and (max-width: 1199px) {
    .project-item {
        width: 33.33333333%;
        float: left;
    }
}

/* 小屏幕 (768px-991px): 2列 */
@media (min-width: 768px) and (max-width: 991px) {
    .project-item {
        width: 50%;
        float: left;
    }
}

/* 超小屏幕 (<768px): 1列 */
@media (max-width: 767px) {
    .project-item {
        width: 100%;
        float: none;
    }
    
    .project-card {
        display: flex;
        flex-direction: row;
    }
    
    .project-thumbnail-container {
        width: 120px;
        height: 120px;
        flex-shrink: 0;
    }
    
    .project-info {
        flex-grow: 1;
        padding: 10px 15px;
    }
}

/* 非常小的手机 (<480px) */
@media (max-width: 480px) {
    .project-card {
        flex-direction: column;
    }
    
    .project-thumbnail-container {
        width: 100%;
        height: 160px;
    }
}

/* 项目卡片样式 */
.project-card {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    transition: all 0.3s ease;
    height: 100%;
    overflow: hidden;
    width: 100%; /* 确保卡片充满容器 */
    display: flex;
    flex-direction: column; /* 垂直排列卡片内容 */	
}

.project-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

/* 缩略图样式 */
.project-thumbnail-container {
    height: 180px;
    overflow: hidden;
    position: relative;
    width: 100%;
    flex-shrink: 0; /* 防止缩略图被压缩 */
}

.project-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-card:hover .project-thumbnail {
    transform: scale(1.05);
}

.thumbnail-placeholder {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    color: #6c757d;
    text-align: center;
}

.thumbnail-placeholder-link {
    color: #6c757d;
    text-decoration: none;
}

.thumbnail-placeholder-link:hover {
    color: #007bff;
}

/* 项目信息样式 */
.project-info {
    padding: 15px;
    flex-grow: 1; /* 填充剩余空间 */
    display: flex;
    flex-direction: column;
}

.project-name {
    margin: 0 0 8px 0;
    font-size: 16px;
    line-height: 1.3;
    flex-shrink: 0; /* 防止标题被压缩 */
}

.project-name a {
    color: #333;
    text-decoration: none;
}

.project-name a:hover {
    color: #007bff;
}

.project-description {
    color: #666;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 10px;
    flex-grow: 1; /* 描述区域自动填充 */
    overflow: hidden;
}

/* 作者信息 */
.project-author {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.user-avatar {
    margin-right: 8px;
}

.user-avatar img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.username {
    font-size: 12px;
    color: #666;
}

.username:hover {
    color: #007bff;
    text-decoration: none;
}

/* 项目统计 */
.project-stats {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #999;
    flex-shrink: 0;
    margin-top: auto; /* 推到容器底部 */
}

.stat-item {
    display: flex;
    align-items: center;
}

.stat-item i {
    margin-right: 4px;
}

/* 空状态 */
.empty-project {
    padding: 60px 20px;
    text-align: center;
    color: #999;
}

.empty-project .icon-large {
    font-size: 48px;
    margin-bottom: 20px;
}

/* 用户头像样式 */
.project-author {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.user-avatar {
    margin-right: 8px;
    flex-shrink: 0;
}

.user-avatar-img {
    border-radius: 50%;
    border: 2px solid #f0f0f0;
    transition: border-color 0.3s ease;
}

.project-card:hover .user-avatar-img {
    border-color: #007bff;
}

.username {
    font-size: 12px;
    color: #666;
    text-decoration: none;
    font-weight: 500;
}

.username:hover {
    color: #007bff;
    text-decoration: none;
}

/* 更新时间样式 */
.project-update-time {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

.user-projects .user-header {
    background: #f8f9fa;
    padding: 30px 0;
    margin-bottom: 30px;
    border-radius: 8px;
}

.user-avatar-large {
    width: 120px;
    height: 120px;
}

.default-avatar-large {
    width: 120px;
    height: 120px;
    background: #007bff;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: bold;
}

.user-stats {
    margin-top: 15px;
}

.stat-item {
    margin-right: 20px;
    font-size: 16px;
}

.stat-item strong {
    color: #007bff;
}

.projects-filter {
    margin-bottom: 20px;
}

.project-card {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 30px;
    transition: box-shadow 0.3s;
}

.project-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.project-thumbnail {
    height: 200px;
    overflow: hidden;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.project-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-content {
    padding: 15px;
}

.project-title {
    margin-top: 0;
    margin-bottom: 10px;
}

.project-description {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

/* ===== 项目详情页布局 ===== */
.project-detail {
    margin-top: 20px;
}

.project-main-content {
    padding-right: 30px;
}

.project-sidebar {
    position: sticky;
    top: 20px;
}

/* 项目管理面板样式 - 修复按钮宽度 */
.project-management {
    margin-top: 20px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    background: #f8f9fa;
}

.project-management h3 {
    margin-top: 0;
    color: #495057;
    font-size: 18px;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

/* 修复按钮宽度问题 - 移除btn-block，使用自然宽度 */
.management-actions .btn {
    display: inline-block;
    width: auto;
    min-width: 120px;
    margin-right: 10px;
    margin-bottom: 10px;
    padding: 10px 16px;
    font-size: 14px;
    text-align: center;
}

.management-actions .btn:last-child {
    margin-right: 0;
}

/* 项目操作按钮组 */
.project-actions .btn {
    margin-right: 10px;
    margin-bottom: 10px;
}

/* 项目缩略图大图 */
.project-thumbnail-large {
    margin: 20px 0;
    text-align: center;
}

.project-thumbnail-large img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 项目描述和标签 */
.project-description {
    margin: 25px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.project-description h3 {
    margin-top: 0;
    color: #495057;
    font-size: 18px;
}

.project-tags {
    margin: 25px 0;
}

.project-tags h3 {
    margin-bottom: 15px;
    color: #495057;
    font-size: 18px;
}

.project-tags .label {
    margin-right: 8px;
    margin-bottom: 8px;
    display: inline-block;
}

/* 项目元信息 */
.project-meta {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 14px;
    color: #666;
}

.project-meta span {
    margin-right: 20px;
    display: inline-block;
    margin-bottom: 5px;
}

/* 状态标签在详情页的样式 */
.project-meta .label {
    margin-left: 10px;
    vertical-align: middle;
}

/* 项目统计在详情页的样式 */
.project-detail .project-stats {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.project-detail .project-stats h3 {
    margin-top: 0;
    color: #495057;
    font-size: 18px;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.project-detail .project-stats ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.project-detail .project-stats li {
    padding: 8px 0;
    border-bottom: 1px solid #f8f9fa;
    display: flex;
    justify-content: space-between;
}

.project-detail .project-stats li:last-child {
    border-bottom: none;
}

.project-detail .project-stats li span:first-child {
    color: #666;
}

.project-detail .project-stats li span:last-child {
    color: #333;
    font-weight: 500;
}

/* 评论区在详情页的样式 */
.project-comments {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e9ecef;
}

.project-comments h3 {
    margin-bottom: 20px;
    color: #495057;
    font-size: 22px;
}

.comment-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.comment-item {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    background: white;
    transition: box-shadow 0.3s ease;
}

.comment-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.comment-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    border: 2px solid #f0f0f0;
}

.comment-author {
    font-weight: bold;
    margin-right: 10px;
    color: #333;
}

.comment-time {
    color: #6c757d;
    font-size: 12px;
}

.comment-content {
    color: #495057;
    line-height: 1.6;
    margin-left: 50px;
}

.no-comments {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    background: #f8f9fa;
    border-radius: 8px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .project-main-content {
        padding-right: 0;
        margin-bottom: 30px;
    }
    
    .management-actions .btn {
        display: block;
        width: 100%;
        margin-right: 0;
    }
    
    .project-meta span {
        display: block;
        margin-right: 0;
        margin-bottom: 8px;
    }
    
    .comment-content {
        margin-left: 0;
        margin-top: 10px;
    }
    
    .project-sidebar {
        position: static;
    }
}

/* 大屏幕优化 */
@media (min-width: 1200px) {
    .project-main-content {
        padding-right: 40px;
    }
}

/* 操作提示消息 */
.alert {
    margin: 20px 0;
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

/* 点赞按钮样式 */
.like-btn {
    transition: all 0.3s ease;
    position: relative;
}

.like-btn.loading {
    opacity: 0.6;
    cursor: not-allowed;
}

.like-btn.loading:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -8px;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.like-btn.btn-primary {
    background: #e74c3c;
    border-color: #e74c3c;
    color: white;
}

.like-btn.btn-primary:hover {
    background: #c0392b;
    border-color: #c0392b;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 消息提示样式 */
.ajax-message {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: none;
    border-radius: 6px;
}