/* Prevent a saved non-Chinese locale from flashing the source language while
   the bundled dictionary is being read. The runtime removes this attribute
   after the first translation pass (or on a resource error). */
html[data-twc-i18n-pending="1"] body { visibility: hidden; }
.twc-locale-control[data-ready="0"] { visibility: hidden; }

.twc-locale-control {
    position: fixed;
    top: 18px;
    left: 18px;
    z-index: 9999;
    display: inline-flex;
    gap: 3px;
    padding: 4px;
    border: 1px solid var(--glass-border, rgba(128,128,128,.18));
    border-radius: 18px;
    background: var(--glass-bg, rgba(255,255,255,.72));
    box-shadow: 0 8px 24px rgba(0,0,0,.08);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", sans-serif;
}

.twc-locale-control button {
    min-width: 31px;
    height: 27px;
    padding: 0 7px;
    border: 0;
    border-radius: 14px;
    background: transparent;
    color: var(--text-secondary, #86868b);
    font: 700 10px/1 inherit;
    cursor: pointer;
    transition: background .2s, color .2s, transform .2s;
}

.twc-locale-control button:hover {
    color: var(--accent, #0071e3);
    background: rgba(0,113,227,.08);
    transform: translateY(-1px);
}

.twc-locale-control button[aria-pressed="true"] {
    color: #fff;
    background: var(--accent, #0071e3);
    box-shadow: 0 3px 10px rgba(0,113,227,.24);
}

@media (max-width: 768px) {
    .twc-locale-control { top: 12px; left: 12px; }
}

@media (max-width: 480px) {
    .twc-locale-control { top: 8px; left: 8px; gap: 2px; padding: 3px; }
    .twc-locale-control button { min-width: 27px; height: 24px; padding: 0 5px; font-size: 9px; }
}
