/* 多语言公共样式：语言切换器、中文页的语言提示条、各语言字体、阿拉伯语从右到左。
   所有页面（中文原版 + /en/ 等外语目录）都引这一个文件，HTML 由 site-i18n/build.mjs 生成。 */

/* ---------- 语言切换器（导航栏右侧，和「立即下载」放在一起） ---------- */
.nav-end{justify-self:end; display:flex; align-items:center; gap:12px;}
.lang-sw{position:relative;}
.lang-sw summary{list-style:none; display:inline-flex; align-items:center; gap:6px; height:40px; padding:0 10px 0 9px; border:1px solid var(--line,#E7ECF3);
  border-radius:9px; background:#fff; color:var(--ink-2,#3A4A63); font-size:14px; font-weight:600; line-height:1; cursor:pointer; white-space:nowrap;
  -webkit-tap-highlight-color:transparent; user-select:none; -webkit-user-select:none;}
.lang-sw summary::-webkit-details-marker{display:none;}
.lang-sw summary::marker{content:"";}
.lang-sw summary::after{content:""; width:6px; height:6px; margin:0 2px 3px 3px; border-right:1.6px solid currentColor; border-bottom:1.6px solid currentColor; transform:rotate(45deg); opacity:.6;}
.lang-sw summary:hover, .lang-sw[open] summary{border-color:var(--ink,#0A1730); color:var(--ink,#0A1730);}
.lang-sw summary svg{flex:none; display:block;}
.lang-short{display:none;}
.lang-menu{position:absolute; top:calc(100% + 8px); right:0; z-index:80; width:max-content; max-width:calc(100vw - 32px); max-height:70vh; overflow:auto;
  display:grid; grid-template-columns:repeat(2, minmax(140px, 1fr)); gap:2px; padding:6px; background:#fff; border:1px solid var(--line,#E7ECF3);
  border-radius:12px; box-shadow:0 24px 50px -18px rgba(10,23,48,.35);}
.lang-menu a{display:block; padding:9px 12px; border-radius:8px; font-size:14.5px; font-weight:500; line-height:1.3; color:var(--ink-2,#3A4A63); white-space:nowrap; text-decoration:none;
  font-family:-apple-system,"Segoe UI",Roboto,"PingFang SC","Hiragino Sans","Apple SD Gothic Neo","Malgun Gothic","Microsoft YaHei","Thonburi","Leelawadee UI","Kohinoor Devanagari","Nirmala UI","Geeza Pro","Noto Sans",sans-serif;}
.lang-menu a:hover{background:var(--paper-2,#F6F8FB); color:var(--ink,#0A1730);}
.lang-menu a[aria-current]{color:var(--brand,#1E6FFF); font-weight:700; background:var(--brand-soft,#EAF1FF);}
/* 窄屏：切换器只显示地球 + 语言代码，菜单单列 */
@media (max-width:980px){
  .nav .nav-end{margin-left:auto;}
  .lang-cur{display:none;}
  .lang-short{display:inline;}
}
@media (max-width:600px){
  .lang-sw summary{height:38px; padding:0 8px; gap:5px;}
  .lang-menu{grid-template-columns:repeat(2, minmax(0, 1fr)); width:300px;}
  .lang-menu a{padding:9px 10px; font-size:14px;}
}
/* 外语页导航文字更长：链接间距收一点；窄一些的桌面宽度只显示语言代码 */
html:not(:lang(zh)) .nav-links{gap:28px;}
@media (max-width:1240px){ html:not(:lang(zh)) .nav-links{gap:20px;} html:not(:lang(zh)) .lang-cur{display:none;} html:not(:lang(zh)) .lang-short{display:inline;} }
/* 客服页没有导航栏：切换器浮在右上角 */
.nav-end.sw-float{position:absolute; top:max(14px, env(safe-area-inset-top)); right:14px; z-index:5;}

/* ---------- 中文页提示条：浏览器语言不是中文时出现 ---------- */
.lang-bar{position:relative; z-index:60; display:flex; align-items:center; justify-content:center; width:100%; align-self:stretch; padding:9px 48px; background:#0A1730; color:#fff;
  font:600 14px/1.5 -apple-system,"Segoe UI",Roboto,"Hiragino Sans","Apple SD Gothic Neo","Thonburi","Kohinoor Devanagari","Geeza Pro","Noto Sans",sans-serif; text-align:center;}
.lang-bar a{color:#fff; text-decoration:underline; text-underline-offset:3px;}
.lang-bar button{position:absolute; right:8px; top:50%; transform:translateY(-50%); width:36px; height:36px; border:0; background:none; color:#B4C2D8; font-size:22px; line-height:1; cursor:pointer;}
.lang-bar button:hover{color:#fff;}
.lang-bar[dir=rtl] button{right:auto; left:8px;}

/* ---------- 英文法律页：以中文版为准的说明 ---------- */
.doc-hero .lang-note{margin-top:8px; font-family:inherit; font-size:14px; color:var(--muted,#64748B);}
.doc-hero .lang-note a{color:var(--brand,#1E6FFF); text-decoration:underline;}

/* ---------- 各语言字体（原来的 --cjk 是给中文排的） ---------- */
:root:lang(en), :root:lang(es), :root:lang(pt), :root:lang(fr), :root:lang(de), :root:lang(it), :root:lang(tr), :root:lang(id), :root:lang(vi), :root:lang(ru){
  --cjk:-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,"PingFang SC","Microsoft YaHei","Noto Sans SC",sans-serif;}
:root:lang(ja){--cjk:-apple-system,"Hiragino Sans","Hiragino Kaku Gothic ProN","Yu Gothic UI","Yu Gothic","Meiryo","Noto Sans JP","Segoe UI","PingFang SC",sans-serif;}
:root:lang(ko){--cjk:-apple-system,"Apple SD Gothic Neo","Malgun Gothic","Noto Sans KR","Segoe UI","PingFang SC",sans-serif;}
:root:lang(th){--cjk:-apple-system,"Segoe UI","Thonburi","Leelawadee UI","Noto Sans Thai",Tahoma,"PingFang SC",sans-serif;}
:root:lang(hi){--cjk:-apple-system,"Segoe UI","Kohinoor Devanagari","Nirmala UI","Noto Sans Devanagari",Mangal,"PingFang SC",sans-serif;}
:root:lang(ar){--cjk:-apple-system,"Segoe UI","Geeza Pro","SF Arabic","Noto Sans Arabic",Tahoma,"PingFang SC",sans-serif;}
/* 下载页版本行原来用等宽字体，外语（尤其泰、印地、阿拉伯文）用等宽不好看 */
html:not(:lang(zh)) .dlrow .dmeta{font-family:var(--cjk);}
/* 标题：中文排版用的负字距、1.1 行高，对带上下标的文字（泰文、天城文、阿拉伯文、越南文）会挤压 / 裁切 */
html:not(:lang(zh)) h1, html:not(:lang(zh)) h2, html:not(:lang(zh)) h3{overflow-wrap:break-word; hyphens:auto;}
:root:lang(th) h1, :root:lang(th) h2, :root:lang(th) h3,
:root:lang(hi) h1, :root:lang(hi) h2, :root:lang(hi) h3,
:root:lang(ar) h1, :root:lang(ar) h2, :root:lang(ar) h3{line-height:1.4 !important; letter-spacing:0 !important;}
:root:lang(vi) h1, :root:lang(vi) h2, :root:lang(vi) h3{line-height:1.25 !important;}
:root:lang(th) body, :root:lang(hi) body, :root:lang(ar) body{line-height:1.8;}
/* 阿拉伯文连写，任何字距都会把字母拆开 */
:root:lang(ar) *{letter-spacing:0 !important;}

/* ---------- 阿拉伯语：从右到左 ---------- */
/* 产品示意（聊天截图、示意框）保持原样从左到右 */
[dir=rtl] .chat-frame, [dir=rtl] .mock-voice, [dir=rtl] .mock-tr, [dir=rtl] .bubble{direction:ltr;}
[dir=rtl] .lang-menu{right:auto; left:0;}
[dir=rtl] .nav-end.sw-float{right:auto; left:14px;}
[dir=rtl] .nav-burger{margin-left:0 !important; margin-right:10px;}
[dir=rtl] .nav-menu a::after{content:"‹" !important;}
@media (max-width:980px){ [dir=rtl] .nav .nav-end{margin-left:0; margin-right:auto;} [dir=rtl] .nav .nav-cta{margin-left:0;} }
[dir=rtl] .trust .tnote{margin-left:0; margin-right:6px;}
[dir=rtl] .feat::before{left:auto; right:0;}
[dir=rtl] .cmp th, [dir=rtl] .cmp td{text-align:right;}
[dir=rtl] .cmp th:nth-child(n+2), [dir=rtl] .cmp td:nth-child(n+2){text-align:center;}
[dir=rtl] .cmp-more{text-align:left;}
[dir=rtl] .steps{text-align:right; padding:0 20px 0 0;}
[dir=rtl] .news{padding:6px 6px 6px 14px;}
[dir=rtl] .lede, [dir=rtl] .plede{text-align:right;}

/* ---------- 外语文字更长：防止示意框把栏撑宽 ---------- */
.fsec > *{min-width:0;}
.mock-plats{grid-template-columns:repeat(3, minmax(0, 1fr));}
.mock-plats div{min-width:0; overflow-wrap:break-word; hyphens:auto;}
@media (max-width:600px){
  /* 手机上语言菜单贴屏幕两边，不从按钮往左伸出屏幕 */
  .lang-menu{position:fixed; top:64px; left:12px; right:12px; width:auto; max-width:none;}
  [dir=rtl] .lang-menu{left:12px; right:12px;}
}
/* 手机导航：品牌名不折行；切换器只留地球图标，给「下载」按钮和菜单按钮让地方 */
.nav .brand{white-space:nowrap;}
@media (max-width:600px){
  .lang-sw summary{width:40px; padding:0; justify-content:center;}
  .lang-sw summary::after, .lang-short{display:none !important;}
  .nav .nav-end{gap:8px;}
  .nav .nav-cta{padding:9px 14px; font-size:14px; white-space:nowrap;}
}
@media (max-width:359px){ .nav .nav-cta{display:none;} }
/* 手机上对比表表头（「基础版 ¥19/月」）外语更长，字号收一点 */
@media (max-width:600px){ html:not(:lang(zh)) .cmp thead th{font-size:12.5px; padding-left:6px; padding-right:6px;} }
/* 韩文按词换行（默认会在词中间断开） */
:root:lang(ko) body{word-break:keep-all; overflow-wrap:break-word;}
