/* =====================================================================
 * X-GORB Accounts · 多语言选择器样式
 * ===================================================================== */

/* ---------- 通用选择器 ---------- */
.xg-lang-selector {
    position: relative;
    display: inline-block;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

.xg-lang-current {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(128, 128, 128, .08);
    color: inherit;
    border: 1px solid rgba(128, 128, 128, .25);
    border-radius: 100px;
    font-size: 13px;
    line-height: 1.4;
    cursor: pointer;
    transition: background .2s, border-color .2s;
    outline: none;
}
.xg-lang-current:hover { background: rgba(128, 128, 128, .16); }
.xg-lang-current i { font-size: 13px; opacity: .85; }

.xg-lang-menu {
    position: absolute;
    z-index: 9999;
    top: calc(100% + 6px);
    left: 0;
    min-width: 170px;
    max-height: 320px;
    overflow-y: auto;
    margin: 0;
    padding: 6px;
    background: var(--card, #fff);
    color: var(--ink, #202124);
    border: 1px solid var(--border, #dadce0);
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .14);
    display: none;
}

.xg-lang-item {
    display: block;
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    color: inherit;
    text-decoration: none;
    font-size: 13px;
    line-height: 1.4;
    box-sizing: border-box;
    transition: background .15s;
}
.xg-lang-item:hover { background: rgba(128, 128, 128, .10); }
.xg-lang-item.active { background: rgba(26, 115, 232, .10); color: #1a73e8; font-weight: 600; }
.xg-lang-item .xg-lang-label i { margin-left: 4px; font-size: 11px; }

body.dark .xg-lang-menu {
    background: #1e1e1e;
    color: #e8eaed;
    border-color: #444;
}
body.dark .xg-lang-item.active { background: rgba(80, 250, 123, .12); color: #50fa7b; }

/* ---------- 页脚内选择器 ---------- */
.xg-lang-in-footer {
    display: table;
    margin: 14px auto;
    color: #a0a4aa;
}
.xg-lang-in-footer .xg-lang-current {
    color: #a0a4aa;
    border-color: rgba(255, 255, 255, .18);
    background: rgba(255, 255, 255, .05);
}
.xg-lang-in-footer .xg-lang-menu {
    bottom: calc(100% + 6px);
    top: auto;
}

/* ---------- 悬浮快捷入口（右下角） ---------- */
.xg-lang-float {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9998;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a73e8;
    color: #fff;
    border: none;
    box-shadow: 0 4px 16px rgba(26, 115, 232, .4);
    cursor: pointer;
    font-size: 18px;
    transition: transform .2s, background .2s;
    outline: none;
}
.xg-lang-float:hover { background: #1765cc; transform: translateY(-2px); }

.xg-lang-float-menu {
    position: fixed;
    right: 20px;
    bottom: 74px;
    z-index: 9999;
    left: auto;
    top: auto;
    min-width: 150px;
    background: #fff;
    color: #202124;
    border: 1px solid #dadce0;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .16);
    padding: 6px;
    display: none;
}
body.dark .xg-lang-float-menu {
    background: #1e1e1e;
    color: #e8eaed;
    border-color: #444;
}

@media (prefers-reduced-motion: reduce) {
    .xg-lang-current, .xg-lang-float { transition: none; }
}

/* ---------- 个人中心语言卡片（置于资料之前） ---------- */
.xg-profile-lang-card {
    margin-bottom: 16px;
    border: 1px solid var(--border, #dadce0);
    border-radius: 12px;
    background: var(--card, #fff);
    overflow: hidden;
}
.xg-profile-lang-card .xg-langpile-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    font-size: 15px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-light, #e8eaed);
}
.xg-profile-lang-card .xg-langpile-head i { color: #1a73e8; }
.xg-profile-lang-card .xg-lang-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
    padding: 16px 18px;
}
.xg-profile-lang-card .xg-lang-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--border, #dadce0);
    border-radius: 10px;
    font-size: 13px;
    color: var(--ink, #202124);
    text-decoration: none;
    transition: background .15s, border-color .15s;
}
.xg-profile-lang-card .xg-lang-chip:hover { background: rgba(128, 128, 128, .07); border-color: #1a73e8; }
.xg-profile-lang-card .xg-lang-chip.active { border-color: #1a73e8; background: rgba(26, 115, 232, .08); color: #1a73e8; font-weight: 600; }
.xg-profile-lang-card .xg-lang-chip i { font-size: 12px; }