/* 九语言切换：侧边栏底部与登录页共用 */
.i18n-pick {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 2px 6px 2px 5px;
  border: 1px solid var(--border, #d5dcec);
  border-radius: 8px;
  background: var(--card, #fff);
  color: var(--text, #222);
  line-height: 1.4;
}
.i18n-globe {
  font-size: 13px;
  opacity: .85;
  flex: none;
}
.i18n-select {
  min-width: 0;
  max-width: 118px;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12px;
  padding: 1px 0;
  cursor: pointer;
}
.i18n-select option { color: #222; background: #fff; }
.sidebar-lang {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 2px 2px;
}
.sidebar-top-lang {
  padding: 8px 14px 2px;
}
.sidebar-top-lang .sidebar-lang {
  padding: 0;
}
.sidebar-lang .i18n-pick { width: auto; }
.sidebar-foot-meta {
  display: flex;
  align-items: center;
  justify-content: center;   /* 语言选择器在底栏水平居中 */
  gap: 8px;
  min-width: 0;
  margin-top: 8px;
}
.sidebar-foot-lang { padding: 0; flex: 0 0 auto; justify-content: center; }
.sidebar-foot-lang .i18n-pick {
  height: 24px;
  padding: 0 7px;
  border-color: rgba(255, 255, 255, .22);
  background: rgba(255, 255, 255, .08);
  color: #dbe3ff;
  font-size: 11px;
  cursor: pointer;
}
.sidebar-foot-lang .i18n-globe { font-size: 11px; opacity: .9; }
.sidebar-foot-lang .i18n-current-name { max-width: 78px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot-lang .i18n-caret { font-size: 9px; opacity: .75; margin-left: -1px; }
.sidebar-foot-lang .i18n-footer-pick.is-open { border-color: rgba(120, 160, 255, .8); }
/* 左侧菜单右键弹出的语言菜单（替代侧栏底部的语言胶囊） */
.nav-ctx-menu {
  position: fixed;
  z-index: 10001;
  min-width: 176px;
  padding: 6px;
  border: 1px solid #d5dcec;
  border-radius: 10px;
  background: #fff;
  color: #222;
  box-shadow: 0 12px 32px rgba(12, 22, 45, .22);
  font-family: inherit;
}
.nav-ctx-menu[hidden] { display: none; }
.nav-ctx-head {
  padding: 4px 8px 6px;
  font-size: 11.5px;
  color: #8d97b8;
  border-bottom: 1px solid #eef1f8;
  margin-bottom: 4px;
}
.nav-ctx-list { display: flex; flex-direction: column; }
.nav-ctx-item {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #222;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.nav-ctx-item:hover { background: #eef3ff; }
.nav-ctx-item.on { color: #2b57d6; font-weight: 600; background: #f3f6ff; }
.nav-ctx-check { width: 12px; flex: none; font-size: 12px; line-height: 1; }
.nav-ctx-name { flex: 1; }

.i18n-menu {
  position: fixed;
  z-index: 10000;
  min-width: 168px;
  padding: 6px;
  border: 1px solid var(--border, #d5dcec);
  border-radius: 10px;
  background: var(--card, #fff);
  color: var(--text, #222);
  box-shadow: 0 12px 32px rgba(12, 22, 45, .22);
  max-height: min(360px, calc(100vh - 16px));
  overflow: auto;
}
.i18n-menu[hidden] { display: none; }
.i18n-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
}
.i18n-menu-item:hover { background: rgba(79, 124, 255, .10); }
.i18n-menu-item.is-on { background: rgba(79, 124, 255, .16); color: #2f5bea; font-weight: 600; }
.i18n-menu-item.is-on::after { content: '✓'; margin-left: 12px; }
/* 页面标题栏语言选择器：仪表盘位于「退出登录」与「?」之间，其余页面同样在帮助图标前 */
.page-head .actions .i18n-lang-slot {
  display: flex; align-items: center; height: 30px; flex: 0 0 auto;
}
.page-head .actions .page-lang .i18n-pick {
  height: 30px; padding: 0 8px; border-radius: 999px; background: #fff;
}
.page-head .actions .page-lang .i18n-select { font-size: 12px; max-width: 118px; }
@media (max-width: 560px) {
  .page-head .actions .page-lang .i18n-pick { max-width: 100%; }
  .page-head .actions .page-lang .i18n-select { max-width: 92px; }
}
.auth-lang {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
}
.auth-lang .i18n-pick {
  background: rgba(255, 255, 255, .86);
  box-shadow: 0 2px 10px rgba(30, 50, 90, .10);
}
.auth-lang .i18n-select { max-width: 104px; }
.auth-app-row { padding-left: 34px; padding-right: 34px; }
.auth-app { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html:not([lang="zh-CN"]):not([lang="zh-TW"]) .auth-tabs button {
  font-size: 13px;
  padding-left: 4px;
  padding-right: 4px;
  white-space: nowrap;
  letter-spacing: -.2px;
}
html:not([lang="zh-CN"]):not([lang="zh-TW"]) .auth-tabs button[data-long] {
  font-size: 12px;
}
@media (max-width: 560px) {
  .auth-lang { top: 8px; right: 8px; }
  .auth-lang .i18n-select { max-width: 88px; font-size: 11.5px; }
}

/* ---------- 非中文长词控件的统一对齐规则 ----------
   德语、俄语、西语、法语的长词会把导航、标签、按钮撑成两行，
   导致同一排控件高度不一致。所有固定控件统一单行 + 省略号，完整文字放 title。 */
html:not([lang="zh-CN"]):not([lang="zh-TW"]) #nav a,
html:not([lang="zh-CN"]):not([lang="zh-TW"]) #nav .nav-head {
  font-size: 12.5px;
}
#nav a,
#nav .nav-head,
#nav .nav-sub,
.nav-flyout,
.nav-flyout .nav-fly-list a {
  min-width: 0;
}
#nav a > span,
.nav-head > span,
.nav-flyout .nav-fly-list a > span {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#nav a .nav-badge,
.nav-head .nav-arrow,
.nav-flyout .nav-fly-title {
  flex: none;
}
.nav-flyout .nav-fly-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 二级菜单缩进略收紧，给长词多留 8px，避免德语/俄语刚到边界就换行 */
.nav-sub { margin-left: 18px; padding-left: 6px; }
/* 同一语言的每一行固定基准高度，九种语言字体回退不同也不会一行 36、一行 39 */
#nav a,
#nav .nav-head { min-height: 38px; padding-top: 0; padding-bottom: 0; }
#nav .nav-sub a { min-height: 34px; padding-top: 0; padding-bottom: 0; }

/* 顶部标签：长标签仍可省略，但补上 title；内容区不被挤扁 */
.tab { min-width: 0; flex: 0 0 auto; }
.tab .t-label { min-width: 0; flex: 0 1 auto; }
.tab .t-icon,
.tab .t-close { flex: none; }
html:not([lang="zh-CN"]):not([lang="zh-TW"]) .tab { max-width: 240px; }

/* 按钮、页签、弹窗底栏：不允许文字换行把控件撑高 */
.btn { white-space: nowrap; }
.page-head .actions > * { flex: 0 0 auto; }
.page-head h2 { min-width: 0; overflow-wrap: anywhere; }
.page-head .actions .user-chip {
  height: 30px;
  padding: 2px 12px 2px 3px;
  gap: 6px;
  font-size: 12.5px;
}
.page-head .actions .user-chip-av { width: 24px; height: 24px; }
.page-head .actions .user-chip-name { min-width: 0; }
.modal-foot { flex-wrap: wrap; }

/* 页内切换页签：长语言可横向滚动，不把尖角/下划线挤歪 */
.tabs { overflow-x: auto; scrollbar-width: thin; }
.tabs a { flex: 0 0 auto; white-space: nowrap; }

/* 登录页窄屏：三个页签必须同高单行；App 下载按钮缩小字号避免被二维码区裁切 */
.auth-tabs button { white-space: nowrap; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* 拉丁与西里尔语言改用人性化 UI 字体：微软雅黑缺少西文标点间距，会把 Aujourd’hui 渲染成 Aujourd’ hui */
html[lang="en-US"] body,
html[lang="es-ES"] body,
html[lang="fr-FR"] body,
html[lang="de-DE"] body,
html[lang="ru-RU"] body { font-family: "Segoe UI", "Noto Sans", Arial, sans-serif; }
html[lang="ja-JP"] body { font-family: "Yu Gothic UI", "Meiryo", "MS PGothic", sans-serif; }
html[lang="ko-KR"] body { font-family: "Malgun Gothic", "Apple SD Gothic Neo", sans-serif; }

/* 1024 及以下侧边栏只有 180px，副标题放两行也会溢出，直接收起，只留品牌名与版本号 */
@media (max-width: 1100px) {
  .brand .sub { display: none; }
  .brand { padding-top: 16px; padding-bottom: 16px; }
}

/* 底栏状态始终一行：只显示短名，完整说明在 title */
#backend-tag { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 360px) {
  /* 窄屏登录卡两侧由 26px 收到 16px，给三个语言页签留出完整文字宽度 */
  body.auth-mode .auth-wrap { padding-left: 12px; padding-right: 12px; }
  body.auth-mode .auth-card { padding-left: 16px; padding-right: 16px; }
  .auth-tabs button { font-size: 11.5px; padding-left: 2px; padding-right: 2px; letter-spacing: -.3px; }
  .auth-app { font-size: 11px; }
}


/* 多语言长文案：栅格列与键值对允许收缩，避免 1024 宽度横向溢出 */
.profile-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.profile-grid > * { min-width: 0; }
.kv { grid-template-columns: 84px minmax(0, 1fr); }
.kv > * { min-width: 0; overflow-wrap: anywhere; }
.sv-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
.sv-grid > * { min-width: 0; }
.sv-card { min-width: 0; }
.sv-card .table-wrap { max-width: 100%; }
@media (max-width: 1080px) {
  .sv-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .profile-grid { grid-template-columns: minmax(0, 1fr); }
}

/* 多语言长文案：影响因子页与工作日志筛选条在 1024 宽度下改为单列/换行 */
@media (max-width: 1100px) {
  .inf-grid { grid-template-columns: minmax(0, 1fr); }
  .inf-card { min-width: 0; }
}
