:root {
    --grass: #5a8c2f;
    --dirt: #5d4037;
    --wood: #8d6e63;
    --stone: #616161;
    --gold: #ffd800;
    --text: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Press Start 2P', monospace, sans-serif;
    color: var(--text);
    line-height: 1.5;
    font-size: 14px;
    overflow-x: hidden;
    position: relative;
    /* 统一背景图设置 */
    background-image: url('https://assets.badlion.net/blog/minecraft-backgrounds/jungle-lake.webp');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ===== 头部导航 ===== */
header {
    background: rgba(0, 0, 0, 0.75);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 4px solid var(--wood);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-text {
    font-size: 1.1rem;
    color: var(--gold);
    text-shadow: 2px 2px 0 #000;
}

.menu-toggle,
.close-menu {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.close-menu {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    color: white;
    background: none;
    border: none;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 0.8rem;
}

nav ul li a,
nav ul li .dropbtn {
    display: block;
    padding: 10px 16px;
    color: white;
    text-decoration: none;
    background: var(--wood);
    border: 3px solid #333;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

nav ul li a:hover,
nav ul li .dropbtn:hover {
    background: #a1887f;
    transform: translateY(-2px);
    color: var(--gold);
}

/* 下拉菜单 */
.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    background: var(--dirt);
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    z-index: 100;
    top: 100%;
    left: 0;
    border: 3px solid #333;
    border-top: none;
}

.dropdown-content a {
    padding: 10px 16px;
    background: transparent;
    border: none;
    text-align: left;
    font-size: 0.8rem;
    display: block;
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* ===== 主体内容 ===== */
.hero {
    text-align: center;
    padding: 3rem 0;
    background: rgba(0, 0, 0, 0.4);
    margin: 2rem 0;
    border: 4px solid var(--wood);
    border-radius: 8px;
}

.hero h1 {
    font-size: 1.6rem;
    margin-bottom: 1rem;
    color: var(--gold);
}

.hero p {
    max-width: 700px;
    margin: 0 auto 1.5rem;
    font-size: 0.85rem;
}

.cta-button {
    display: inline-block;
    padding: 10px 20px;
    background: var(--gold);
    color: #000;
    text-decoration: none;
    font-weight: bold;
    border: 3px solid #000;
    transition: all 0.2s ease;
}

/* 修复：此处原为 cta-button，已补全点号 */
.cta-button:hover {
    background: #ffcc00;
    transform: scale(1.05);
}

.section-title {
    text-align: center;
    font-size: 1.5rem;
    margin: 2.5rem 0 1.5rem;
    color: var(--gold);
    text-shadow: 2px 2px 0 #000;
}

/* 公会介绍 */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.content-card {
    background: var(--dirt);
    padding: 1.5rem;
    border: 3px solid #333;
    display: flex;
    gap: 1rem;
}

.card-img {
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    overflow: hidden;
    border: 2px solid var(--wood);
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-text h3 {
    color: var(--gold);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

/* 公会优势 */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.feature-item {
    background: var(--dirt);
    padding: 1.5rem;
    border: 3px solid #333;
    text-align: center;
}

.icon {
    font-size: 2rem;
    color: var(--gold);
    margin-bottom: 0.8rem;
}

.feature-item h3 {
    color: var(--gold);
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

/* 人员构成 */
.staff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.staff-card {
    background: var(--dirt);
    padding: 1.5rem;
    border: 3px solid #333;
    text-align: center;
}

.staff-avatar {
    width: 100px;
    height: 100px;
    margin: 0 auto 1rem;
    border: 3px solid var(--wood);
    border-radius: 50%;
    overflow: hidden;
}

.staff-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.staff-card h3 {
    color: var(--gold);
    margin: 0.5rem 0;
}

.role {
    display: block;
    color: #ccc;
    font-size: 0.75rem;
    margin-bottom: 0.8rem;
}

/* 服务器展示 */
.server-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.server-card {
    background: var(--dirt);
    padding: 1.5rem;
    border: 3px solid #333;
}

.server-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-bottom: 2px solid var(--wood);
    margin-bottom: 1rem;
}

.server-card h3 {
    color: var(--gold);
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

.server-card p {
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
    line-height: 1.5;
}

/* 公会动态 */
.news-list {
    margin-top: 2rem;
}

.news-item {
    background: var(--dirt);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 3px solid #333;
}

.news-item h3 {
    color: var(--gold);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.date {
    color: #aaa;
    font-size: 0.75rem;
    margin-bottom: 0.8rem;
    display: block;
}

/* 页脚 */
footer {
    background: rgba(0, 0, 0, 0.8);
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 4px solid var(--wood);
}

footer .container {
    text-align: center;
}

.footer-links {
    margin-top: 1rem;
}

.footer-links a {
    color: var(--gold);
    text-decoration: none;
    margin: 0 0.8rem;
    font-size: 0.8rem;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* ===== 树叶飘落 ===== */
#leaves-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    nav {
        position: fixed;
        top: 0;
        
        /* --- 修改点 1：初始状态改为向左偏移 --- */
        transform: translateX(-160%); 
        
        width: 80%;
        height: 100vh;
        background: var(--dirt);
        transition: transform 0.3s ease;
        z-index: 1000;
        padding: 2rem 1.5rem;
        
        /* --- 修改点 2：边框改为右侧 --- */
        border-left: none; 
        border-right: 4px solid var(--wood);
    }

    nav.active {
        transform: translateX(0);
    }

    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.6);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 999;
    }

    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    nav ul {
        flex-direction: column;
        gap: 1rem;
    }

    nav ul li {
        width: 100%;
    }

    .dropdown-content {
        position: static;
        display: none;
        background: rgba(0, 0, 0, 0.2);
        margin-left: 16px;
        border: none;
        border-left: 2px solid var(--wood);
    }

    .dropdown.active .dropdown-content {
        display: block;
    }

    .content-card {
        flex-direction: column;
        text-align: center;
    }

    .card-img {
        margin: 0 auto;
    }
}