/* 语言切换主容器 */
#languageSwitch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.3s ease;
    margin-top: 15px;     /* 距离上方元素/边界的间距 */
    margin-left: auto; 
}

#yourElement {
  position: relative;
  display: inline-flex;
  align-items: center;
  float: right; /* 浮动到右侧 */
}
#languageSwitch:hover {
    background: #f5f5f5;
}

/* 国旗图片 */
#header-lang-img {
    border: 1px solid #ddd;
    object-fit: cover;
}

/* 当前语言文字 */
#languageSwitch > span {
    font-size: 16px;
    color: #333;
    font-weight: bold; /* 新增字体加粗 */
}

/* 下拉三角 */
#triangle {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #666;
    transition: transform 0.2s ease;
}

/* 展开时三角旋转 */
#languageSwitch.active #triangle {
    transform: rotate(180deg);
}

/* 语言下拉菜单 */
#loginPageLanguages {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 160px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-top: 8px;
    z-index: 1000;
    font-weight: bold; /* 新增字体加粗 */
}

/* 语言选项 */
.sel-lang {
    list-style: none;
    
}

.sel-lang a {
    display: block;
    padding: 8px 16px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s ease;
}

.sel-lang a:hover {
    background: #f8f9fa;
}

/* 添加加载动画 */
#languageSwitch.loading #triangle {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 移动端适配 */
@media (max-width: 768px) {
    #loginPageLanguages {
        right: 0;
        left: auto;
    }
}