/* 語言下拉選單。顏色由頁面的 --lm-* 決定 */
.lang-menu { position: relative; flex: none; font-size: 14px; line-height: 1.3; }
.lang-menu summary { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid var(--lm-line); border-radius: 999px; color: var(--lm-text); font-weight: 500; cursor: pointer; list-style: none; user-select: none; -webkit-user-select: none; transition: border-color .18s ease-out, background .18s ease-out; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover { background: var(--lm-hover); }
.lang-menu summary:focus-visible, .lang-panel a:focus-visible { outline: 2px solid var(--lm-focus); outline-offset: 2px; }
.lang-menu summary svg { flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; }
.lang-menu summary i { width: 7px; height: 7px; margin: -3px 2px 0 2px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg); transition: transform .15s ease-out; }
.lang-menu[open] summary i { margin-top: 3px; transform: rotate(225deg); }
.lang-panel { position: absolute; z-index: 30; top: calc(100% + 8px); right: 0; width: 220px; padding: 6px; border: 1px solid var(--lm-line); border-radius: 16px; background: var(--lm-panel); color: var(--lm-text); box-shadow: 0 12px 40px rgba(0, 0, 0, .35); }
.lm-item { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 12px; border-radius: 10px; color: inherit; text-decoration: none; }
a.lm-item:hover { background: var(--lm-hover); }
.lm-item.lm-current { font-weight: 600; }
.lm-item.lm-current::after { content: ""; width: 12px; height: 6px; margin-top: -3px; border-left: 2px solid var(--lm-focus); border-bottom: 2px solid var(--lm-focus); transform: rotate(-45deg); }
.lm-zh { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 6px 0 12px; }
.lm-switch { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--lm-track); }
.lm-seg { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; min-height: 36px; border-radius: 999px; color: inherit; text-decoration: none; }
a.lm-seg:hover { background: var(--lm-hover); }
.lm-seg.lm-current { background: var(--lm-on); color: var(--lm-on-text); font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .lang-menu summary, .lang-menu summary i { transition: none; } }
