/* ========= 用户区域公共样式 ========= */

/* ---- 顶部导航容器 ---- */
.top-nav .layui-container {
    display: flex;
    align-items: center;
    flex-wrap: nowrap !important; /* 强制整行不换行 */
    gap: 15px;
    max-width: 100%;
}

/* ---- Logo 区域 ---- */
.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 8px;
}

/* ---- 导航链接区域（仅布局，不改变视觉样式） ---- */
.nav-links {
    display: flex;
    align-items: center;
    gap: 18px;
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;           /* 菜单过多时水平滚动 */
    white-space: nowrap;        /* 强制内部不换行 */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
/* 滚动条美化（不影响样式） */
.nav-links::-webkit-scrollbar {
    height: 4px;
}
.nav-links::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.3);
    border-radius: 10px;
}
/* 只保证链接不收缩，不覆盖颜色、内边距、悬停等 */
.nav-links a {
    flex-shrink: 0;            /* 防止文字被压缩 */
    white-space: nowrap;       /* 确保链接文字不换行 */
}

/* ---- 用户按钮区域（右对齐） ---- */
.user-btns {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 40px;
    flex-shrink: 0;
    flex-wrap: nowrap;
    margin-left: auto;          /* 推到右侧，利用空白 */
}

/* 登录/注册按钮 */
.user-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    padding: 0 18px;
    height: 36px;
    line-height: 36px;
    border-radius: 30px;
    color: white;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
    box-sizing: border-box;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.user-btn.primary {
    background: #1E88E5;
}
.user-btn:hover {
    background: #1565C0;
    transform: translateY(-1px);
}

/* 用户下拉菜单 */
.user-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
    flex-shrink: 0;
}
.top-nav .user-name {
    background: rgba(255, 255, 255, 0.2);
    padding: 0 15px;
    height: 36px;
    line-height: 36px;
    border-radius: 30px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    box-sizing: border-box;
    white-space: nowrap;
}
.top-nav .user-name:hover {
    background: rgba(255, 255, 255, 0.35);
}
.vip-tag {
    background: #ff9800;
    color: #fff;
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 0.7rem;
    margin-left: 6px;
    line-height: 1.4;
}
.user-dropdown-content {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: white;
    min-width: 150px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    z-index: 1000;
    display: none;
    overflow: hidden;
}
.user-dropdown-content a {
    display: block;
    padding: 10px 16px;
    color: #333;
    font-size: 0.8rem;
    transition: 0.1s;
    cursor: pointer;
    border-bottom: 1px solid #f0f2f5;
    text-decoration: none;
}
.user-dropdown-content a:last-child {
    border-bottom: none;
}
.user-dropdown-content a:hover {
    background: #f5f9ff;
    color: #1e88e5;
}

/* ---- 响应式微调 ---- */
@media (max-width: 1024px) {
    .nav-links {
        gap: 12px;
    }
    .user-btn {
        padding: 0 12px;
        font-size: 0.8rem;
    }
}