.locale-switch { display:inline-block; position:relative; margin:0; font-size:13px; line-height:normal; }
.locale-switch .lang-trigger { display:flex; align-items:center; gap:6px; padding:6px 14px; border:1px solid transparent; background:transparent; color:rgba(255,255,255,.92); font:inherit; cursor:pointer; }
.locale-switch .lang-globe { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.5; }
.locale-switch .lang-arrow { width:0; height:0; margin-left:4px; border:4px solid transparent; border-bottom:0; border-top-color:currentColor; opacity:.75; }
.locale-switch .lang-trigger:focus-visible { outline:2px solid #1e9fff; outline-offset:2px; }
.locale-switch .lang-menu { display:none; position:absolute; right:0; top:100%; margin:6px 0 0; min-width:116px; padding:4px; list-style:none; z-index:1001; }
.locale-switch.is-open .lang-menu { display:block; }
.locale-switch .lang-menu::before { content:""; position:absolute; left:0; right:0; top:-8px; height:8px; }
.locale-switch .lang-menu li { margin:0; padding:0; line-height:normal; }
.locale-switch .lang-menu button { display:block; width:100%; padding:8px 14px; border:0; border-radius:5px; background:transparent; color:inherit; font:inherit; text-align:center; white-space:nowrap; cursor:pointer; transition:background .2s,color .2s; }
.locale-switch button:disabled { cursor:wait; opacity:.65; }
.locale-switch-message:empty { display:none; }
.locale-switch-message:not(:empty) { display:flex; align-items:center; gap:9px; position:absolute; right:0; top:calc(100% + 6px); width:max-content; max-width:min(320px, calc(100vw - 64px)); padding:10px 14px; box-sizing:border-box; line-height:20px; text-align:left; white-space:normal; z-index:1002; }
.locale-switch.is-saving .locale-switch-message::before { content:""; flex:0 0 14px; width:14px; height:14px; box-sizing:border-box; border:2px solid currentColor; border-right-color:transparent; border-radius:50%; animation:locale-switch-spin .8s linear infinite; }
.locale-switch.is-error .locale-switch-message { color:#b42318; }
@keyframes locale-switch-spin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion:reduce) { .locale-switch.is-saving .locale-switch-message::before { animation:none; } }
.locale-switch-login { position:fixed; top:24px; right:32px; z-index:1000; }
.locale-switch-login .lang-trigger { border-color:rgba(255,255,255,.22); border-radius:20px; background:rgba(15,25,45,.55); backdrop-filter:blur(8px); transition:background .25s,border-color .25s; }
.locale-switch-login .lang-trigger:hover, .locale-switch-login .is-open .lang-trigger { border-color:#1e9fff; color:#fff; background:rgba(15,25,45,.85); }
.locale-switch-login .lang-menu { background:rgba(19,30,49,.94); color:rgba(255,255,255,.8); border:1px solid rgba(255,255,255,.16); border-radius:8px; backdrop-filter:blur(10px); box-shadow:0 8px 20px rgba(0,0,0,.4); }
.locale-switch-login .lang-menu button:hover, .locale-switch-login .lang-menu button:focus-visible { background:rgba(255,255,255,.1); color:#fff; }
.locale-switch-login .lang-menu button.active { background:rgba(30,159,255,.18); color:#1e9fff; font-weight:600; }
.locale-switch-nav { display:inline-block; vertical-align:middle; margin-right:10px; }
.locale-switch-nav .lang-trigger { height:40px; padding:0 12px; font-size:14px; }
.locale-switch-nav .lang-trigger:hover, .locale-switch-nav .is-open .lang-trigger { color:#fff; background:rgba(255,255,255,.06); }
.locale-switch-nav .lang-menu { top:44px; border:1px solid #ddd; border-radius:3px; background:#fff; color:#333; box-shadow:0 4px 12px rgba(0,0,0,.15); }
.locale-switch-nav .lang-menu::before { top:-14px; height:14px; }
.locale-switch-nav .lang-menu button { border-radius:0; }
.locale-switch-nav .lang-menu button:hover, .locale-switch-nav .lang-menu button:focus-visible { background:#f2f2f2; }
.locale-switch-nav .lang-menu button.active { background:#009688; color:#fff; }

/* 保存提示沿用当前入口的菜单外观。 */
.locale-switch-login .locale-switch-message { border:1px solid rgba(255,255,255,.16); border-radius:8px; background:rgba(19,30,49,.94); color:#1e9fff; backdrop-filter:blur(10px); box-shadow:0 8px 20px rgba(0,0,0,.4); }
.locale-switch-login .is-error .locale-switch-message { color:#ffb4ab; }
.locale-switch-nav .locale-switch-message { top:50px; border:1px solid #ddd; border-radius:3px; background:#fff; color:#009688; box-shadow:0 4px 12px rgba(0,0,0,.15); }
.locale-switch-nav .is-error .locale-switch-message { color:#b42318; }
