/* 重置样式和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 道金幻境录 - 游戏字体配置 */
@font-face {
    font-family: 'GameFont';
    src: url('/frontend/assets/fonts/SimKai.woff2') format('woff2'),
         url('/frontend/assets/fonts/SimKai.subset.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

body {
    font-family: 'GameFont', 'KaiTi', 'STKaiti', 'SimKai', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* 通用容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏样式 */
.site-header {
    background: #2e7d32;
    color: white;
    padding: 1rem 0;
}

.main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: #81c784;
}

/* 激活状态样式 */
.nav-menu a.active {
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* 以下是针对便携式设备的响应式样式 */
@media screen and (max-width: 768px) {
    .site-header {
        padding: 0.5rem 0;
    }
    
    .main-nav {
        flex-direction: column;
        padding: 0 12px;
        gap: 0.5rem;
    }
    
    .logo h1 {
        font-size: 1.25rem;
    }
    
    .nav-menu {
        display: flex;
        flex-direction: row;
        gap: 0;
        margin: 0;
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
    }
    
    .nav-menu::-webkit-scrollbar {
        display: none;
    }
    
    .nav-menu li {
        flex-shrink: 0;
    }
    
    .nav-menu a {
        display: block;
        padding: 6px 12px;
        font-size: 0.875rem;
        white-space: nowrap;
    }
    
    /* 添加渐变蒙边提示有更多内容 */
    .nav-menu::after {
        content: '';
        flex-shrink: 0;
        width: 24px;
        background: linear-gradient(to right, transparent, rgba(46, 125, 50, 0.8));
    }
}

/* 用户信息样式 */
#user-info {
    position: relative;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.3s;
}

#user-info:hover {
    background: rgba(255, 255, 255, 0.1);
}

.username {
    font-weight: 500;
    color: white;
}

.user-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #2e7d32;
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    min-width: 120px;
    display: none;
    z-index: 1000;
}

#user-info:hover .user-menu {
    display: block;
}

.user-menu li {
    margin: 0;
}

.user-menu a {
    display: block;
    padding: 0.5rem 1rem;
    color: white;
    text-decoration: none;
    transition: background 0.3s;
}

.user-menu a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #81c784;
}

/* 响应式调整 */
@media screen and (max-width: 768px) {
    #user-info {
        padding: 6px 12px;
    }
    
    .user-menu {
        position: absolute;
        top: 100%;
        right: 0;
        min-width: 120px;
        background: #2e7d32;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        border-radius: 4px;
    }
}