/* ============================================================
   维语站 RTL 样式（B 档 · 真 RTL 镜像）  PC 皮肤 pc/m2-1
   2026-09-25

   ⚠️ 设计原则：**所有规则都以 html[dir="rtl"] 开头**
   ⇒ cn / en 站的 <html> 没有 dir 属性，这些规则对它们完全不生效（零影响）。

   生效方式：app/ug/controller/Base.php 用输出缓冲给 ug 应用的
   <html> 注入 lang="ug" dir="rtl"；本文件仅在 $lang == 'ug' 时被引入。
   ============================================================ */

/* ---------- 1) 基准：方向 + 字体 ---------- */
html[dir="rtl"] body {
    direction: rtl;
    text-align: right;
    /* 维语（阿拉伯字母）字体栈：优先本机维吾尔字体，其次阿拉伯字体，最后系统兜底 */
    font-family: "UKIJ Tuz Tom", "UKIJ Ekran", "Noto Naskh Arabic", "Scheherazade New",
                 "Traditional Arabic", Tahoma, "Microsoft Uighur", Arial, sans-serif;
    unicode-bidi: embed;
}

/* ---------- 2) 浮动 / 文本对齐工具类反转 ---------- */
html[dir="rtl"] .pull-left,
html[dir="rtl"] .float-left,
html[dir="rtl"] .text-left { float: right !important; text-align: right !important; }

html[dir="rtl"] .pull-right,
html[dir="rtl"] .float-right,
html[dir="rtl"] .text-right { float: left !important; text-align: left !important; }

/* ---------- 3) Bootstrap 方向间距类反转（ml↔mr / pl↔pr） ---------- */
html[dir="rtl"] .ml-0 { margin-right: 0 !important; margin-left: 0 !important; }
html[dir="rtl"] .ml-1 { margin-right: .25rem !important; margin-left: 0 !important; }
html[dir="rtl"] .ml-2 { margin-right: .5rem !important;  margin-left: 0 !important; }
html[dir="rtl"] .ml-3 { margin-right: 1rem !important;   margin-left: 0 !important; }
html[dir="rtl"] .ml-4 { margin-right: 1.5rem !important; margin-left: 0 !important; }
html[dir="rtl"] .ml-5 { margin-right: 3rem !important;   margin-left: 0 !important; }
html[dir="rtl"] .ml-auto { margin-right: auto !important; margin-left: 0 !important; }
html[dir="rtl"] .mr-0 { margin-left: 0 !important; margin-right: 0 !important; }
html[dir="rtl"] .mr-1 { margin-left: .25rem !important; margin-right: 0 !important; }
html[dir="rtl"] .mr-2 { margin-left: .5rem !important;  margin-right: 0 !important; }
html[dir="rtl"] .mr-3 { margin-left: 1rem !important;   margin-right: 0 !important; }
html[dir="rtl"] .mr-4 { margin-left: 1.5rem !important; margin-right: 0 !important; }
html[dir="rtl"] .mr-5 { margin-left: 3rem !important;   margin-right: 0 !important; }
html[dir="rtl"] .mr-auto { margin-left: auto !important; margin-right: 0 !important; }
html[dir="rtl"] .pl-0 { padding-right: 0 !important; padding-left: 0 !important; }
html[dir="rtl"] .pl-1 { padding-right: .25rem !important; padding-left: 0 !important; }
html[dir="rtl"] .pl-2 { padding-right: .5rem !important;  padding-left: 0 !important; }
html[dir="rtl"] .pl-3 { padding-right: 1rem !important;   padding-left: 0 !important; }
html[dir="rtl"] .pl-4 { padding-right: 1.5rem !important; padding-left: 0 !important; }
html[dir="rtl"] .pl-5 { padding-right: 3rem !important;   padding-left: 0 !important; }
html[dir="rtl"] .pr-0 { padding-left: 0 !important; padding-right: 0 !important; }
html[dir="rtl"] .pr-1 { padding-left: .25rem !important; padding-right: 0 !important; }
html[dir="rtl"] .pr-2 { padding-left: .5rem !important;  padding-right: 0 !important; }
html[dir="rtl"] .pr-3 { padding-left: 1rem !important;   padding-right: 0 !important; }
html[dir="rtl"] .pr-4 { padding-left: 1.5rem !important; padding-right: 0 !important; }
html[dir="rtl"] .pr-5 { padding-left: 3rem !important;   padding-right: 0 !important; }

/* ---------- 4) 下拉菜单 / 列表：对齐到右侧 ---------- */
html[dir="rtl"] .dropdown-menu { text-align: right; right: 0; left: auto; }
html[dir="rtl"] .dropdown-item { text-align: right; }
html[dir="rtl"] .list-unstyled,
html[dir="rtl"] ul,
html[dir="rtl"] ol { padding-right: 0; }

/* ---------- 5) 导航 / 头部 / 面包屑 ---------- */
html[dir="rtl"] .breadcrumb { text-align: right; }
html[dir="rtl"] .navbar-nav { text-align: right; }
html[dir="rtl"] .navbar-brand { margin-right: 0; margin-left: 1rem; }

/* ---------- 6) 表单：标签右对齐、输入框右起 ---------- */
html[dir="rtl"] label { text-align: right; }
html[dir="rtl"] input[type="text"],
html[dir="rtl"] input[type="search"],
html[dir="rtl"] input[type="password"],
html[dir="rtl"] input[type="email"],
html[dir="rtl"] textarea,
html[dir="rtl"] select { direction: rtl; text-align: right; }
/* 纯数字/电话/邮箱类输入保持 LTR，避免数字被倒着显示 */
html[dir="rtl"] input[type="tel"],
html[dir="rtl"] input[type="number"],
html[dir="rtl"] input[type="email"],
html[dir="rtl"] input[type="url"],
html[dir="rtl"] input[type="date"] { direction: ltr; text-align: right; }

/* ---------- 7) 数字 / 金额 / 代码：保持 LTR（RTL 里最容易被读错的地方） ---------- */
html[dir="rtl"] .price,
html[dir="rtl"] .num,
html[dir="rtl"] .amount,
html[dir="rtl"] code,
html[dir="rtl"] pre,
html[dir="rtl"] .phone,
html[dir="rtl"] .tel { direction: ltr; unicode-bidi: embed; text-align: right; }

/* ---------- 8) 方向性图标镜像（箭头/返回/下一页） ---------- */
html[dir="rtl"] .fa-arrow-right,
html[dir="rtl"] .fa-chevron-right,
html[dir="rtl"] .fa-angle-right,
html[dir="rtl"] .fa-long-arrow-alt-right,
html[dir="rtl"] .fa-caret-right,
html[dir="rtl"] .fa-arrow-left,
html[dir="rtl"] .fa-chevron-left,
html[dir="rtl"] .fa-angle-left,
html[dir="rtl"] .fa-long-arrow-alt-left,
html[dir="rtl"] .fa-caret-left { transform: scaleX(-1); display: inline-block; }

/* ---------- 9) 表格 / 分页 / 卡片 ---------- */
html[dir="rtl"] th, html[dir="rtl"] td { text-align: right; }
html[dir="rtl"] .pagination { padding-right: 0; }
html[dir="rtl"] .media-body { text-align: right; }

/* ---------- 10) 滚动条（Chrome/Edge 只影响视觉方向感） ---------- */
html[dir="rtl"] * { scrollbar-width: thin; }

/* ---------- 说明 ----------
   本文件是 B 档的「全局镜像层」，覆盖到即可生效；
   个别页面若仍有错位，按「皮肤逐页补签名」的方式在下方追加（带日期注释）。
   追加规则同样必须以 html[dir="rtl"] 开头，确保 cn/en 零影响。
   ---------- */
