@charset "UTF-8";
/* ============================================================================
   lang-layout.css —— 蒙文 / 藏文 / 维文 / 韩文 / 日文的字体栈、书写方向与竖排布局
   ----------------------------------------------------------------------------
   由 index.html 里 <link id="langcss"> 以静态 <link> 引入,刻意不用 styles.scss
   @import:构建产物里全局 CSS 会被塞进 styles-es2015.js 运行时注入 <head>,
   注入节点在树序上位于 body 里的 link 之前。插在 #custoncss 之后 = 全站最后一个
   样式表,同优先级下必胜,不依赖构建配置。

   三个属性全部标在 <html> 上,由 index.html 的内联引导脚本 + app/class/langlayout.ts
   共同维护(两处逻辑刻意重复,内联脚本没法 import TS,改一处必须同步另一处):

     dir="rtl|ltr"            书写方向(只有 ug-CN 是 rtl)
     data-script="mong|tibt|arab|hang|japn|latn"   决定字体栈
     data-vscope="off|content|wide"      传统蒙文竖排范围(只有 mong 有意义)

   ★ 本文件的选择器一律带 html[dir="rtl"] / html[data-script="…"] 前缀。
     皮肤文件(styles.op-skin.css)是通过 body 里的 <link id="custoncss"> 加载的,
     文档序比本文件靠前但因为带前缀我们的优先级更高,不需要 !important 堆叠;
     但原规则带 !important 的(Unify g-* / Bootstrap 功能类)覆盖也必须带,
     否则同等重要级下比的是优先级 —— 前缀已经够了,加 !important 是为了防止
     将来有别处的 !important 反过来压我们。
   ============================================================================ */

/* ============================================================================
   一、兜底字体(@font-face + unicode-range)
   ----------------------------------------------------------------------------
   ★ 为什么必须用 unicode-range,而不是"把系统字体名字排进 font-family 列表":

     字体回退是逐字形按列表顺序走的。如果写成
       font-family: "Mongolian Baiti", "Microsoft YaHei", sans-serif;
    那么 Mongolian Baiti 会连同它自带的拉丁/数字字形一起接管整串文本 ——
      "Mongolian 1234567890" 的英文和数字会变成蒙文字体的拉丁字形,
      与页面其它地方的字重、字宽、基线全部对不上。

     unicode-range 把这一族字体在**码位层面**钉死:只有落在范围内的字符才会
     用它,其余字符直接走到列表下一个族。与列表顺序完全无关。

   local() 排第一:本机装了 Windows 自带字体就用本地的(零下载);
   没装才去取同目录的 Noto woff2。unicode-range 同样约束下载时机 ——
   页面上不出现对应文字就永远不请求这些文件。

   ★ 三个族都带 size-adjust,这是"蒙/藏文字看着比中文小一圈"的正解。
     size-adjust 按百分比缩放**本族字形的轮廓**,只影响命中这一族的字符 ——
     拉丁/数字/中文走的还是下一个族,字号、行高、版式一点不动。用 font-size
     去补救做不到这一点(那会把整行都放大)。

     取值是量出来的,不是拍的:同一字号下比对本族与中文的墨迹高度
     (canvas measureText 的 actualBoundingBoxAscent+Descent),
     藏文 100% 时明显矮于中文,130%~145% 之间与中文持平,取 135%。
     蒙文的"小"另有一半原因在横排(见第四节),这里先补字号那一半。

     ★ size-adjust 只在 Chrome 92+ / Firefox 92+ / Safari 17+ 生效,
       老浏览器静默忽略 —— 忽略的后果就是回到现在的样子,不会更坏。
   ============================================================================ */

@font-face {
  font-family: "OPAC Mongolian";
  src: local("Mongolian Baiti"), local("MongolianBaiti"),
       url("../fonts/noto/NotoSansMongolian-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  size-adjust: 130%;
  /* 传统蒙文 + 蒙文补充(U+11660-1167F) + 零宽连接符/非连接符 */
  unicode-range: U+1800-18AF, U+11660-1167F, U+200C-200D;
}

@font-face {
  font-family: "OPAC Tibetan";
  src: local("Microsoft Himalaya"), local("MicrosoftHimalaya"),
       url("../fonts/noto/NotoSerifTibetan-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  size-adjust: 135%;
  unicode-range: U+0F00-0FFF, U+200C-200D;
}

@font-face {
  font-family: "OPAC Arabic";
  src: local("Microsoft Uighur"), local("Microsoft Uighur Regular"),
       url("../fonts/noto/NotoNaskhArabic-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  size-adjust: 115%;
  /* 阿拉伯基本区 / 补充区 / 扩展-A / 呈现形式 A+B / 零宽控制符 */
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF,
                 U+FB50-FDFF, U+FE70-FEFF, U+200C-200E;
}

/* ---- 韩文 / 日文:只有 local(),不随包分发字体文件 --------------------------
   CJK 字体的完整子集动辄 4–8 MB(蒙/藏/维那三份加起来才 1 MB),而这两套字体的
   系统覆盖率极高 —— Windows 自带 Malgun Gothic / Yu Gothic / Meiryo,
   macOS 自带 Apple SD Gothic Neo / Hiragino,Android 与主流 Linux 桌面自带 Noto CJK。
   所以这两档不下载任何文件,只用 local() 指名;本地一个都没有时整条规则失效,
   自动沿字体栈落到 "Microsoft Yahei"(谚文仍能显示,只是字形次之,不会变成豆腐块)。

   ★ 两档都不加 size-adjust:谚文与假名本来就是满 em 设计,不存在蒙/藏那种"天生小一圈"。

   ★ 仍然走 @font-face + unicode-range,而不是把系统字体名直接排进 font-family 列表 ——
     理由与上面三条完全一样:列表写法会让该字体的拉丁/数字字形一并接管整串文本,
     英文字重、字宽、基线就和其它语言对不上了。走 unicode-range 则拉丁/数字继续由
     "Microsoft Yahei" 渲染,逐字形隔离,与列表顺序无关。
   ------------------------------------------------------------------------- */

@font-face {
  font-family: "OPAC Korean";
  src: local("Malgun Gothic"), local("MalgunGothic"),
       local("Apple SD Gothic Neo"), local("NanumGothic"), local("Noto Sans KR");
  font-weight: 400;
  font-style: normal;
  /* 谚文字母 / 兼容字母 / 扩展-A / 谚文音节 / 扩展-B(古谚文) */
  unicode-range: U+1100-11FF, U+3130-318F, U+A960-A97F,
                 U+AC00-D7AF, U+D7B0-D7FF;
}

@font-face {
  font-family: "OPAC Japanese";
  src: local("Yu Gothic"), local("YuGothic"), local("Meiryo"),
       local("MS Gothic"), local("Hiragino Kaku Gothic ProN"), local("Noto Sans CJK JP");
  font-weight: 400;
  font-style: normal;
  /* 平假名 / 片假名 / 假名扩展 / 带圈假名 / 半角片假名 / 假名补充
     + CJK 符号与标点(U+3000-303F):日文的 、。 「」 字形与简中不同
       (简中的 。 在字身内居中,日文靠左下),不圈进来就会看着是中文标点。
     + CJK 统一汉字与扩展 A、兼容汉字:ja-JP 模式下出现的汉字就是日文汉字,
       必须走日文字体 —— 否则「直 / 骨 / 起」这类字会用中文字形渲染,
       日本读者一眼能看出。代价是未翻译的中文回落词条也用日文字形,这正是期望行为。 */
  unicode-range: U+3000-303F, U+3040-30FF, U+31F0-31FF, U+32D0-32FE,
                 U+3400-4DBF, U+4E00-9FFF, U+F900-FAFF, U+FF66-FF9F;
}

/* ============================================================================
   二、字体栈
   ----------------------------------------------------------------------------
   "OPAC xxx" 只认领自己的码位,中文与拉丁继续落到 "Microsoft Yahei"(与皮肤
   styles.op-skin.css 里 body 的字体栈逐字一致,保证中文观感零变化)。

   ★ 维文这一条必须让 "OPAC Arabic"(即 Microsoft Uighur)排在 Microsoft YaHei
     之前:新版 YaHei 自带少量阿拉伯字形,一旦让 YaHei 先命中就会用很糟糕的
     阿拉伯字形渲染维吾尔文。
   ============================================================================ */

html[data-script="mong"] body {
  font-family: "OPAC Mongolian", "Microsoft Yahei", "microso", sans-serif;
}

html[data-script="tibt"] body {
  font-family: "OPAC Tibetan", "Microsoft Yahei", "microso", sans-serif;
}

html[data-script="arab"] body {
  font-family: "OPAC Arabic", "Microsoft Yahei", "microso", sans-serif;
}

/* 韩文/日文是横排 LTR,不需要任何书写方向或竖排处理,只是换字体 ——
   所以这两档只在字体栈和上面的 @font-face 里出现,第三节(RTL)与第四节(竖排)
   的规则一条都不用为它们增加。 */
html[data-script="hang"] body {
  font-family: "OPAC Korean", "Microsoft Yahei", "microso", sans-serif;
}

html[data-script="japn"] body {
  font-family: "OPAC Japanese", "Microsoft Yahei", "microso", sans-serif;
}

/* ============================================================================
   三、维文 RTL 镜像(html[dir="rtl"])
   ----------------------------------------------------------------------------
   用原生 dir 属性而非自定义 class:它会驱动整份文档的 bidi 算法、让 text-align
   的初始值 start 自动解析成右边、让 flexbox 的 row 主轴自动反向(顶栏/导航免费
   镜像)、让垂直滚动条移到左侧。

   下面只处理**物理方向的工具类与组件级规则** —— 这是框架级镜像,不是把全站
   4000+ 处物理属性改写成逻辑属性。
   ============================================================================ */

/* ---- 3.1 Unify g-* 方向性工具类 -------------------------------------------
   换算基数 0.071428rem = 1px(即 1rem = 14px)。下列数值逐一从
   src/assets/css/unify-globals.css 抄出,未手算。
   皮肤 styles.op-skin.css 里有一份同值副本,同样被这里覆盖。
   ------------------------------------------------------------------------- */

/* margin-right → margin-left */
html[dir="rtl"] .g-mr-0        { margin-right: 0 !important;         margin-left: 0 !important; }
html[dir="rtl"] .g-mr-2        { margin-right: 0 !important;         margin-left: 0.14286rem !important; }
html[dir="rtl"] .g-mr-3        { margin-right: 0 !important;         margin-left: 0.21429rem !important; }
html[dir="rtl"] .g-mr-5        { margin-right: 0 !important;         margin-left: 0.35714rem !important; }
html[dir="rtl"] .g-mr-8        { margin-right: 0 !important;         margin-left: 0.57143rem !important; }
html[dir="rtl"] .g-mr-10       { margin-right: 0 !important;         margin-left: 0.71429rem !important; }
html[dir="rtl"] .g-mr-15       { margin-right: 0 !important;         margin-left: 1.07143rem !important; }
html[dir="rtl"] .g-mr-20       { margin-right: 0 !important;         margin-left: 1.42857rem !important; }
html[dir="rtl"] .g-mr-25       { margin-right: 0 !important;         margin-left: 1.78571rem !important; }
html[dir="rtl"] .g-mr-30       { margin-right: 0 !important;         margin-left: 2.14286rem !important; }
html[dir="rtl"] .g-mr-40       { margin-right: 0 !important;         margin-left: 2.85714rem !important; }
html[dir="rtl"] .g-mr-60       { margin-right: 0 !important;         margin-left: 4.28571rem !important; }

/* margin-left → margin-right(负值档连符号一起换边) */
html[dir="rtl"] .g-ml-0        { margin-left: 0 !important;          margin-right: 0 !important; }
html[dir="rtl"] .g-ml-2        { margin-left: 0 !important;          margin-right: 0.14286rem !important; }
html[dir="rtl"] .g-ml-3        { margin-left: 0 !important;          margin-right: 0.21429rem !important; }
html[dir="rtl"] .g-ml-5        { margin-left: 0 !important;          margin-right: 0.35714rem !important; }
html[dir="rtl"] .g-ml-10       { margin-left: 0 !important;          margin-right: 0.71429rem !important; }
html[dir="rtl"] .g-ml-15       { margin-left: 0 !important;          margin-right: 1.07143rem !important; }
html[dir="rtl"] .g-ml-20       { margin-left: 0 !important;          margin-right: 1.42857rem !important; }
html[dir="rtl"] .g-ml-30       { margin-left: 0 !important;          margin-right: 2.14286rem !important; }
html[dir="rtl"] .g-ml-minus-1  { margin-left: 0 !important;          margin-right: -0.07143rem !important; }
html[dir="rtl"] .g-ml-minus-20 { margin-left: 0 !important;          margin-right: -1.42857rem !important; }
html[dir="rtl"] .g-mr-minus-1  { margin-right: 0 !important;         margin-left: -0.07143rem !important; }

/* 带断点后缀的档位必须包进**同样的媒体查询**。
   媒体查询本身不加优先级(外层 + html[dir=rtl] 前缀照样更高),但如果外层无条件
   写,那些"仅 lg 以上生效"的间距会在小屏上也生效,凭空多出一份边距。 */
@media (min-width: 768px) {
  html[dir="rtl"] .g-pl-40--md { padding-right: 2.85714rem !important; padding-left: 0 !important; }
  html[dir="rtl"] .g-pr-40--md { padding-left: 2.85714rem !important;  padding-right: 0 !important; }
}
@media (min-width: 992px) {
  html[dir="rtl"] .g-mr-15--lg { margin-right: 0 !important; margin-left: 1.07143rem !important; }
}
@media (min-width: 1200px) {
  html[dir="rtl"] .g-mr-40--xl { margin-right: 0 !important; margin-left: 2.85714rem !important; }
}

/* padding-right → padding-left */
html[dir="rtl"] .g-pr-0        { padding-right: 0 !important;        padding-left: 0 !important; }
html[dir="rtl"] .g-pr-5        { padding-right: 0 !important;        padding-left: 0.35714rem !important; }
html[dir="rtl"] .g-pr-7        { padding-right: 0 !important;        padding-left: 0.5rem !important; }
html[dir="rtl"] .g-pr-10       { padding-right: 0 !important;        padding-left: 0.71429rem !important; }
html[dir="rtl"] .g-pr-15       { padding-right: 0 !important;        padding-left: 1.07143rem !important; }
html[dir="rtl"] .g-pr-30       { padding-right: 0 !important;        padding-left: 2.14286rem !important; }
html[dir="rtl"] .g-pr-40       { padding-right: 0 !important;        padding-left: 2.85714rem !important; }

/* padding-left → padding-right */
html[dir="rtl"] .g-pl-0        { padding-left: 0 !important;         padding-right: 0 !important; }
html[dir="rtl"] .g-pl-5        { padding-left: 0 !important;         padding-right: 0.35714rem !important; }
html[dir="rtl"] .g-pl-10       { padding-left: 0 !important;         padding-right: 0.71429rem !important; }
html[dir="rtl"] .g-pl-15       { padding-left: 0 !important;         padding-right: 1.07143rem !important; }
html[dir="rtl"] .g-pl-25       { padding-left: 0 !important;         padding-right: 1.78571rem !important; }
html[dir="rtl"] .g-pl-30       { padding-left: 0 !important;         padding-right: 2.14286rem !important; }
html[dir="rtl"] .g-pl-60       { padding-left: 0 !important;         padding-right: 4.28571rem !important; }

/* left / right 定位 */
html[dir="rtl"] .g-left-0      { left: auto !important;  right: 0 !important; }
html[dir="rtl"] .g-left-10     { left: auto !important;  right: 0.71429rem !important; }
html[dir="rtl"] .g-left-20     { left: auto !important;  right: 1.42857rem !important; }
html[dir="rtl"] .g-left-30     { left: auto !important;  right: 2.14286rem !important; }
html[dir="rtl"] .g-right-0     { right: auto !important; left: 0 !important; }
html[dir="rtl"] .g-right-30    { right: auto !important; left: 2.14286rem !important; }

/* 圆角:右圆角组 ↔ 左圆角组。原规则只声明了一侧,另一侧由别处或默认值 0 决定,
   镜像时显式把对侧清零,避免无规则继承到错误的一边。 */
html[dir="rtl"] .g-rounded-right-0 {
  border-top-left-radius: 0 !important;    border-bottom-left-radius: 0 !important;
  border-top-right-radius: 0 !important;  border-bottom-right-radius: 0 !important;
}
html[dir="rtl"] .g-rounded-right-5 {
  border-top-left-radius: 5px !important;    border-bottom-left-radius: 5px !important;
  border-top-right-radius: 0 !important;    border-bottom-right-radius: 0 !important;
}
html[dir="rtl"] .g-rounded-left-0 {
  border-top-right-radius: 0 !important;   border-bottom-right-radius: 0 !important;
  border-top-left-radius: 0 !important;    border-bottom-left-radius: 0 !important;
}
html[dir="rtl"] .g-rounded-left-5 {
  border-top-right-radius: 5px !important;   border-bottom-right-radius: 5px !important;
  border-top-left-radius: 0 !important;      border-bottom-left-radius: 0 !important;
}

/* ---- 3.2 Bootstrap 4 功能类 ----------------------------------------------
   数值取自 src/assets/vendor/bootstrap/bootstrap.css(v4.5.2):间距档位是
   0 / .25 / .5 / 1 / 1.5 / 3 rem。
   ------------------------------------------------------------------------- */

html[dir="rtl"] .mr-0 { margin-right: 0 !important;      margin-left: 0 !important; }
html[dir="rtl"] .mr-1 { margin-right: 0 !important;      margin-left: 0.25rem !important; }
html[dir="rtl"] .mr-2 { margin-right: 0 !important;      margin-left: 0.5rem !important; }
html[dir="rtl"] .mr-3 { margin-right: 0 !important;      margin-left: 1rem !important; }
html[dir="rtl"] .mr-4 { margin-right: 0 !important;      margin-left: 1.5rem !important; }
html[dir="rtl"] .mr-5 { margin-right: 0 !important;      margin-left: 3rem !important; }

html[dir="rtl"] .ml-0 { margin-left: 0 !important;       margin-right: 0 !important; }
html[dir="rtl"] .ml-1 { margin-left: 0 !important;       margin-right: 0.25rem !important; }
html[dir="rtl"] .ml-2 { margin-left: 0 !important;       margin-right: 0.5rem !important; }
html[dir="rtl"] .ml-3 { margin-left: 0 !important;       margin-right: 1rem !important; }
html[dir="rtl"] .ml-4 { margin-left: 0 !important;       margin-right: 1.5rem !important; }
html[dir="rtl"] .ml-5 { margin-left: 0 !important;       margin-right: 3rem !important; }

html[dir="rtl"] .pl-0 { padding-left: 0 !important;      padding-right: 0 !important; }
html[dir="rtl"] .pl-1 { padding-left: 0 !important;      padding-right: 0.25rem !important; }
html[dir="rtl"] .pl-2 { padding-left: 0 !important;      padding-right: 0.5rem !important; }
html[dir="rtl"] .pl-3 { padding-left: 0 !important;      padding-right: 1rem !important; }
html[dir="rtl"] .pl-4 { padding-left: 0 !important;      padding-right: 1.5rem !important; }
html[dir="rtl"] .pl-5 { padding-left: 0 !important;      padding-right: 3rem !important; }

html[dir="rtl"] .pr-0 { padding-right: 0 !important;     padding-left: 0 !important; }
html[dir="rtl"] .pr-1 { padding-right: 0 !important;     padding-left: 0.25rem !important; }
html[dir="rtl"] .pr-2 { padding-right: 0 !important;     padding-left: 0.5rem !important; }
html[dir="rtl"] .pr-3 { padding-right: 0 !important;     padding-left: 1rem !important; }
html[dir="rtl"] .pr-4 { padding-right: 0 !important;     padding-left: 1.5rem !important; }
html[dir="rtl"] .pr-5 { padding-right: 0 !important;     padding-left: 3rem !important; }

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

/* 浮动。.pull-right/.pull-left 是 BS3/FA 4.7 遗留下来的老类(font-awesome.min.css
   里定义,无 !important),模板里用了 49 处,与 BS4 的 .float-* 并存。 */
html[dir="rtl"] .float-right { float: left !important; }
html[dir="rtl"] .float-left  { float: right !important; }
html[dir="rtl"] .pull-right  { float: left !important; }
html[dir="rtl"] .pull-left   { float: right !important; }

/* 文本对齐:把 .text-right 理解成"推到行尾"而不是"物理右侧",镜像后才符合版面意图 */
html[dir="rtl"] .text-right { text-align: left !important; }
html[dir="rtl"] .text-left  { text-align: right !important; }

html[dir="rtl"] .rounded-right {
  border-top-right-radius: 0 !important;    border-bottom-right-radius: 0 !important;
  border-top-left-radius: 0.25rem !important;  border-bottom-left-radius: 0.25rem !important;
}
html[dir="rtl"] .rounded-left {
  border-top-left-radius: 0 !important;     border-bottom-left-radius: 0 !important;
  border-top-right-radius: 0.25rem !important;  border-bottom-right-radius: 0.25rem !important;
}

html[dir="rtl"] .border-right   { border-right: 0 !important;   border-left: 1px solid #dee2e6 !important; }
html[dir="rtl"] .border-left    { border-left: 0 !important;    border-right: 1px solid #dee2e6 !important; }
html[dir="rtl"] .border-right-0 { border-right: 0 !important;   border-left: 0 !important; }
html[dir="rtl"] .border-left-0  { border-left: 0 !important;    border-right: 0 !important; }

/* ---- 3.3 组件级 ----------------------------------------------------------
   这几条不需要 !important(原规则本来就没有),靠前缀的优先级取胜。
   顺序要紧:.dropdown-menu 基础规则必须排在 -left/-right 变体之前 ——
   两者优先级同为 (0,2,1),靠文档序分胜负。
   ------------------------------------------------------------------------- */

html[dir="rtl"] .dropdown-menu {
  left: auto;
  right: 0;
  float: right;
  text-align: right;
}
html[dir="rtl"] .dropdown-menu-left  { right: auto; left: 0; }
html[dir="rtl"] .dropdown-menu-right { left: auto; right: 0; }

/* 下拉箭头 ::after 有一个 margin-left 把箭头推离文字,镜像到右侧 */
html[dir="rtl"] .dropdown-toggle::after { margin-left: 0; margin-right: 0.255em; }

/* Bootstrap input-group:前后缀的 -1px 负边距与圆角链 */
html[dir="rtl"] .input-group > .form-control:not(:last-child),
html[dir="rtl"] .input-group > .custom-select:not(:last-child) {
  border-top-right-radius: 0.25rem;
  border-bottom-right-radius: 0.25rem;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
html[dir="rtl"] .input-group > .form-control:not(:first-child),
html[dir="rtl"] .input-group > .custom-select:not(:first-child) {
  border-top-left-radius: 0.25rem;
  border-bottom-left-radius: 0.25rem;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
html[dir="rtl"] .input-group-prepend { margin-right: 0; margin-left: -1px; }
html[dir="rtl"] .input-group-append  { margin-left: 0;  margin-right: -1px; }

/* 勾选框/单选框:BS 用 padding-left + 负 margin-left 把控件挪进留白 */
html[dir="rtl"] .form-check        { padding-left: 0; padding-right: 1.25rem; }
html[dir="rtl"] .form-check-input  { margin-left: 0;  margin-right: -1.25rem; }
html[dir="rtl"] .form-check-inline { padding-right: 0; margin-right: 0; margin-left: 0.75rem; }
html[dir="rtl"] .custom-control    { padding-left: 0; padding-right: 1.5rem; }
html[dir="rtl"] .custom-control-inline { margin-right: 0; margin-left: 1rem; }
html[dir="rtl"] .custom-control-input { left: auto; right: 0; }
html[dir="rtl"] .custom-control-label::before,
html[dir="rtl"] .custom-control-label::after { left: auto; right: -1.5rem; }
html[dir="rtl"] .custom-switch { padding-right: 2.25rem; }
html[dir="rtl"] .custom-switch .custom-control-label::before { right: -2.25rem; left: auto; }
html[dir="rtl"] .custom-switch .custom-control-label::after {
  right: calc(-2.25rem + 2px);
  left: auto;
}

/* ng-zorro 分页:prev/next 与相邻项的间距是物理方向 */
html[dir="rtl"] .ant-pagination-prev       { margin-right: 0; margin-left: 8px; }
html[dir="rtl"] .ant-pagination-total-text { margin-right: 0; margin-left: 8px; }
html[dir="rtl"] .ant-pagination-options    { margin-left: 0;  margin-right: 16px; }
html[dir="rtl"] .ant-pagination-item       { margin-right: 0; margin-left: 8px; }

/* 表格:dir=rtl 下 text-align 的初始值 start 已经解析成右对齐,这里只兜住皮肤里
   显式写死的左对齐(如 .u-basket__bar 之类),不碰 th 的居中默认。 */
html[dir="rtl"] table td[align="left"] { text-align: right; }

/* ---- 3.4 方向性图标 ------------------------------------------------------
   左右箭头、翻页箭头在 RTL 下必须水平翻转。FontAwesome 给 .fa 强制了
   display:inline-block,transform 能生效。
   ------------------------------------------------------------------------- */

html[dir="rtl"] .fa-arrow-left,
html[dir="rtl"] .fa-arrow-right,
html[dir="rtl"] .fa-arrow-circle-left,
html[dir="rtl"] .fa-arrow-circle-right,
html[dir="rtl"] .fa-arrow-circle-o-left,
html[dir="rtl"] .fa-arrow-circle-o-right,
html[dir="rtl"] .fa-angle-left,
html[dir="rtl"] .fa-angle-right,
html[dir="rtl"] .fa-angle-double-left,
html[dir="rtl"] .fa-angle-double-right,
html[dir="rtl"] .fa-chevron-left,
html[dir="rtl"] .fa-chevron-right,
html[dir="rtl"] .fa-chevron-circle-left,
html[dir="rtl"] .fa-chevron-circle-right,
html[dir="rtl"] .fa-caret-left,
html[dir="rtl"] .fa-caret-right,
html[dir="rtl"] .fa-long-arrow-left,
html[dir="rtl"] .fa-long-arrow-right,
html[dir="rtl"] .fa-hand-o-left,
html[dir="rtl"] .fa-hand-o-right,
html[dir="rtl"] .fa-step-backward,
html[dir="rtl"] .fa-step-forward,
html[dir="rtl"] .fa-caret-square-o-left,
html[dir="rtl"] .fa-caret-square-o-right {
  transform: scaleX(-1);
}

/* ============================================================================
   四、传统蒙文竖排(html[data-script="mong"][data-vscope="content"])
   ----------------------------------------------------------------------------
   配方只有两行,但两行都不能改:

     writing-mode: vertical-lr     列自左向右推进 —— 这正是传统蒙文的书写方向
     text-orientation: mixed       保持连写沿垂直轴连接

   ★ 千万不要改成 text-orientation: upright,那会拆掉蒙文的连写(词形变化依赖
     上下文的字形连接),渲染出一个个孤立的字形。
   ★ 也不要退到 rotate(-90deg) 那一套:横排容器整体旋转之后,长文本会溢出容器
     且无法正常换列,选中/滚动全都坏掉。已实测 Mongolian Baiti 在 vertical-lr 下
     能正确渲出立正连写的蒙文,不需要 font-feature-settings:"vert" 之类的手工开关。
   ============================================================================ */

html[data-script="mong"][data-vscope="content"] .goldspan,
html[data-script="mong"][data-vscope="content"] .periodremark,
html[data-script="mong"][data-vscope="content"] #bookslocal .tab-pane p,
html[data-script="mong"][data-vscope="content"] #bookslocal .tab-pane li,
/* 检索结果"列表方式"的题名(searchrequest.component.html:754)。这里是全站最
   主要的阅读面,而它**没有** .goldspan —— 只挂 .goldspan 白名单的话,蒙文书目
   题名会一直以"躺倒"的形态出现。配置 viewlist=1 时走的就是这一支。 */
html[data-script="mong"][data-vscope="content"] article h3 > a,
html[data-script="mong"][data-vscope="content"] article h3 > a > strong {
  writing-mode: vertical-lr;
  text-orientation: mixed;
}

/* 竖排的题名要限高,否则一个长题名会拉成一整列把行撑爆(竖排下 height 才是
   "每列多少字"),超出的列裁掉。2.6em ≈ 两列多一点,和列表行高匹配。 */
html[data-script="mong"][data-vscope="content"] article h3 > a {
  display: inline-block;
  max-height: 2.6em;
  overflow: hidden;
  line-height: 1.3;
}

/* ★ 必须同时解耦 .goldspan 的省略号实现,否则整段文字会被 white-space:nowrap
   压成一根无限长、不换列的竖线。竖排下"每列多少字"由 height 决定,不是 width。 */
html[data-script="mong"][data-vscope="content"] .goldspan {
  white-space: normal;    /* 覆盖 custom.css:53 的 nowrap,让长标题换列 */
  text-overflow: clip;    /* 竖排下省略号盒子失效,显式关掉 */
  max-height: 14em;
  overflow: hidden;
}

/* ---- 4.1 wide 档:调试探针,不是生产档位 ----------------------------------
   把 body 整体变成竖排会改变 inline 轴方向,而 Bootstrap 4 的网格、ng-zorro 的
   定位全建立在"inline 轴 = 横轴"上:.row 的 flex 主轴跟着转导致列不再并排、
   left:50%+translateX(-50%) 一类居中全部漂移、.dropdown-menu{left:0} 脱位、
   slick 轮播竖向堆叠、页面主滚动从纵向变横向。

   所以这一档只用来"看看哪些块本来就该竖",真要看效果时开:
     localStorage.setItem('verticalScope','wide') 然后刷新。
   下面前两类必须显式退回横排,否则表单没法填、图标会躺倒。
   ------------------------------------------------------------------------- */

html[data-script="mong"][data-vscope="wide"] body {
  writing-mode: vertical-lr;
  text-orientation: mixed;
}

/* 表单控件与非文本 UI 强制横排。
   这里不用 :is() —— browserslist 可能包含 IE11,:is() 无法 polyfill,
   整条规则会被浏览器静默丢弃。显式列举。 */
html[data-script="mong"][data-vscope="wide"] input,
html[data-script="mong"][data-vscope="wide"] textarea,
html[data-script="mong"][data-vscope="wide"] select,
html[data-script="mong"][data-vscope="wide"] button,
html[data-script="mong"][data-vscope="wide"] .btn,
html[data-script="mong"][data-vscope="wide"] .nav,
html[data-script="mong"][data-vscope="wide"] .navbar,
html[data-script="mong"][data-vscope="wide"] .ant-pagination,
html[data-script="mong"][data-vscope="wide"] .dropdown-menu,
html[data-script="mong"][data-vscope="wide"] .progress,
html[data-script="mong"][data-vscope="wide"] img,
html[data-script="mong"][data-vscope="wide"] svg,
html[data-script="mong"][data-vscope="wide"] canvas,
html[data-script="mong"][data-vscope="wide"] table {
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}

/* 图标字体:字形本身是为横排设计的,竖排下会躺倒 */
html[data-script="mong"][data-vscope="wide"] .fa,
html[data-script="mong"][data-vscope="wide"] .anticon,
html[data-script="mong"][data-vscope="wide"] .icon-hs,
html[data-script="mong"][data-vscope="wide"] .icon-line,
html[data-script="mong"][data-vscope="wide"] .icon-et,
html[data-script="mong"][data-vscope="wide"] [class^="icon-"],
html[data-script="mong"][data-vscope="wide"] [class*=" icon-"] {
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}
