/* 重置默认样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 英雄区域样式 */
.hero {
    height: 100vh;
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('../images/community-bg.png');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
}

.hero-content {
    animation: fadeIn 1s ease-out;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-content p {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
}

/* 添加动画关键帧 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 社区容器样式 */
.community-container {
    max-width: 1400px;
    margin: 50px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 250px 1fr 300px;
    gap: 30px;
}

/* 左侧边栏样式 */
.community-sidebar {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.user-profile {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.avatar-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
}

.user-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.edit-avatar {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.avatar-container:hover .edit-avatar {
    opacity: 1;
}

.username {
    font-size: 1.2em;
    margin-bottom: 10px;
}

.user-level {
    color: #666;
    margin-bottom: 20px;
}

.user-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
}

.stat-label {
    font-size: 0.9em;
    color: #666;
}

.community-menu {
    background: #fff;
    border-radius: 10px;
    margin-top: 20px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.menu-item {
    display: block;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.menu-item:hover,
.menu-item.active {
    background: #007bff;
    color: #fff;
}

/* 主内容区域样式 */
.community-main {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.create-post {
    padding: 10px 20px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.create-post:hover {
    background: #0056b3;
}

.filter-select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    outline: none;
}

.post {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #eee;
    transition: transform 0.3s ease;
}

.post:hover {
    transform: translateY(-2px);
}

.post-header {
    margin-bottom: 15px;
}

.post-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    margin-bottom: 10px;
}

.post-tag.official {
    background: #ff4757;
    color: #fff;
}

.post-tag.discussion {
    background: #2ed573;
    color: #fff;
}

.post-tag.creation {
    background: #ffa502;
    color: #fff;
}

.post-title {
    font-size: 1.2em;
    margin-bottom: 10px;
}

.post-meta {
    font-size: 0.9em;
    color: #666;
}

.post-content {
    margin-bottom: 15px;
}

.post-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.post-images img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 5px;
}

.post-video {
    margin-top: 10px;
}

.post-video video {
    width: 100%;
    border-radius: 5px;
}

.post-stats {
    display: flex;
    gap: 20px;
    color: #666;
    font-size: 0.9em;
}

/* 右侧边栏样式 */
.community-sidebar-right {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.trending-topics,
.active-users {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.trending-topics h3,
.active-users h3 {
    margin-bottom: 15px;
    color: #333;
}

.topic-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    color: #333;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.topic-item:hover {
    background: #f8f9fa;
}

.topic-count {
    font-size: 0.9em;
    color: #666;
}

.user-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 5px;
    transition: background 0.3s ease;
}

.user-item:hover {
    background: #f8f9fa;
}

.user-item img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
}

.user-info {
    flex: 1;
}

.user-name {
    display: block;
    font-weight: 500;
}

.user-badge {
    display: inline-block;
    font-size: 0.8em;
    color: #666;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 30px;
}

.pagination-btn {
    padding: 8px 15px;
    border: 1px solid #007bff;
    border-radius: 5px;
    background: #fff;
    color: #007bff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-btn:not(:disabled):hover {
    background: #007bff;
    color: #fff;
}

.pagination-btn:disabled {
    border-color: #ccc;
    color: #ccc;
    cursor: not-allowed;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .community-container {
        grid-template-columns: 200px 1fr 250px;
    }
}

@media (max-width: 992px) {
    .community-container {
        grid-template-columns: 1fr;
    }

    .community-sidebar,
    .community-sidebar-right {
        display: none;
    }

    .hero {
        height: 300px;
    }

    .hero-content h1 {
        font-size: 2em;
    }

    .hero-content p {
        font-size: 1em;
    }
}

@media (max-width: 576px) {
    .post-actions {
        flex-direction: column;
        gap: 10px;
    }

    .create-post,
    .filter-select {
        width: 100%;
    }

    .post-images {
        grid-template-columns: 1fr;
    }

    .post-stats {
        flex-wrap: wrap;
    }
} 