/* DeepSeek Translate - Language Switcher */
.dstr-switcher {
    position: relative;
    display: inline-block;
    font-family: inherit;
    font-size: 14px;
    z-index: 9999;
    /* Default offsets — overridden inline per-instance via --dstr-offset-x / --dstr-offset-y. */
    --dstr-offset-x: 20px;
    --dstr-offset-y: 20px;
}
.dstr-switcher--floating { position: fixed; }

/* Four-corner anchoring. Each corner resets the two edges it does NOT use back to auto
   so switching between corners doesn't leave a stale edge in play. */
.dstr-switcher--floating.dstr-switcher--pos-br { right: var(--dstr-offset-x); bottom: var(--dstr-offset-y); left: auto; top: auto; }
.dstr-switcher--floating.dstr-switcher--pos-bl { left:  var(--dstr-offset-x); bottom: var(--dstr-offset-y); right: auto; top: auto; }
.dstr-switcher--floating.dstr-switcher--pos-tr { right: var(--dstr-offset-x); top:    var(--dstr-offset-y); left: auto; bottom: auto; }
.dstr-switcher--floating.dstr-switcher--pos-tl { left:  var(--dstr-offset-x); top:    var(--dstr-offset-y); right: auto; bottom: auto; }
/* Back-compat: an old floating switcher with no corner modifier behaves like bottom-right. */
.dstr-switcher--floating:not(.dstr-switcher--pos-br):not(.dstr-switcher--pos-bl):not(.dstr-switcher--pos-tr):not(.dstr-switcher--pos-tl) {
    right: var(--dstr-offset-x); bottom: var(--dstr-offset-y);
}
.dstr-switcher__toggle {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px;
    background: #ffffff; color: #222;
    border: 1px solid #d9d9d9; border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: box-shadow 0.15s ease;
    font: inherit; font-size: 14px; line-height: 1.2;
}
.dstr-switcher__toggle:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.dstr-switcher__flag { font-size: 16px; line-height: 1; }
.dstr-switcher__caret { font-size: 10px; opacity: 0.7; }

.dstr-switcher__menu {
    list-style: none; margin: 0; padding: 6px;
    position: absolute; right: 0; bottom: calc(100% + 8px);
    min-width: 180px;
    background: #fff;
    border: 1px solid #e5e5e5; border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0,0,0,0.12);
    display: none;
}
/* When the switcher is anchored to a TOP corner, drop the menu downward so it doesn't
   open off-screen above the viewport. */
.dstr-switcher--pos-tr .dstr-switcher__menu,
.dstr-switcher--pos-tl .dstr-switcher__menu {
    top: calc(100% + 8px); bottom: auto;
}
/* When anchored to the LEFT, align the menu's left edge with the toggle instead of right. */
.dstr-switcher--pos-bl .dstr-switcher__menu,
.dstr-switcher--pos-tl .dstr-switcher__menu {
    left: 0; right: auto;
}
.dstr-switcher[aria-expanded="true"] .dstr-switcher__menu,
.dstr-switcher__menu.is-open { display: block; }
.dstr-switcher__menu li { margin: 0; }
.dstr-switcher__menu a {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px;
    color: #222; text-decoration: none;
    border-radius: 6px;
    transition: background 0.12s ease;
}
.dstr-switcher__menu a:hover { background: #f6f7f8; }
.dstr-switcher__menu a.is-active { background: #eef5ff; color: #0073aa; font-weight: 600; }

.dstr-switcher__inline { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; }
.dstr-switcher__inline a {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 10px;
    border: 1px solid #e0e0e0; border-radius: 6px;
    color: #333; text-decoration: none;
}
.dstr-switcher__inline a.is-active { background: #0073aa; color: #fff; border-color: #0073aa; }

/* RTL pages: mirror the floating position. We swap left/right anchors for each corner
   so a "bottom-right" switcher on an RTL page lands on the visual bottom-left. */
.dstr-rtl .dstr-switcher--floating.dstr-switcher--pos-br { right: auto; left: var(--dstr-offset-x); }
.dstr-rtl .dstr-switcher--floating.dstr-switcher--pos-bl { left: auto;  right: var(--dstr-offset-x); }
.dstr-rtl .dstr-switcher--floating.dstr-switcher--pos-tr { right: auto; left: var(--dstr-offset-x); }
.dstr-rtl .dstr-switcher--floating.dstr-switcher--pos-tl { left: auto;  right: var(--dstr-offset-x); }
/* Back-compat for an unmodified floating switcher on an RTL page. */
.dstr-rtl .dstr-switcher--floating:not(.dstr-switcher--pos-br):not(.dstr-switcher--pos-bl):not(.dstr-switcher--pos-tr):not(.dstr-switcher--pos-tl) {
    right: auto; left: var(--dstr-offset-x);
}
.dstr-rtl .dstr-switcher__menu { right: auto; left: 0; }
