/* 国际化样式 */
:root {
  /* 字体系统 */
  --font-system-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
    Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji',
    'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
  
  /* 中文字体 */
  --font-chinese: 'PingFang SC', 'Microsoft YaHei', var(--font-system-sans);
  
  /* 日文字体 */
  --font-japanese: 'Hiragino Sans', 'Hiragino Kaku Gothic Pro', 'Noto Sans JP',
    var(--font-system-sans);
  
  /* 韩文字体 */
  --font-korean: 'Malgun Gothic', 'Apple SD Gothic Neo', 'Noto Sans KR',
    var(--font-system-sans);
  
  /* 阿拉伯文字体 */
  --font-arabic: 'Noto Sans Arabic', var(--font-system-sans);
}

/* 语言特定字体设置 */
[lang="zh-CN"] {
  font-family: var(--font-chinese);
}

[lang="ja"] {
  font-family: var(--font-japanese);
}

[lang="ko"] {
  font-family: var(--font-korean);
}

[lang="ar"] {
  font-family: var(--font-arabic);
}

/* RTL 支持 */
[dir="rtl"] {
  /* 反转边距 */
  .nav-item {
    margin-left: 0;
    margin-right: 36px;
  }
  
  /* 反转图标 */
  .fa-arrow-right {
    transform: scaleX(-1);
  }
  
  /* 反转文本对齐 */
  .text-left {
    text-align: right;
  }
  
  .text-right {
    text-align: left;
  }
}

/* 语言切换器样式 */
.language-switcher {
  position: relative;
  margin-left: 20px;
}

.language-switcher select {
  appearance: none;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 5px 25px 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.language-switcher::after {
  content: '▼';
  font-size: 10px;
  color: white;
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

/* 响应式设计中的语言切换器 */
@media (max-width: 768px) {
  .language-switcher {
    margin: 15px 0;
    width: 100%;
  }
  
  .language-switcher select {
    width: 100%;
    padding: 8px 25px 8px 10px;
  }
}

/* 数字格式化 */
[data-i18n-number] {
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

/* 日期格式化 */
[data-i18n-date] {
  white-space: nowrap;
}

/* 文字方向相关的间距调整 */
[dir="rtl"] .me-2 {
  margin-right: 0 !important;
  margin-left: 0.5rem !important;
}

[dir="rtl"] .ms-auto {
  margin-left: 0 !important;
  margin-right: auto !important;
}

/* 确保图标在RTL布局中正确显示 */
[dir="rtl"] .fa-arrow-right:before {
  content: "\f060"; /* Font Awesome 左箭头 */
}

/* 表单验证消息的RTL支持 */
[dir="rtl"] .invalid-feedback {
  text-align: right;
} 