/* 全局悬浮语言选择器样式 */

.floating-lang-selector {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.lang-selector-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 24px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: #333;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.lang-selector-btn:hover {
  background: #f5f5f5;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.lang-selector-btn:active {
  transform: translateY(0);
}

.lang-flag {
  font-size: 18px;
  line-height: 1;
}

.lang-text {
  font-size: 14px;
}

.lang-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  min-width: 180px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.2s ease;
  position: relative;
}

.lang-option:hover {
  background: #f5f5f5;
}

.lang-option.active {
  background: #e3f2fd;
  color: #1976d2;
  font-weight: 500;
}

.lang-option .lang-flag {
  font-size: 20px;
}

.lang-option .lang-text {
  flex: 1;
  font-size: 14px;
}

.lang-check {
  color: #1976d2;
  font-size: 16px;
  font-weight: bold;
}

/* 响应式调整 - 移动端 */
@media (max-width: 768px) {
  .floating-lang-selector {
    top: 10px;
    right: 10px;
  }

  .lang-selector-btn {
    padding: 8px 12px;
    font-size: 13px;
  }

  /* 移动端按钮只显示旗帜，隐藏语言名称 */
  .lang-selector-btn .lang-text {
    display: none;
  }

  /* 移动端下拉菜单保留语言名称，方便用户识别 */
  .lang-dropdown {
    min-width: 160px;
  }

  .lang-option {
    padding: 10px 14px;
  }

  .lang-option .lang-text {
    display: block; /* 确保下拉菜单中的语言名称可见 */
  }
}

/* 避免与调试面板冲突 */
body.debug-panel-open .floating-lang-selector {
  right: 370px; /* 调试面板宽度350px + 20px间距 */
  transition: right 0.3s ease;
}
