.site-language {
  position: relative;
  z-index: 3;
  width: max-content;
  color: #f6edde;
  font: 700 12px/1 Manrope, Arial, sans-serif;
  letter-spacing: .06em;
  pointer-events: auto;
}
.site-language > summary,
.site-language-options button {
  display: flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  min-height: 44px;
  padding: 0 10px;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}
.site-language > summary {
  list-style: none;
  background: #201b16ed;
  border: 1px solid #e0c8a052;
  border-radius: 3px;
}
.site-language > summary::-webkit-details-marker { display: none; }
.site-language > summary::after {
  content: "";
  width: 5px;
  height: 5px;
  margin-left: 2px;
  border: solid #e1ccb0;
  border-width: 0 1px 1px 0;
  transform: translateY(-2px) rotate(45deg);
}
.site-language[open] > summary::after { transform: translateY(1px) rotate(225deg); }
.site-language-flag {
  display: block;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px #fff4d942;
}
.site-language-options {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 100%;
  padding: 3px;
  margin: 0;
  list-style: none;
  background: #211b16;
  border: 1px solid #e0c8a052;
  border-radius: 3px;
  box-shadow: 0 12px 24px #0007;
}
.site-language-options button {
  width: 100%;
  border: 0;
  border-radius: 2px;
  background: transparent;
}
.site-language-options button:hover,
.site-language-options button[aria-pressed="true"] { background: #f5d8b01c; }
.site-language :is(summary, button):focus-visible { outline: 2px solid #e3c699; outline-offset: 1px; }
@media (min-width: 701px) {
  body > header > .site-language { margin-left: auto; margin-right: 24px; }
}
html:lang(zh-CN) body { font-family: Manrope, 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif; }
#brand-ending .tour-reading summary { max-width: 100%; }
@media (max-width: 700px) {
  body > .localized-gallery-header,
  body > .localized-cave-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 3px 12px; }
  body > .localized-gallery-header > .header-actions,
  body > .localized-cave-header > .header-links { grid-column: 1 / -1; }
  body > .localized-cave-header > .header-links { justify-content: flex-end; flex-wrap: wrap; }
  .localized-cave-header + main #help { top: 120px; max-height: calc(100dvh - 140px); overflow-y: auto; }
  .site-language { justify-self: end; }
  body #brand-ending[data-room] .tour-content {
    top: max(114px, min(31dvh, calc(100dvh - 390px)));
    max-height: calc(100dvh - max(114px, min(31dvh, calc(100dvh - 390px))) - 136px - env(safe-area-inset-bottom, 0px));
  }
}
