/* ── Language Switcher ── */
#lang-switcher {
  position: relative;
  display: inline-block;
  z-index: 1000;
  font-family: arial, sans-serif;
}

.lang-switcher {
  position: relative;
}

.lang-switcher-current {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  background: rgba(255,255,255,0.05);
  color: #fff;
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
  font-family: inherit;
}
.lang-switcher-current:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.35);
}

.lang-switcher-list-wrapper {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  width: 280px;
  max-height: 360px;
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
  overflow: hidden;
  flex-direction: column;
}
.lang-switcher-list-wrapper.open {
  display: flex;
}

.lang-switcher-search {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-size: 0.8rem;
  outline: none;
  box-sizing: border-box;
  font-family: inherit;
}
.lang-switcher-search::placeholder {
  color: rgba(255,255,255,0.35);
}
.lang-switcher-search:focus {
  background: rgba(255,255,255,0.1);
}

.lang-switcher-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  overflow-y: auto;
  flex: 1;
}
.lang-switcher-list::-webkit-scrollbar {
  width: 4px;
}
.lang-switcher-list::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
}

.lang-switcher-list li {
  margin: 0;
  padding: 0;
  width: 100%;
}
.lang-switcher-list li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  color: rgba(255,255,255,0.75);
  font-size: 0.8rem;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.lang-switcher-list li a:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.lang-switcher-list li a.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-weight: bold;
}
.lang-switcher-list li a .lang-name {
  margin-left: auto;
  opacity: 0.45;
  font-size: 0.75em;
  font-weight: normal;
}

/* ── Footer integration ── */
footer .beian {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
footer .beian #lang-switcher {
  position: relative;
}

/* ── Light-background pages (e.g. privacy.html) ── */
.container #lang-switcher .lang-switcher-current {
  color: #fff;
  border-color: rgba(0,0,0,0.2);
  background: rgba(0,0,0,0.04);
}
.container #lang-switcher .lang-switcher-current:hover {
  background: rgba(0,0,0,0.08);
  border-color: rgba(0,0,0,0.35);
}
.container #lang-switcher .lang-switcher-list-wrapper {
  background: #fff;
  border-color: rgba(0,0,0,0.12);
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
.container #lang-switcher .lang-switcher-search {
  background: #f5f5f5;
  color: #fff;
  border-bottom-color: rgba(0,0,0,0.08);
}
.container #lang-switcher .lang-switcher-search::placeholder {
  color: rgba(0,0,0,0.35);
}
.container #lang-switcher .lang-switcher-list li a {
  color: rgba(0,0,0,0.7);
}
.container #lang-switcher .lang-switcher-list li a:hover {
  background: rgba(0,0,0,0.05);
  color: #000;
}
.container #lang-switcher .lang-switcher-list li a.active {
  background: rgba(0,0,0,0.08);
  color: #000;
}

/* ── Responsive ── */
@media screen and (max-width: 768px) {
  footer .beian {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  footer .beian #lang-switcher {
    position: relative;
    margin-top: 0.75rem;
  }
  .lang-switcher-current {
    padding: 10px 16px;
    font-size: 1rem;
  }
  .lang-switcher-list-wrapper {
    width: 260px;
    max-height: 300px;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }
  .lang-switcher-list li a {
    padding: 11px 16px;
    font-size: 0.95rem;
  }
}
