/* ==================== 濡须社区样式 ==================== */

/* 社区头部横幅 */
.community-hero {
    background: linear-gradient(135deg, 
        rgba(43, 95, 117, 0.95) 0%, 
        rgba(26, 58, 74, 0.9) 50%,
        rgba(43, 95, 117, 0.95) 100%),
        url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1920 400"><rect fill="%232B5F75" width="1920" height="400"/><path d="M0,300 Q480,250 960,300 T1920,300 L1920,400 L0,400 Z" fill="%231A3A4A" opacity="0.5"/></svg>');
    background-size: cover;
    background-position: center;
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-white);
    position: relative;
}

.community-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 30%, transparent 0%, rgba(43, 95, 117, 0.3) 100%);
    pointer-events: none;
}

.community-hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.community-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid var(--gold-color);
    border-radius: var(--radius-full);
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
}

.community-title {
    font-size: 2.5rem;
    font-weight: 600;
    letter-spacing: 0.5rem;
    margin-bottom: 1rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.community-description {
    font-size: 1.1rem;
    line-height: 1.8;
    opacity: 0.9;
    margin-bottom: 2rem;
}

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

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gold-color);
}

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

/* 社区容器 */
.community-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.community-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
}

/* 社区主内容区 */
.community-main {
    min-width: 0;
}

/* 工具栏 */
.community-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    flex-wrap: wrap;
    gap: 1rem;
}

.topic-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.9rem;
}

.tab-btn:hover {
    background: var(--secondary-color);
    color: var(--primary-color);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--text-white);
    border-color: var(--primary-color);
}

.toolbar-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.sort-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.9rem;
}

.btn-publish {
    padding: 0.6rem 1.2rem;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: var(--text-white);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-publish:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* 帖子列表 */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.post-card {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: all var(--transition-normal);
    cursor: pointer;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.post-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-light);
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.post-time {
    font-size: 0.8rem;
    color: var(--text-light);
}

.post-tags {
    display: flex;
    gap: 0.5rem;
}

.topic-tag {
    padding: 0.25rem 0.75rem;
    background: rgba(43, 95, 117, 0.1);
    color: var(--primary-color);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
}

.essence-tag {
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, var(--gold-color), var(--gold-dark));
    color: var(--text-white);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
}

.pinned-tag {
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: var(--text-white);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
}

.post-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.post-content {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.post-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.post-image:hover {
    transform: scale(1.05);
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.post-actions {
    display: flex;
    gap: 1.5rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    font-size: 0.9rem;
    cursor: pointer;
    transition: color var(--transition-fast);
    background: none;
    border: none;
}

.action-btn:hover {
    color: var(--primary-color);
}

.action-btn.liked {
    color: var(--accent-color);
}

/* 侧边栏 */
.community-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-widget {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.sidebar-widget h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.2rem;
    position: relative;
}

.sidebar-widget h3::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-color), var(--gold-color));
}

/* 快速链接 */
.quick-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.quick-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.quick-link:hover {
    background: var(--secondary-color);
    color: var(--primary-color);
}

.quick-link .icon {
    font-size: 1.2rem;
}

.quick-link .badge {
    margin-left: auto;
    background: var(--accent-color);
    color: var(--text-white);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
}

/* 热门话题 */
.hot-topics {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.hot-topic-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    cursor: pointer;
}

.hot-topic-item:hover {
    background: var(--secondary-color);
}

.topic-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.topic-info {
    flex: 1;
}

.topic-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.topic-count {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* 公告 */
.notice-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.notice-item {
    padding: 1rem;
    background: var(--secondary-light);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--gold-color);
}

.notice-tag {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background: var(--primary-color);
    color: var(--text-white);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
}

.notice-item p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* 社区规范 */
.community-rules {
    list-style: none;
    padding: 0;
}

.community-rules li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    position: relative;
    padding-left: 1.25rem;
}

.community-rules li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

/* 分页 */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding: 1rem;
}

.page-btn {
    padding: 0.5rem 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.page-btn:hover:not(:disabled) {
    background: var(--primary-color);
    color: var(--text-white);
    border-color: var(--primary-color);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* 模态框样式 */
.modal-large {
    max-width: 800px !important;
    width: 90% !important;
}

/* 社区模态框内容滚动 */
.modal .modal-content {
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal .modal-body {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.modal .modal-footer {
    flex-shrink: 0;
}

/* 图片上传区域 */
.image-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.image-upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(43, 95, 117, 0.05);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.upload-icon {
    font-size: 2rem;
}

.upload-hint {
    font-size: 0.8rem;
    color: var(--text-light);
}

.image-preview-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
    margin-top: 1rem;
}

.image-preview-item {
    position: relative;
    aspect-ratio: 1;
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-md);
}

.remove-image-btn {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: var(--accent-color);
    color: var(--text-white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 帖子详情 */
.post-detail-content {
    margin-bottom: 2rem;
}

.post-detail-header {
    margin-bottom: 1.5rem;
}

.post-detail-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.post-detail-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.post-detail-body {
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.post-detail-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.post-detail-images img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: var(--radius-md);
    cursor: pointer;
}

/* 评论区 */
.comments-section {
    border-top: 2px solid var(--border-color);
    padding-top: 1.5rem;
}

.comments-section h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.comment-input-area {
    margin-bottom: 1.5rem;
}

.comment-input-area textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    resize: vertical;
    min-height: 80px;
    margin-bottom: 0.75rem;
    font-family: inherit;
}

.comment-input-area textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(43, 95, 117, 0.1);
}

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

.comment-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--secondary-light);
    border-radius: var(--radius-md);
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.comment-author {
    font-weight: 600;
    color: var(--text-primary);
}

.comment-time {
    font-size: 0.8rem;
    color: var(--text-light);
}

.comment-text {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.comment-actions {
    display: flex;
    gap: 1rem;
}

.comment-actions button {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 0.85rem;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.comment-actions button:hover {
    color: var(--primary-color);
}

/* 求助列表 */
.help-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

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

.help-item {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    border: 1px solid var(--border-light);
    transition: all var(--transition-fast);
}

.help-item:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-sm);
}

.help-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.help-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.help-reward {
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, var(--gold-color), var(--gold-dark));
    color: var(--text-white);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
}

.help-content {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.75rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.help-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-light);
}

.help-status {
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
}

.help-status.open {
    background: #10B981;
    color: white;
}

.help-status.resolved {
    background: var(--text-light);
    color: white;
}

/* 私信列表 */
.message-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 500px;
    overflow-y: auto;
}

.message-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.message-item:hover {
    background: var(--secondary-color);
}

.message-item.unread {
    border-left: 3px solid var(--accent-color);
}

.message-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

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

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}

.message-sender {
    font-weight: 600;
    color: var(--text-primary);
}

.message-time {
    font-size: 0.8rem;
    color: var(--text-light);
}

.message-preview {
    color: var(--text-secondary);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 加载状态 */
.loading-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.empty-state .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state p {
    font-size: 1rem;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .community-layout {
        grid-template-columns: 1fr;
    }
    
    .community-sidebar {
        order: -1;
    }
    
    .community-stats {
        gap: 2rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    .community-hero {
        padding: 2rem 1rem;
    }
    
    .community-title {
        font-size: 1.75rem;
        letter-spacing: 0.3rem;
    }
    
    .community-description {
        font-size: 0.95rem;
    }
    
    .community-stats {
        gap: 1.5rem;
    }
    
    .stat-number {
        font-size: 1.25rem;
    }
    
    .community-container {
        padding: 1rem;
    }
    
    .community-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .topic-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
    }
    
    .toolbar-actions {
        justify-content: space-between;
    }
    
    .post-card {
        padding: 1rem;
    }
    
    .post-title {
        font-size: 1.1rem;
    }
    
    .modal-large {
        width: 95% !important;
        margin: 1rem;
    }
    
    .post-detail-images {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .community-title {
        font-size: 1.5rem;
    }
    
    .community-stats {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .stat-item {
        flex: 1;
        min-width: 70px;
    }
    
    .post-footer {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .post-actions {
        gap: 1rem;
    }
    
    .action-btn {
        font-size: 0.85rem;
    }
}
