/* i18n 自动翻译 · UI 样式（与站点深蓝+金配色一致） */
:root {
  --i18n-navy: #0d1b2a;
  --i18n-navy2: #123c6b;
  --i18n-gold: #b38d54;
  --i18n-line: rgba(255, 255, 255, .14);
}

html[data-i18n-wait] body {
  opacity: .72;
  transition: opacity .3s ease;
}

#i18nBar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  z-index: 2147483001;
  background: linear-gradient(90deg, #b38d54, #e5c88a, #b38d54);
  box-shadow: 0 0 10px rgba(179, 141, 84, .8);
  transition: width .3s ease, opacity .4s ease;
  opacity: 0;
  pointer-events: none;
}

#i18nBar.on {
  opacity: 1;
}

.i18n-ui {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  box-sizing: border-box;
}

.i18n-ui * {
  box-sizing: border-box;
}

#i18nFabWrap {
  position: fixed;
  right: 16px;
  bottom: 18px;
  z-index: 2147483000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

#i18nFab {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 44px;
  padding: 0 15px 0 13px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 22px;
  background: linear-gradient(135deg, #123c6b, #0d1b2a);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .2px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(13, 27, 42, .38);
  transition: transform .18s ease, box-shadow .18s ease;
  line-height: 1;
}

#i18nFab:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(13, 27, 42, .46);
}

#i18nFab svg {
  width: 17px;
  height: 17px;
  flex: none;
  stroke: var(--i18n-gold);
}

#i18nPanel {
  width: 320px;
  max-width: calc(100vw - 32px);
  max-height: min(64vh, 560px);
  overflow: auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(13, 27, 42, .26);
  border: 1px solid rgba(13, 27, 42, .08);
  padding: 14px 14px 10px;
  display: none;
  animation: i18nPop .16s ease;
}

#i18nPanel.open {
  display: block;
}

@keyframes i18nPop {
  from {
    opacity: 0;
    transform: translateY(6px) scale(.98);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.i18n-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 2px 9px;
  border-bottom: 1px solid #eef1f5;
  margin-bottom: 9px;
}

.i18n-head b {
  font-size: 14px;
  color: var(--i18n-navy);
}

.i18n-head span {
  font-size: 11px;
  color: #98a2b3;
}

.i18n-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.i18n-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 9px;
  border: 1px solid #eef1f5;
  border-radius: 8px;
  background: #fbfcfd;
  cursor: pointer;
  font-size: 12.5px;
  color: #253449;
  text-align: left;
  line-height: 1.25;
  transition: all .15s ease;
  font-family: inherit;
}

.i18n-item:hover {
  border-color: #cfd9e6;
  background: #f4f7fb;
}

.i18n-item.cur {
  border-color: var(--i18n-gold);
  background: #fdf9f1;
  color: var(--i18n-navy);
  font-weight: 700;
}

.i18n-item small {
  display: block;
  font-size: 10.5px;
  color: #9aa6b6;
  font-weight: 400;
  margin-top: 1px;
}

.i18n-item .i18n-tick {
  color: var(--i18n-gold);
  font-size: 12px;
  flex: none;
}

.i18n-foot {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #eef1f5;
  font-size: 10.5px;
  color: #98a2b3;
  line-height: 1.5;
}

#i18nToast {
  max-width: 300px;
  background: #0d1b2a;
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
  padding: 9px 12px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(13, 27, 42, .3);
  display: none;
}

#i18nToast.show {
  display: block;
  animation: i18nPop .2s ease;
}

#i18nToast a {
  color: #e5c88a;
  text-decoration: underline;
  cursor: pointer;
  white-space: nowrap;
}

@media (max-width: 480px) {
  #i18nFabWrap {
    right: 12px;
    bottom: 12px;
  }

  #i18nFab {
    height: 40px;
    padding: 0 12px;
    font-size: 12px;
  }

  #i18nPanel {
    width: calc(100vw - 24px);
  }

  .i18n-item {
    padding: 7px 8px;
    font-size: 12px;
  }
}

@media print {
  #i18nFabWrap, #i18nBar {
    display: none !important;
  }
}
