/* 社区页面样式 */

/* Hero 区域 */
.community-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    text-align: center;
}

.community-hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: white;
}

.community-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 1.5rem;
}

.community-stat {
    text-align: center;
}

.community-stat-number {
    font-size: 2rem;
    font-weight: 700;
}

.community-stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* 工具栏 */
.community-toolbar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.search-box {
    flex: 1;
    max-width: 400px;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
}

/* 分类筛选 */
.category-filter {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.category-tag {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    background: #fff;
    border: 2px solid #e5e7eb;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: #374151;
    font-size: 0.875rem;
}

.category-tag:hover {
    border-color: #667eea;
    color: #667eea;
}

.category-tag.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

/* 帖子卡片 */
.posts-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.post-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.2s;
}

.post-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.post-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.post-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1rem;
    flex-shrink: 0;
}

.post-meta {
    flex: 1;
}

.post-author {
    font-weight: 600;
    color: #111827;
}

.post-date {
    font-size: 0.75rem;
    color: #6b7280;
}

.post-category {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #f3f4f6;
    color: #374151;
}

.post-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #111827;
}

.post-title a {
    color: inherit;
    text-decoration: none;
}

.post-title a:hover {
    color: #667eea;
}

.post-excerpt {
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.post-footer {
    display: flex;
    gap: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
}

.post-stat {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #6b7280;
    font-size: 0.875rem;
}

/* 按钮 */
.btn-new-post {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-new-post:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-save {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-cancel {
    background: #f3f4f6;
    color: #374151;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
}

.btn-cancel:hover {
    background: #e5e7eb;
}

.btn-like {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-like:hover, .btn-like.liked {
    border-color: #ef4444;
    color: #ef4444;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.pagination a, .pagination span {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    color: #374151;
}

.pagination a:hover {
    background: #f3f4f6;
}

.pagination .current {
    background: #667eea;
    color: white;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #6b7280;
}

/* 用户菜单 */
.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

/* 响应式 */
@media (max-width: 768px) {
    .community-hero {
        padding: 2rem 1rem;
    }
    
    .community-hero h1 {
        font-size: 1.75rem;
    }
    
    .community-stats {
        gap: 1.5rem;
    }
    
    .community-toolbar {
        flex-direction: column;
    }
    
    .search-box {
        max-width: 100%;
    }
}

/* 表单样式 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #374151;
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none;
    border-color: #667eea;
}

.form-textarea {
    min-height: 300px;
    resize: vertical;
    font-family: inherit;
}

.form-hint {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* 评论区 */
.comment-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #f3f4f6;
}

.comment-form {
    margin-bottom: 2rem;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comment-item {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 8px;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.comment-author {
    font-weight: 600;
}

.comment-date {
    font-size: 0.75rem;
    color: #6b7280;
}

.comment-content {
    color: #374151;
    line-height: 1.6;
}

/* 认证页面 */
.auth-container {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-card {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.1);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    color: #6b7280;
}

.auth-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}
