/**
 * community.css - 绀惧尯鏉垮潡鏍峰紡
 * 
 * @author 灏忕尓
 * @date 2026-03-30
 */

/* ===== 椤甸潰澶撮儴 ===== */
.page-header {
    background: linear-gradient(135deg, #6B7B8C 0%, #9B8E7E 100%);
    color: #fff;
    padding: 40px 0;
    text-align: center;
}

.page-header h1 {
    font-size: 32px;
    margin-bottom: 10px;
}

.page-header p {
    opacity: 0.9;
    font-size: 16px;
}

/* ===== 鍐呭鍖哄煙 ===== */
.content-section {
    padding: 40px 0;
    background: #f5f7fa;
    min-height: 500px;
}

/* ===== 鐢ㄦ埛涓績瀵艰埅 ===== */
.user-center-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: #fff;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.user-center-nav .nav-item {
    padding: 10px 20px;
    color: #595959;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s;
    position: relative;
}

.user-center-nav .nav-item:hover {
    background: #f5f5f5;
    color: #262626;
}

.user-center-nav .nav-item.active {
    background: #6B7B8C;
    color: #fff;
}

.user-center-nav .badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #ff4d4f;
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* ===== 宸ュ叿鏍� ===== */
.community-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.search-form {
    display: flex;
    gap: 8px;
    flex: 1;
    max-width: 500px;
}

.search-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: #6B7B8C;
}

/* ===== 甯栧瓙鍒楄〃 ===== */
.post-list {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.post-item {
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
    transition: background 0.2s;
}

.post-item:last-child {
    border-bottom: none;
}

.post-item:hover {
    background: #fafafa;
}

.post-top {
    background: #fffbe6;
}

.post-top:hover {
    background: #fff7d0;
}

.top-badge {
    position: absolute;
    top: 12px;
    right: 16px;
    background: #ff4d4f;
    color: #fff;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
}

.post-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
}

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

.post-title a:hover {
    color: #6B7B8C;
}

.post-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #8c8c8c;
    flex-wrap: wrap;
}

.post-author {
    color: #6B7B8C;
}

.post-stats {
    margin-left: auto;
    display: flex;
    gap: 12px;
}

.stat-item {
    color: #8c8c8c;
}

/* ===== 鍒嗛〉 ===== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 32px;
}

.page-link {
    display: inline-block;
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    color: #262626;
    text-decoration: none;
    transition: all 0.2s;
}

.page-link:hover {
    border-color: #6B7B8C;
    color: #6B7B8C;
}

.page-link.current {
    background: #6B7B8C;
    border-color: #6B7B8C;
    color: #fff;
}

/* ===== 甯栧瓙璇︽儏 ===== */
.post-detail {
    background: #fff;
    border-radius: 8px;
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.post-detail .post-title {
    font-size: 24px;
    margin-bottom: 16px;
}

.post-detail .post-meta {
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 24px;
}

.post-content {
    font-size: 15px;
    line-height: 1.8;
    color: #262626;
}

.post-content p {
    margin-bottom: 16px;
}

/* ===== 鍥炲鍖哄煙 ===== */
.reply-section {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.reply-title {
    font-size: 18px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.reply-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.reply-item {
    padding: 16px;
    background: #fafafa;
    border-radius: 8px;
}

.reply-header {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.reply-floor {
    color: #6B7B8C;
    font-weight: 600;
}

.reply-author {
    color: #6B7B8C;
    font-weight: 500;
}

.reply-time {
    color: #8c8c8c;
    font-size: 13px;
}

.reply-content {
    font-size: 14px;
    line-height: 1.7;
    color: #262626;
    margin-bottom: 12px;
}

.reply-actions {
    font-size: 13px;
}

.reply-link {
    color: #6B7B8C;
    text-decoration: none;
}

.reply-link:hover {
    text-decoration: underline;
}

/* ===== 妤间腑妤煎洖澶� ===== */
.sub-replies {
    margin-top: 12px;
    padding: 12px;
    background: #fff;
    border-radius: 6px;
    border-left: 3px solid #6B7B8C;
}

.sub-reply-item {
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px dashed #f0f0f0;
}

.sub-reply-item:last-child {
    border-bottom: none;
}

.sub-reply-author {
    color: #6B7B8C;
    font-weight: 500;
}

.reply-to {
    color: #8c8c8c;
}

.sub-reply-content {
    color: #262626;
    margin: 0 4px;
}

.sub-reply-time {
    color: #bfbfbf;
    font-size: 12px;
}

/* ===== 鍥炲琛ㄥ崟 ===== */
.reply-form-section {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.reply-form-section h3 {
    margin-bottom: 16px;
    font-size: 16px;
}

.reply-form textarea,
.post-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
}

.reply-form textarea:focus,
.post-form textarea:focus {
    outline: none;
    border-color: #6B7B8C;
}

.reply-form-inline {
    margin-top: 12px;
    padding: 12px;
    background: #fff;
    border-radius: 6px;
}

.reply-form-inline textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    margin-bottom: 8px;
}

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

/* ===== 鍙戝笘琛ㄥ崟 ===== */
.post-form-container {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    border-radius: 8px;
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #262626;
}

.form-group input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: #6B7B8C;
}

.required {
    color: #ff4d4f;
}

/* ===== 鎸夐挳 ===== */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: #6B7B8C;
    color: #fff;
}

.btn-primary:hover {
    background: #5a6fd6;
}

.btn-secondary {
    background: #f0f0f0;
    color: #262626;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

/* ===== 鎻愮ず淇℃伅 ===== */
.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
}

.alert-error {
    background: #fff1f0;
    border: 1px solid #ffa39e;
    color: #cf1322;
}

.alert-success {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #389e0d;
}

/* ===== 绌虹姸鎬� ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #8c8c8c;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

/* ===== 鐧诲綍鎻愮ず ===== */
.login-prompt {
    text-align: center;
    padding: 40px;
    background: #fff;
    border-radius: 8px;
    color: #8c8c8c;
}

.login-prompt a {
    color: #6B7B8C;
}

/* ===== 鎴戠殑鍥炲 ===== */
.reply-list-section {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.my-reply-item {
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
}

.my-reply-item:last-child {
    border-bottom: none;
}

.reply-post-title {
    font-size: 13px;
    color: #8c8c8c;
    margin-bottom: 12px;
}

.reply-post-title a {
    color: #6B7B8C;
    text-decoration: none;
}

.reply-content-box {
    background: #f5f7fa;
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.7;
}

.reply-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #8c8c8c;
}

.view-link {
    color: #6B7B8C;
    text-decoration: none;
}

.view-link:hover {
    text-decoration: underline;
}

/* ===== 鎴戠殑娑堟伅 ===== */
.message-actions {
    margin-bottom: 16px;
    text-align: right;
}

.message-list {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.message-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.message-item:last-child {
    border-bottom: none;
}

.message-unread {
    background: #f0f5ff;
}

.message-read {
    background: #fff;
}

.message-icon {
    width: 40px;
    height: 40px;
    background: #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.message-unread .message-icon {
    background: #6B7B8C;
    color: #fff;
}

.message-content {
    flex: 1;
    min-width: 0;
}

.message-title {
    font-weight: 500;
    color: #262626;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.unread-dot {
    width: 8px;
    height: 8px;
    background: #ff4d4f;
    border-radius: 50%;
    display: inline-block;
}

.message-text {
    font-size: 14px;
    color: #595959;
    margin-bottom: 8px;
    line-height: 1.5;
}

.message-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: #8c8c8c;
    flex-wrap: wrap;
}

.message-meta .from-user,
.message-meta .post-title {
    color: #6B7B8C;
}

.message-actions-right {
    flex-shrink: 0;
}

/* ===== 鎷涜仒甯栧瓙鐗规畩鏍峰紡 ===== */
.post-item.post-recruitment {
    border-left: 4px solid #ff6b6b;
    background: linear-gradient(to right, #fff8f8 0%, #fff 100%);
}

.post-detail.post-recruitment {
    border-top: 4px solid #ff6b6b;
}

.category-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    margin-right: 12px;
    margin-bottom: 12px;
    vertical-align: middle;
}

.category-badge.recruitment {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.category-badge.trade {
    background: linear-gradient(135deg, #52c41a 0%, #389e0d 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(82, 196, 26, 0.3);
}

.post-item.post-trade {
    border-left: 4px solid #52c41a;
}

.post-detail .category-badge.trade {
    background: linear-gradient(135deg, #52c41a 0%, #389e0d 100%);
    color: #fff;
}

/* 甯栧瓙鏍囬涓庢爣绛惧榻� */
.post-title {
    display: inline;
    vertical-align: middle;
}

/* ===== 鍒嗙被 Tab 鏍峰紡 ===== */
.category-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e8e8e8;
    flex-wrap: wrap;
}

.category-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 24px;
    background: #f5f5f5;
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.category-tab:hover {
    background: #e8e8e8;
    color: #333;
}

.category-tab.active {
    background: linear-gradient(135deg, #6B7B8C 0%, #9B8E7E 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(107, 123, 140, 0.3);
}

.tab-icon {
    font-size: 16px;
}

/* ===== 鍒嗙被璇存槑 ===== */
.category-notice {
    display: flex;
    gap: 16px;
    padding: 20px 24px;
    border-radius: 12px;
    margin-bottom: 24px;
    background: #fff;
    border-left: 4px solid #52c41a;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.category-notice.trade-notice {
    background: linear-gradient(135deg, #f6ffed 0%, #fff 100%);
    border-left-color: #52c41a;
}

.category-notice .notice-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.category-notice .notice-content strong {
    display: block;
    font-size: 16px;
    color: #333;
    margin-bottom: 8px;
}

.category-notice .notice-content p {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin: 0;
}

/* ===== 鍝嶅簲寮� ===== */
@media (max-width: 768px) {
    .community-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-form {
        max-width: none;
    }
    
    .post-meta {
        flex-direction: column;
        gap: 4px;
    }
    
    .post-stats {
        margin-left: 0;
    }
    
    .post-detail {
        padding: 20px;
    }
    
    .post-detail .post-title {
        font-size: 18px;
    }
    
    .user-center-nav {
        flex-wrap: wrap;
    }
    
    .message-item {
        flex-direction: column;
        gap: 12px;
    }
    
    .message-actions-right {
        align-self: flex-start;
    }
}

/* ===== 甯栧瓙/鍥炲缂栬緫鍒犻櫎鍔熻兘鏍峰紡 ===== */

/* 甯栧瓙鎿嶄綔鎸夐挳鏍� */
.post-actions-bar {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e8e8e8;
}

.post-actions-bar .btn {
    padding: 8px 16px;
    font-size: 14px;
}

/* 鍥炲鎿嶄綔閾炬帴 */
.reply-actions {
    display: flex;
    gap: 16px;
    margin-top: 12px;
}

.reply-actions .reply-link {
    color: #6B7B8C;
    font-size: 13px;
    text-decoration: none;
    transition: color 0.2s;
}

.reply-actions .reply-link:hover {
    color: #1890ff;
}

.reply-actions .reply-link.delete {
    color: #ff4d4f;
}

.reply-actions .reply-link.delete:hover {
    color: #cf1322;
}

/* 缂栬緫琛ㄥ崟鏍峰紡 */
#post-edit-form,
[id^="reply-edit-form-"] {
    background: #f5f7fa;
    padding: 20px;
    border-radius: 8px;
    margin-top: 16px;
}

#post-edit-form .form-group {
    margin-bottom: 16px;
}

#post-edit-form label,
[id^="reply-edit-form-"] label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

#edit-post-title,
.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
}

#edit-post-content,
.form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
}

#post-edit-form .form-actions,
[id^="reply-edit-form-"] .form-actions {
    display: flex;
    gap: 12px;
}
/* 帖子编辑表单样式 */
.post-edit-container {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    margin-top: 20px;
    border: 1px solid #e8e8e8;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.post-edit-container .form-group {
    margin-bottom: 20px;
}

.post-edit-container label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

#edit-post-title {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    font-size: 15px;
}

#edit-post-content {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.6;
    resize: vertical;
    min-height: 240px;
}