/**
 * Agent 维文字体（对齐 d:\AI模型\sinak\font.css 识别栈）
 * 可用文件：/agent/font/ALKATIPBasmaTom.ttf（映射 alkatip tor / basma tom / ukij）
 * 铁律：html[dir] 永远 ltr；仅维语文案用 alkatip 字体
 */

@font-face {
  font-family: 'alkatip basma';
  font-style: normal;
  font-weight: normal;
  font-display: swap;
  src: url('/agent/font/ALKATIPBasmaTom.ttf') format('truetype');
}

@font-face {
  font-family: 'alkatip basma tom';
  font-style: normal;
  font-weight: normal;
  font-display: swap;
  src: url('/agent/font/ALKATIPBasmaTom.ttf') format('truetype');
}

@font-face {
  font-family: 'Alkatip tor';
  font-style: normal;
  font-weight: normal;
  font-display: swap;
  src: url('/agent/font/ALKATIPBasmaTom.ttf') format('truetype');
}

@font-face {
  font-family: 'alkatip tor';
  font-style: normal;
  font-weight: normal;
  font-display: swap;
  src: url('/agent/font/ALKATIPBasmaTom.ttf') format('truetype');
}

@font-face {
  font-family: 'ukij tuz tom';
  font-style: normal;
  font-weight: normal;
  font-display: swap;
  src: url('/agent/font/ALKATIPBasmaTom.ttf') format('truetype');
}

/* sinak 同源：维文识别主栈 */
:root {
  --ug-font: 'alkatip tor', 'ukij tuz tom', 'alkatip basma tom', 'alkatip basma', serif;
}

html,
html[lang='ug'],
html[lang='zh-CN'],
body,
.agent-shell,
.agent-main,
.main-header,
.header-end,
.lang-switch {
  direction: ltr !important;
}

/* 中文模式下「ئۇيغۇرچە」按钮也必须用维文字体 */
.lang-btn[data-lang='ug'],
[data-i18n='langUg'] {
  direction: ltr !important;
  unicode-bidi: isolate;
  font-family: var(--ug-font) !important;
}

.lang-btn[data-lang='zh'] {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
}

/* sinak 同源 .uy */
.uy,
body.lang-ug .uy {
  direction: rtl;
  font-family: var(--ug-font) !important;
}

body.lang-ug {
  direction: ltr !important;
  font-family: var(--ug-font) !important;
}

body.lang-ug [data-i18n]:not([data-i18n='langZh']),
body.lang-ug [data-i18n-placeholder],
body.lang-ug [data-i18n-title],
body.lang-ug [data-i18n-aria],
body.lang-ug .rail-label,
body.lang-ug .session-item,
body.lang-ug .session-row,
body.lang-ug .session-menu,
body.lang-ug .session-menu-item,
body.lang-ug .mid-new-btn,
body.lang-ug .mid-search,
body.lang-ug .chat-msg-text,
body.lang-ug .chat-input,
body.lang-ug .panel-card-head,
body.lang-ug .main-title,
body.lang-ug .status-pill,
body.lang-ug .top-tab,
body.lang-ug .account-chip,
body.lang-ug .account-pop,
body.lang-ug .account-pop-row,
body.lang-ug .account-pop-plan,
body.lang-ug .account-pop-token-title,
body.lang-ug .account-pop-token-note,
body.lang-ug .account-pop-link,
body.lang-ug .chip-label,
body.lang-ug .settings-modal,
body.lang-ug .settings-dialog,
body.lang-ug .settings-nav-item,
body.lang-ug .settings-k,
body.lang-ug .settings-v,
body.lang-ug .settings-muted,
body.lang-ug .lab-title,
body.lang-ug .lab-sub,
body.lang-ug .lab-card-title,
body.lang-ug .lab-card-desc,
body.lang-ug .connect-title,
body.lang-ug .connect-sub,
body.lang-ug .connect-cat,
body.lang-ug .connect-name,
body.lang-ug .connect-desc,
body.lang-ug .connect-btn,
body.lang-ug .studio-room,
body.lang-ug .cx-toast,
body.lang-ug .cx-pop,
body.lang-ug .cx-pop *,
body.lang-ug .composer-mode,
body.lang-ug .composer-mode .mode-route,
body.lang-ug .cx-route-block,
body.lang-ug .cx-route-title,
body.lang-ug .cx-route-name,
body.lang-ug .cx-route-desc,
body.lang-ug .cx-route-hint,
body.lang-ug .cx-item,
body.lang-ug .cx-label,
body.lang-ug .cx-meta,
body.lang-ug .cx-search,
body.lang-ug .cx-toggle-row,
body.lang-ug .cx-footer-btn,
body.lang-ug .cx-foot-model,
body.lang-ug .cx-foot-model span {
  font-family: var(--ug-font) !important;
}

body.lang-ug .cx-item .cx-badge,
body.lang-ug .cx-route-item .cx-check,
body.lang-ug .composer-plus,
body.lang-ug .composer-mic,
body.lang-ug .btn-send,
body.lang-ug .session-more {
  font-family: inherit !important;
}

body.lang-ug .lang-btn[data-lang='zh'] {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
}

/*
 * 三栏骨架永远 LTR；维语正文单独 RTL + 右对齐（从右写）
 * html[dir] 仍 ltr，只让 .ug-text 容器内文字靠右
 */
body.lang-ug .agent-shell {
  direction: ltr !important;
}

body.lang-ug .agent-rail,
body.lang-ug .agent-mid,
body.lang-ug .agent-main,
body.lang-ug .main-header,
body.lang-ug .header-end,
body.lang-ug .lang-switch,
body.lang-ug .lang-btn,
body.lang-ug .top-tabs,
body.lang-ug .chat-footer,
body.lang-ug .composer-shell,
body.lang-ug .session-list,
body.lang-ug .mid-search-wrap {
  direction: ltr !important;
}

body.lang-ug .ug-text,
body.lang-ug .session-item,
body.lang-ug .session-menu-item,
body.lang-ug .mid-new-btn,
body.lang-ug .mid-search,
body.lang-ug .chat-msg-text,
body.lang-ug .chat-input,
body.lang-ug #agentChatInput,
body.lang-ug .panel-card-head,
body.lang-ug .main-title,
body.lang-ug .rail-label,
body.lang-ug .connect-title,
body.lang-ug .connect-sub,
body.lang-ug .connect-name,
body.lang-ug .connect-desc,
body.lang-ug .lab-title,
body.lang-ug .lab-sub,
body.lang-ug .lab-card-title,
body.lang-ug .lab-card-desc,
body.lang-ug .settings-v,
body.lang-ug .settings-muted,
body.lang-ug .cx-toast,
body.lang-ug .top-tab,
body.lang-ug .cx-route-title,
body.lang-ug .cx-route-name,
body.lang-ug .cx-route-desc,
body.lang-ug .cx-route-hint,
body.lang-ug .cx-item,
body.lang-ug .cx-toggle-row,
body.lang-ug .cx-search,
body.lang-ug .cx-footer-btn {
  direction: rtl !important;
  text-align: right !important;
  unicode-bidi: plaintext;
}

body.lang-ug .status-pill,
body.lang-ug .lang-btn[data-lang='zh'],
body.lang-ug .lang-btn[data-lang='ug'] {
  direction: ltr !important;
  text-align: center !important;
  unicode-bidi: isolate;
}

body.lang-ug .chat-input,
body.lang-ug .mid-search,
body.lang-ug textarea,
body.lang-ug input[type='text'],
body.lang-ug input[type='search'],
.chat-input.uy,
#agentChatInput {
  font-family: var(--ug-font) !important;
}

body.lang-ug .rail-item .rail-label,
body.lang-ug .rail-link .rail-label {
  font-size: 11px;
  letter-spacing: 0;
  line-height: 1.25;
}

body.lang-ug .session-item,
body.lang-ug .session-menu-item,
body.lang-ug .mid-new-btn,
body.lang-ug .chat-msg-text,
body.lang-ug .connect-desc,
body.lang-ug .lab-card-desc {
  font-size: 15px;
  letter-spacing: 0;
  line-height: 1.45;
}
