body, html {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #1a1a1a;
    color: white;
    background-size: cover;
    background-position: center;
}

header {
    color: white;
    background-image: url('../images/commu.webp');
    background-position: center;
    background-size: cover;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 300px;
    width: 100%;
}

.header-logo {
    position: absolute;
    top: 117px;
    left: 15px;
    height: 80px;
    width: auto;
}

nav {
    position: absolute;
    width: 100%;
    top: 45px;
    left: 0;
    right: 0;  
}

nav ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: space-between;
}

nav ul li {
    display: flex; /* 使用 flex 布局 */
    justify-content: center; /* 水平居中 */
    align-items: center; /* 垂直居中 */
}

nav ul li a {
    text-decoration: none;
    color: #F0E4BF;
    padding: 10px 20px;
    font-weight: bold;
    font-size: 22px !important; /* 确保字体大小 */
    font-family: Arial, Helvetica, sans-serif;
}

nav ul li a.active {
    color: #FCE293;
}

main {
    padding: 20px;
    background-color:rgb(177, 177, 177);
}

.section-title h1 {
    text-align: center;
    font-size: 36px;
    margin-bottom: 40px;
    color: #FCE293;
}

.community-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 40px;
    padding: 20px;
}

.discussions-bg {
    background-image: url('../images/commu-1.png');
}

.reviews-bg {
    background-image: url('../images/commu-2.png');
}

.makefriends-bg {
    background-image: url('../images/commu-3.png');
}

.news-bg {
    background-image: url('../images/commu-4\ .png');
}

.community-feature {
    background-color: #333;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.community-feature h2 {
    font-size: 28px;
    color: #F0E4BF;
    margin-bottom: 20px;
}

.community-feature p {
    font-size: 18px;
    margin-bottom: 20px;
    color: #DEEEEB;
}

.button {
    text-decoration: none;
    background-color: #FCE293;
    color: #1a1a1a;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 18px;
    display: inline-block;
}

.button:hover {
    background-color: #B5AA8E;
}

footer {
    text-align: center;
    padding: 10px 0;
    background-color: #333;
    color: white;
}

@media (max-width: 768px) {
    body {
        max-width: 100%;
        overflow-x: hidden; /* Prevent horizontal scrolling */
    }

    header {
        flex-direction: column;
        align-items: center;
    }

    .header-logo {
        margin: 10px 0;
        height: 50px;
        top: 50px;
    }

    nav {
        position: static;
        width: 100%;
    }

    nav ul {    
        flex-direction: row;
        justify-content: space-around;
        width: 100%;
    }

    nav ul li {
        flex: 1;
    }

    nav ul li a {
        width: 100%;
        text-align: center;
        padding: 10px 0;
        font-size: 12px !important;
    }
}

@media (max-width: 480px) {
    .community-grid {
        grid-template-columns: 1fr;
        grid-gap: 20px;
    }

    .community-feature {
        padding: 10px;
    }

    .section-title h1 {
        font-size: 24px;
        margin-bottom: 20px;
    }
}