/* FOJI 体验版前端补丁：中英切换按钮、中文模式的加载状态、手机适配（文件末尾）。 */
.foji-lang-switch{cursor:pointer;font:600 12px/1 Inter,-apple-system,BlinkMacSystemFont,'PingFang SC','Hiragino Sans GB','Microsoft YaHei',sans-serif;letter-spacing:0;border-radius:999px;white-space:nowrap}
.foji-lang-rail{display:flex;align-items:center;justify-content:center;width:40px;height:24px;margin:0 auto 6px;padding:0;background:transparent;color:inherit;border:1px solid rgba(255,255,255,.24);opacity:.8}
.foji-lang-rail:hover,.foji-lang-rail:focus-visible{opacity:1;background:rgba(255,255,255,.1)}
.ac-auth-main{position:relative}
.foji-lang-auth{position:absolute;top:20px;right:24px;z-index:2;padding:7px 13px;background:#fff;color:#1f1f1f;border:1px solid #e3e3e3;box-shadow:0 1px 2px rgba(0,0,0,.04)}
.foji-lang-auth:hover,.foji-lang-auth:focus-visible{background:#f6f6f6}

/* 启动画面的那行字等翻译层定了语言再显示，免得中文用户先看到一闪英文 */
html:not([data-foji-lang]) .boot-screen p{visibility:hidden}
/* 中文模式下载词表期间：应用界面先藏着（启动画面照常显示），词表到了再一起露出来 */
html[data-foji-wait] #app>:not(.boot-screen),html[data-foji-wait] #modal-root,html[data-foji-wait] #popover-root,html[data-foji-wait] #toast-root{visibility:hidden}
html[data-foji-wait] body:not(:has(.boot-screen))::after{content:'正在加载中文界面…';position:fixed;inset:0;display:grid;place-items:center;color:#8c8c8c;font:14px/1.5 -apple-system,BlinkMacSystemFont,'PingFang SC','Microsoft YaHei',sans-serif}

/* 中文模式下的排版修补 */

/* ---- 手机适配：宽度 ≤ 820px（应用自己在这个宽度把二级导航藏掉） ---- */
.foji-nav-toggle{display:none}
@media (max-width:820px){
  /* 导航底色原来按 328px 画，藏掉二级导航后会盖住内容；改成只盖左侧图标栏 */
  .workspace-shell>.nav-bg{width:64px}
  /* 二级导航改成抽屉：点左侧图标栏的 ☰ 打开，点导航项、空白处或 Esc 关上 */
  .foji-nav-toggle{display:flex;align-items:center;justify-content:center;flex:none;width:40px;height:32px;margin:4px auto 10px;padding:0;border:0;border-radius:8px;background:transparent;color:inherit;cursor:pointer}
  .foji-nav-toggle:hover,.foji-nav-toggle:focus-visible,html.foji-nav-open .foji-nav-toggle{background:rgba(255,255,255,.12);color:#fff}
  html.foji-nav-open .workspace-shell>.secondary{display:flex!important;z-index:30;box-shadow:12px 0 32px rgba(0,0,0,.35)}
  html.foji-nav-open .workspace-shell>.nav-bg{width:294px}
  html.foji-nav-open body::before{content:'';position:fixed;inset:0 0 0 294px;z-index:28;background:rgba(10,10,20,.42)}
  .expand-sidebar{display:none!important}
  /* 别让个别宽元素把整页撑宽（手机浏览器会因此整页缩小） */
  .main-area{overflow-x:clip}
  .lib-view-rail{overflow-x:auto;max-width:100%;scrollbar-width:none}
  .lib-view-rail::-webkit-scrollbar{display:none}
  .lib-feed-toolbar.is-discovery .lib-search-box,.lib-feed-topline .lib-search-box,.lib-collection-search.lib-search-box,.lib-advertisers-header .lib-search-box,.lib-following-header .lib-search-box{min-width:0;width:auto;flex:1 1 100%}
  .main-area table{display:block;max-width:100%;overflow-x:auto}
  .main-area th{white-space:nowrap}
  /* 登录页：一栏，内边距收小，三个演示账号并排放得下 */
  .ac-auth{grid-template-columns:minmax(0,1fr)}
  .ac-auth-main{padding:64px 18px 32px}
  .ac-auth-card{width:100%}
  .foji-lang-auth{top:16px;right:16px}
  /* 设置弹窗：左侧菜单挪到上面横排，内容占满宽度 */
  .settings-dialog{max-width:calc(100vw - 20px);max-height:calc(100vh - 20px)}
  .ac-settings-modal{flex-direction:column}
  .ac-modal-settings-menu{width:auto;min-width:0;flex:none;padding:8px 46px 8px 10px;overflow-x:auto;overflow-y:hidden;scrollbar-width:none}
  .settings-close{background:#f5f5fa}
  .ac-modal-settings-menu nav,.ac-modal-settings-menu .ac-modal-menu-group{flex-direction:row;align-items:center;gap:2px;width:max-content}
  .ac-modal-settings-menu .ac-modal-menu-group>:not(a){display:none}
  .ac-modal-settings-menu a{width:auto;white-space:nowrap}
  .ac-settings-modal>:not(.ac-modal-settings-menu){min-width:0;flex:1 1 auto}
  /* 广告制作首页：品牌 / 产品两格能缩窄，下面一排选项放不下就换行 */
  .maker-wells>.vg-well{min-width:0}
  .maker-controls{height:auto;flex-wrap:wrap;row-gap:8px}
  .maker-chips{flex-wrap:wrap;row-gap:8px}
  /* Raya 对话页的标题栏：标题一行，Agent 状态和品牌选择换到下一行 */
  .raya-thread-bar{flex-wrap:wrap;height:auto;min-height:64px;row-gap:6px;padding-top:8px;padding-bottom:8px}
  .raya-thread-brand{flex:1 1 100%;min-width:0}
  .raya-thread-tools{flex-wrap:wrap;max-width:100%;min-width:0}
  /* 广告详情：两边留一点白 */
  .lib-detail-page{padding:0 10px}
  .lib-detail-grid .lib-detail-column{width:100%;min-width:0;max-width:100%;flex:none}
  /* 项目编辑（脚本 / 元素 / 分镜 / 剪辑）按电脑屏幕设计：保持电脑宽度，在手机上左右滑动查看 */
  .main-area:has(.pd-page){overflow-x:auto}
  .pd-page{min-width:900px}
  .pd-page::before{position:sticky;left:0;z-index:6;align-self:flex-start;flex:none;max-width:calc(100vw - 64px);padding:7px 14px;background:#fef2ff;color:#7d2a87;font:500 12px/18px -apple-system,BlinkMacSystemFont,'PingFang SC','Microsoft YaHei',sans-serif}
  html[data-foji-lang="zh"] .pd-page::before{content:'项目编辑按电脑屏幕设计，手机上请左右滑动查看。'}
  html:not([data-foji-lang="zh"]) .pd-page::before{content:'The project editor is designed for desktop. Swipe sideways to see more.'}
}
