/**
 * 顶栏语言切换美化：紧凑触发器 + 下拉网格；默认只显示 featured，其余点 More 展开。
 * 由 CommonAction 自动注入（xiaoyucms/{theme}/css/xy_header_extra.css）。
 */

.web_head .xy-header-lang {
  display: inline-flex !important;
  align-items: center !important;
  vertical-align: middle !important;
  line-height: 1 !important;
  overflow: visible !important;
}

.web_head .xy-header-lang-switcher {
  line-height: 1 !important;
  overflow: visible !important;
}

.web_head .xy-header-lang-switcher #gt_float_wrapper {
  position: relative !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  height: auto !important;
  z-index: 20 !important;
  display: block !important;
  overflow: visible !important;
}

.web_head .xy-header-lang-switcher .gt_float_switcher {
  position: relative !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 13px !important;
  border-radius: 0 !important;
  overflow: visible !important;
  line-height: 1 !important;
}

.web_head .xy-header-lang-switcher .gt_float_switcher .gt-selected {
  background: transparent !important;
  float: none !important;
  cursor: pointer !important;
}

.web_head .xy-header-lang-switcher .gt_float_switcher .gt-selected .gt-current-lang {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 4px 8px !important;
  min-height: 28px !important;
  color: #333 !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  font-family: Arial, Helvetica, sans-serif !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  background: #fff !important;
  border: 1px solid #e6e6e6 !important;
  border-radius: 3px !important;
  box-shadow: none !important;
  line-height: 1.2 !important;
  transition: border-color .2s ease, color .2s ease;
}

.web_head .xy-header-lang-switcher .gt_float_switcher .gt-selected .gt-current-lang:hover {
  color: #ff9702 !important;
  border-color: #ff9702 !important;
  opacity: 1 !important;
}

.web_head .xy-header-lang-switcher .gt_float_switcher .gt-selected .gt-current-lang .gt-lang-code {
  position: static !important;
  top: auto !important;
  max-width: 3.2em !important;
  overflow: hidden !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
  letter-spacing: 0.04em;
}

.web_head .xy-header-lang-switcher .gt_float_switcher img {
  width: 20px !important;
  height: 14px !important;
  max-width: 20px !important;
  max-height: 14px !important;
  margin: 0 !important;
  border-radius: 2px !important;
  vertical-align: middle !important;
  object-fit: cover !important;
  object-position: center !important;
  display: inline-block !important;
  flex-shrink: 0 !important;
  background: transparent !important;
}

.web_head .xy-header-lang-switcher .gt_float_switcher .gt-selected .gt-current-lang span.gt_float_switcher-arrow {
  height: 12px !important;
  width: 12px !important;
  background-size: 9px !important;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 285 285'><path d='M282 76.5l-14.2-14.3a9 9 0 0 0-13.1 0L142.5 174.4 30.3 62.2a9 9 0 0 0-13.2 0L3 76.5a9 9 0 0 0 0 13.1l133 133a9 9 0 0 0 13.1 0l133-133a9 9 0 0 0 0-13z' style='fill:%23333333'/></svg>") !important;
  opacity: 0.85 !important;
}

/* 下拉：三列网格，默认只显示 featured */
.web_head .xy-header-lang-switcher .gt_float_switcher .gt_options {
  position: absolute !important;
  top: calc(100% + 8px) !important;
  right: 0 !important;
  left: auto !important;
  width: 360px !important;
  max-width: min(360px, calc(100vw - 24px)) !important;
  max-height: min(52vh, 360px) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  -webkit-overflow-scrolling: touch !important;
  padding: 10px 8px !important;
  margin: 0 !important;
  background: #fff !important;
  border: 1px solid #eee !important;
  border-radius: 6px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
  z-index: 9999 !important;
  float: none !important;
  white-space: normal !important;
  display: none !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-auto-rows: min-content !important;
  align-content: start !important;
  justify-items: stretch !important;
  text-align: left !important;
  box-sizing: border-box !important;
}

.web_head .xy-header-lang-switcher .gt_float_switcher .gt_options.gt-open {
  display: grid !important;
  opacity: 1 !important;
  transform: none !important;
}

.web_head .xy-header-lang-switcher .gt_float_switcher .gt_options a {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  text-align: left !important;
  gap: 8px !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding: 8px 10px !important;
  margin: 0 !important;
  color: #444 !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  text-decoration: none !important;
  float: none !important;
  background: transparent !important;
  border-radius: 4px !important;
  text-transform: none !important;
}

.web_head .xy-header-lang-switcher .gt_float_switcher .gt_options a:hover {
  background: #fff7ed !important;
  color: #ff9702 !important;
}

.web_head .xy-header-lang-switcher .gt_float_switcher .gt_options a img {
  flex-shrink: 0 !important;
  width: 18px !important;
  height: 12px !important;
  max-width: 18px !important;
  max-height: 12px !important;
  margin: 0 !important;
  background: #f3f3f3 !important;
}

/* 非 featured 默认隐藏，点 More 再展开 */
.web_head .xy-header-lang-switcher .gt_float_switcher .gt_options a.gt-lang-extra {
  display: none !important;
}

.web_head .xy-header-lang-switcher .gt_float_switcher .gt_options.gt-expanded {
  width: 480px !important;
  max-width: min(480px, calc(100vw - 24px)) !important;
  max-height: min(70vh, 480px) !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.web_head .xy-header-lang-switcher .gt_float_switcher .gt_options.gt-expanded a.gt-lang-extra {
  display: flex !important;
}

.web_head .xy-header-lang-switcher .gt_float_switcher .gt_options a.gt-lang-more {
  grid-column: 1 / -1 !important;
  justify-content: center !important;
  align-items: center !important;
  display: flex !important;
  gap: 6px !important;
  color: #ff9702 !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  border-top: 1px solid #eee !important;
  margin-top: 6px !important;
  padding: 10px 12px 4px !important;
  text-decoration: none !important;
  word-break: normal !important;
  white-space: nowrap !important;
}

.web_head .xy-header-lang-switcher .gt_float_switcher .gt_options a.gt-lang-more:hover {
  background: transparent !important;
  color: #333 !important;
}

.web_head,
.web_head .layout,
.web_head .head_layer,
.web_head .head_right {
  overflow: visible !important;
}

.web_head:has(.gt_options.gt-open) {
  z-index: 1001;
  overflow: visible !important;
}

@media only screen and (max-width: 950px) {
  .web_head .xy-header-lang,
  .web_head .xy-header-lang-switcher,
  .web_head .xy-header-extra-nav .xy-header-lang {
    display: none !important;
  }
  .web_head .xy-basket-nav,
  .web_head .head_right .xy-header-extra-nav > li.xy-basket-nav,
  .web_head li.xy-basket-nav,
  .web_head .xy-basket-nav.is-visible {
    display: none !important;
  }
}

/* 手机顶栏翻译侧栏（调用 GTranslate 语言列表） */
.xy-mobile-lang-panel{padding:4px 2px 12px;}
.xy-mobile-lang-panel .xy-mobile-lang-hd{
  margin:0 0 14px;padding:0 4px 10px;border-bottom:1px solid #eee;
  font-size:15px;font-weight:600;color:#222;text-transform:uppercase;letter-spacing:.04em;
}
.xy-mobile-lang-panel .xy-mobile-lang-empty{margin:12px 4px;color:#888;font-size:13px;}
.xy-mobile-lang-panel .xy-mobile-lang-list{list-style:none;margin:0;padding:0;}
.xy-mobile-lang-panel .xy-mobile-lang-list li{margin:0;padding:0;border-bottom:1px solid #f0f0f0;}
.xy-mobile-lang-panel .xy-mobile-lang-list a{
  display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;
  gap:10px;padding:12px 6px;color:#333;text-decoration:none;font-size:14px;line-height:1.3;
}
.xy-mobile-lang-panel .xy-mobile-lang-list a:active,
.xy-mobile-lang-panel .xy-mobile-lang-list a:hover{background:#fff8f0;color:#ff9702;}
.xy-mobile-lang-panel .xy-mobile-lang-list img{
  width:22px;height:15px;object-fit:cover;border-radius:2px;-webkit-flex-shrink:0;flex-shrink:0;
}
.xy-mobile-lang-panel .xy-mobile-lang-list span{min-width:0;}

