/* 黑曜全站语言切换组件 — 深色主题、可访问 select、移动端适配（无外部依赖）。 */

.relay-i18n {
  display: inline-flex;
  align-items: center;
  color-scheme: dark;
}

.relay-i18n-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  box-sizing: border-box;
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
  color: #f3f3f5;
  background-color: #242228;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2010%206%27%3E%3Cpath%20d%3D%27M1%201l4%204%204-4%27%20fill%3D%27none%27%20stroke%3D%27%239aa3b8%27%20stroke-width%3D%271.5%27%20stroke-linecap%3D%27round%27%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 10px 6px;
  border: 1px solid #454149;
  border-radius: 8px;
  padding: 4px 26px 4px 10px;
  min-height: 30px;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.relay-i18n-select:hover {
  border-color: #79717c;
  background-color: #302d34;
}

.relay-i18n-select option {
  background-color: #1c2230;
  color: #e8eaf0;
}

.relay-i18n-select:focus-visible {
  outline: 2px solid #ff7a2f;
  outline-offset: 2px;
}

.relay-i18n-select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* noscript 下的 ?lang 链接（无 JS 也可切换） */
.relay-i18n-links {
  display: inline-flex;
  gap: 10px;
  margin-left: 8px;
}

.relay-i18n-link {
  color: #9aa3b8;
  font-size: 13px;
  text-decoration: underline;
}

.relay-i18n-link:hover {
  color: #e8eaf0;
}

/* shell() 兜底插入：页尾静态块，不做浮层，避免遮挡 UI */
.relay-i18n-fallback {
  display: flex;
  justify-content: center;
  padding: 8px 12px;
}

@media (max-width: 640px) {
  .relay-i18n-select {
    font-size: 16px; /* ≥16px 防 iOS 聚焦缩放，同时增大触控面积 */
    min-height: 36px;
    padding: 6px 28px 6px 12px;
  }

  .relay-i18n-fallback {
    padding: 6px 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .relay-i18n-select {
    transition: none;
  }
}
