/**
 * 键共振 · 五语（中 / EN / ES / 日 / ع）
 * 界面、术语、断语模板与断语库正文。干支汉字本身不译。
 * © 2026 Jason Li（泽森）
 */
(function (global) {
  "use strict";
  var LANGS = ["zh", "en", "es", "ja", "ar"];
  var cur = "zh";

  function pick(pack, key) {
    if (!pack) return key;
    return (pack[cur] && pack[cur][key]) || (pack.zh && pack.zh[key]) || key;
  }
  function fmt(s, vars) {
    s = String(s == null ? "" : s);
    vars = vars || {};
    return s.replace(/\{(\w+)\}/g, function (_, k) { return vars[k] == null ? "" : vars[k]; });
  }

  var UI = {
    zh: {
      tagline: "全球真太阳时 · 键共振判局 · 参数 2026-08-11",
      name: "姓名", gender: "性别", male: "男", female: "女",
      calendar: "历法", solar: "公历", lunar: "农历", birthDate: "出生日", time: "时间",
      birthPlace: "出生地", standPlace: "现住地", lon: "经度", lat: "纬度",
      waterFire: "水火", trueSolar: "真太阳", on: "开", off: "关", paipan: "排 盘",
      tabInfo: "基本信息", tabChart: "基础排盘", tabPro: "专业细断", tabKey: "键振详断", tabVip: "会员收藏",
      water: "水", fire: "火", wood: "木", earth: "土", metal: "金",
      hub: "枢纽", cases: "案例分析", layout: "布局场强", preface: "序",
      libTitle: "模型全书 · 全部内容", libParams: "参数与规则", libFlow: "判局流程",
      libKey: "键 · 断语", libCase: "案例 · 布局", libTeach: "教程 · 文档",
      canon: "典章", params: "参数表", oProg: "O程序", pProg: "P程序", o7: "O7三合",
      kanju: "看局", report: "看盘报表", globalRules: "全球规则", coldWarm: "寒暖",
      verdictBank: "断语库", hecan: "合参", caseBack: "案例回测",
      teach: "教程", pricing: "价目", feed: "投喂总册", docs: "文档",
      authorTitle: "作者简介", thanksTitle: "感谢",
      authorBio: "泽森（Jason Li）——工程专业出身，转入命理量化研究。以「键共振」把八字的令、地、生克、合冲刑害破，统一为可计算的能量与烈度模型；参数于 2026-08-11 定稿冻结，并以真实命例回测校准。",
      thanks: "感谢家人与诸位命主（均已匿名）提供命例与应期数据；感谢早期试用者的纠错指正；感谢 lunar.js 等开源历法工具。愿此工具助人明理、趋吉避凶。",
      reset: "↺ 重排",
      secBazi: "干支八字", fourPillars: "四柱", dayMaster: "日主",
      secWho: "命主信息", sexMale: "男", sexFemale: "女",
      zodiac: "生肖", sign: "星座", mingGong: "命宫", taiYuan: "胎元",
      secWhen: "时间 · 地点", trueSolarOff: "（真太阳关 · 用当地钟表）",
      eotLabel: "真太阳时差", eotFmt: "{delta} 分（经差 {lon} + 均时差 {eot}）",
      customPlace: "自定义", defaultBeijing: "（未填→默认北京）", americas: "美洲进一区", south: "南半球",
      sameBirth: "同出生地", wallClock: "墙钟", flowHour: "流时",
      secStrength: "日主强弱 · 旬空 · 日宜忌", dayXun: "日空", timeXun: "时空",
      dayYi: "日宜", dayJi: "日忌",
      wfNote: "|纬|/90→水，火=1−水；已叠入我/客内外总量（不入八字字条）。",
      wfBirthLat: "含量（出生地纬度）",
      yearP: "年柱", monthP: "月柱", dayP: "日柱", timeP: "时柱",
      natalYear: "年", natalMonth: "月", natalDay: "日", natalTime: "时",
      liunian: "流年", dayun: "大运", xiaoyun: "小运", liuyue: "流月", liuri: "流日", liushi: "流时",
      natal: "原局", sync: "同步", age: "岁", lunarShort: "农",
      pageUp: "上页·原局运年", pageDn: "下页·流月日时", pageBoth: "两页",
      rowStar: "主星", rowGan: "天干", rowZhi: "地支", rowHide: "藏干",
      rowYun: "星运", rowSit: "自坐", rowKong: "空亡", rowNayin: "纳音",
      secPan: "四柱盘（问真口径）", shensha: "神煞（日）", lucky: "吉", unlucky: "凶",
      panNote: "干支随出生地变化：美洲进一区日柱+1、南半球月支对冲，已按经纬同步计算。",
      secDayun: "大运", dayunNote: "大运叠能 ×1.0；小运 ×1/8（2026-08-11）。当前约 {age} 岁。",
      secIndex: "参数条图 · ①基础 → ②专业 → ③键振", wfBirth: "水火（出生地）",
      stage1: "①基础【初断】", stage2: "②专业【细断】", stage3: "③键振【详断】",
      stage1Sub: "免费 · 作用前", stage2Sub: "续费 · 运前", stage3Sub: "二级 · 流层后",
      stage1Hint: "令地旺衰不算合冲生克。五行只相加。地理不进字。",
      stage2Hint: "原局做功后、大小运未叠。二次用忌看此。正从／我客／家内外身份不改。",
      stage3Hint: "大运→小运→流年→流时。流局每字1.0，只乘与命主距离。家外叠流层＋现地。正从不改。",
      stageHint: "一张图三档：①基础【初断】→②专业【细断】→③键振【详断】。未付档只显示锁，不露数。①②出生地，③现地。正从不改。",
      tierBase: "①基础【初断】", tierPro: "②专业【细断】", tierKey: "③键振【详断】",
      tierBasePay: "免费", tierProPay: "续费", tierKeyPay: "二级",
      pageNow: "本页", stageLock: "本档未开",
      tierSplitHint: "付款内容分三部，必须分开看：①基础免费＝令地后初断；②专业续费＝做功后细断；③键振二级＝运岁／外环境详断。正从不改。",
      paidProTitle: "②专业【细断】·续收费（出生地→大运前）",
      paidKeyTitle: "③键振【详断】·二级收费（键共振随流时）",
      paidProLock: "🔒 ②专业【细断】续费可见：格局 · 第二次用忌 · 细断 · 字能 · 太极六亲 · 基+专教程。",
      paidKeyLock: "🔒 ③键振【详断】二级可见：流时能量 · 烈度 · 综合表 · 心性功用 · 详断 · 全部教程 · AI师傅。",
      subGeju: "格局", subYong2: "第二次用忌（生克后·冻结二）", subXiduan: "细断",
      subTeachBP: "基 + 专教程", subTeachAll: "全部教程（基础 + 专业 + 键共振）",
      subShifu: "AI师傅讲解（本盘 · 有问有答）",
      elZi: "五行（字账·地理不进）",
      woTa: "我方 ∶ 客方（断正从 · 我＝印比 · 客＝食伤财官）",
      neiWai: "家内 ∶ 家外（家内＝自家实际量 · 家外＝可利用资源实际量）",
      woTaHint: "作用后十神增减用来断夭寿、身体、能力好指数。",
      neiWaiHint: "作用后看双方实际数量增减，并看此十神对自家与日主的利败。",
      woTaGong: "我方∶客方（定体）",
      neiWaiGong: "家内∶家外（定境）",
      wo: "我方", ta: "客方", nei: "家内", wai: "家外",
      secElStatic: "五行能量条图（令地后 · 静）",
      secElLive: "五行能量条图（当时当地 · 柱序后）",
      elLiveNote: "跟顶栏洋葱：年→时→运→流时。能量看强弱；烈度≠本条能量。",
      secYong: "定体正从 · 第一次名义用忌（令地后·冻结一）",
      zhengcong: "正从", bodyGuest: "体客", yong1: "第一次名义用神", ji1: "第一次名义忌神",
      dingTi: "定体正从", dingTiId: "身份不改",
      gongNeng: "二次用忌", gongNengDeLi: "用忌已变",
      gongNengHint: "做功只改用忌。正从、我客、家内外不改。",
      yong1Hint: "定境第一次名义用忌。做功后只改第二次实际用忌。正从、我客、家内外不改。",
      yong2: "第二次实际用神", ji2: "第二次实际忌神", orient2: "二次取向",
      yong2Hint: "第一次名义用忌看定境；第二次实际用神看做功后。只有用忌可互变；正从、我客、家内外不改。",
      lingDiEl: "令地后五行（旺衰只相加·不算合冲生克·不含地理）",
      lingTwoHint: "令地旺衰不算合冲生克。先戌后午。令系数＝1−(1−L)×E戌。地系数＝1−(1−D)×¼×E午：D＝时支层权令，地打满盘。令值唯一尺：旺1.5／相1.25／休0.75／囚⅞／死⅝。令地用字距（同柱／同层邻柱 a=0），不是柱距。流局是外部环境，每字1.0，只乘与命主距离；令地／年权只给人类盘。合化临界只用月支本气旺相化、休囚死绊。废止休囚同0.75／死0.25 与得令±1/8。",
      scaleHint: "能量看强弱；烈度≥2 看事显；字能档危0＜安1＜旺2＜极旺7 看该字承压。三尺不混加。",
      neiSanHint: "柱域：年月外·日时内。时间：流年→流时外、大小运隔层、本局内。空间：屋外／房构／室内。",
      geoRemedyHint: "我党（定体印比）掉到 70% 以下才地理补救。水火金木不进字。用神合绊则补亦无用。",
      hecanHint: "两盘三盘：年长流年→流时定格到其余各盘。产生日同理。",
      secChu: "初断（基础）",
      secLiu: "流年 · 小运（与顶栏同步）",
      liuYmd: "流月／日／时",
      onionFollow: "顶栏一行九柱。点任一柱选该层区间内的时段：流时十二时辰／流日该月各日／流月该年各月／流年该大运各年／大运各步；年＝一生各年，月日时＝出生年／月／日之内。",
      secTeachBase: "基础教程",
      teachBaseBlurb: "基础知识（免费）：干支 · 藏干 · 十神 · 令地 · 正从 · 用忌 入门。",
      openTeach: "打开基础教程 →",
      nowFlow: "现地 · 流时（精确同步）", nowTime: "现时", nowPlace: "现地", lonlat: "经纬",
      syncNow: "同步现地/流时", locateNow: "实地时刻", locating: "定位中…",
      stepBirth: "① 出生", stepDevice: "② 操作者", stepStand: "③ 现地",
      stepHint: "①出生经纬时刻定原局指数。②电脑／手机当前时地。③所选地点或经纬的当地时刻。三步内部同步，改③则流层与各指数一起重算。",
      locateHint: "①出生时地 → ②操作者当前时地 → ③选城或改经纬即写该地墙钟。「同步现地/流时」写入手填钟。「实地时刻」退回②。",
      flowFour: "流时四柱：",
      birthBars: "出生地条图（免费）", standBars: "现地条图（精确到流时·免费）",
      wfStand: "水火（现地）", mwBirth: "金木", mwStand: "金木（现地）",
      elLing: "五行（令地后）", elFlow: "五行（现地流层）",
      woTaShort: "我方∶客方", woTaStand: "我方∶客方（现地）", neiWaiShort: "家内∶家外",
      teaserPro: "细断结论（预览）",
      teaserProLine: "细断：",
      lockPro: "🔒 ②专业【细断】续费：完整格局 / 第二次用忌 / 细断 / 八字字能 / 太极六亲 / 基+专教程。",
      ziNengTitle: "八字含藏干能量（五行·十神·我客·用忌·内外 · 运年消长）",
      ziNengHint: "每个字含藏干带着自身五行与十神，落在我客／用忌／内外；再遇运年作用与地理总量看消长，细事可读到时辰（非命中率）。地理不进字条。531 其余为心性与天意，不卖铁口。",
      taijiTitle: "太极六亲（该星／原宫当命主 · 环境与消长）",
      taijiHint: "六亲以该星或原宫干支含藏干代表原星，当命主太极转换。印比＝我方，财官伤＝客方。本局为环境，十神相对新原点重定。先护其体。不改写本盘正从。见星非即人，不卖铁口。",
      tianYiHint: "身体走三维单向时间短线；意识或可读四维结构。果因率谁都逃不了。AI只算清结构，不能代人逃因果。531 其余为心性与天意，不卖铁口。",
      teachBaseBtn: "基础教程", teachProBtn: "专业教程", teachKeyBtn: "键共振教程",
      teaserKey: "键共振结论（预览）",
      lockKey: "🔒 ③键振【详断】二级：完整键网 / 烈度条 / 详断应期 / 三部教程。",
      energy1: "参数条图 · ①基础 → ②专业 → ③键振",
      elAfterLing: "①基础【初断】（作用前·令地后）", elAfterKey: "②专业【细断】（运前·做功后）",
      elAfterPipe: "③键振【详断】（流层后·运＋流年→时）",
      inten2: "键烈度条图（事显 ≥ 2.0）", noKeys: "未检出键",
      table3: "综合表格（合冲刑害破生克 · 键距 a · 烈度）",
      colCls: "键类", colPair: "双方", colLayer: "层", colA: "a", colInt: "烈度", colMan: "事显",
      moreKeys: "共 {n} 键，按烈度显示前 28。",
      tonggen: "通根：", windowNote: "成局窗：", formed: "成键", fallback2: "退回两字",
      detail4: "详断（键共振·流时应期）",
      xgTitle: "心性 vs 功用（隔位不作用 · 根气共振 · 库中不透）",
      xg_xinXing: "先天心性：", xg_gongYong: "实际功用：", xg_xianHua: "最终显化：",
      xg_gongJie: "功用结论：", xg_vaultBan: "库中不透：", xg_yunStep: "第",
      xg_yunCuts: "大运变局（关键截断点）", xg_liveCuts: "当时当地 · 截断点",
      xg_yearBrief: "流年做功简析",
      xg_sop: "断盘五步（样办）",
      man: "【事显】", latent: "【潜】", manBadge: "显", flowBadge: "流",
      vipSet: "会员设置", checkoutOff: "结账链接未接通",
      openTeachAny: "打开教程 →",
      teachPage: "教程三部", verdictPage: "断语库",
      teachSub: "基础知识／专业／键共振",
      teachBanner: "教程三部。先读「铁律对照」。旧±1/8／小运1/10／庚克甲已改。冲突以 IRON_LOCK 为准。",
      teachFoot: "教程三部：基础知识（免费）／专业（专业板）／键共振（键共振版）。仅作者典章正文。",
      backChart: "← 排盘", unlockEnter: "解锁作者并进入", exit: "退出",
      verdictTitle: "键共振 · 断语库",
      verdictSub: "七维总纲 · 配对指数 · 做功路径 · 象义栏目 · 本盘自动句。须回扣本盘，禁孤立贴标签、禁铁口。",
      verdictLive: "本盘自动断语",
      verdictNeedChart: "先在排盘页起一盘，再回本页看该盘自动句。也可先读下面总纲与专属库。",
      openChart: "去排盘 →",
      sevenTitle: "断语七维（总纲）",
      catalogTitle: "专属句库",
      xiangyiTitle: "象义栏目（看图说话）",
      liveTitle: "本盘选句（引擎）",
      demoCase: "默认案例 · 作者盘",
      demoNote: "1973-10-15 午时 · 广州生 · 现住芝加哥 · 男",
      tapePlay: "▶ 试听问答录音",
      tapePlaying: "⏸ 试听中…",
      tapeStop: "■ 停",
      tapeGo: "看全盘",
      tapeHint: "点试听：庚克身 · 利败 · 辛合身 · 拒铁口。预录可播；无声则本机朗读。",
      tapeNow: "正在试听作者盘问答录音。",
      tapeStopped: "已停。可再点试听，或点一条单问。",
      defaultHint: "已填作者盘默认案例，可改后再排。",
      shifuBlurb: "泽森断盘技术 · 本盘师傅。只据铁律与冻结账本讲解，不接云端大模型，不卖铁口。",
      shifuAsk: "问师傅",
      shifuListen: "▶ 听",
      shifuPh: "问本盘：庚克甲吗？利还是败？",
      download: "下载",
      downloadFull: "全工程压缩包",
      downloadHint: "下载到本机／手机 · 含网站＋引擎＋文档"
    },
    en: {
      tagline: "Global true solar time · Key-resonance judgment · params 2026-08-11",
      name: "Name", gender: "Gender", male: "Male", female: "Female",
      calendar: "Calendar", solar: "Solar", lunar: "Lunar", birthDate: "Birth date", time: "Time",
      birthPlace: "Birthplace", standPlace: "Now city", lon: "Longitude", lat: "Latitude",
      waterFire: "Water/Fire", trueSolar: "True solar", on: "On", off: "Off", paipan: "Chart",
      tabInfo: "Info", tabChart: "Chart", tabPro: "Pro", tabKey: "Resonance", tabVip: "Member",
      water: "Water", fire: "Fire", wood: "Wood", earth: "Earth", metal: "Metal",
      hub: "Hub", cases: "Cases", layout: "Site field", preface: "Preface",
      libTitle: "Full model · every page", libParams: "Parameters & rules", libFlow: "Judgment flow",
      libKey: "Keys · verdicts", libCase: "Cases · layout", libTeach: "Tutorials · docs",
      canon: "Canon", params: "Param table", oProg: "O program", pProg: "P program", o7: "O7 triple-combine",
      kanju: "Read the chart", report: "Chart report", globalRules: "Global rules", coldWarm: "Cold/warm",
      verdictBank: "Verdict bank", hecan: "Joint charts", caseBack: "Case backtest",
      teach: "Tutorial", pricing: "Pricing", feed: "Canon feed", docs: "Docs",
      authorTitle: "About the author", thanksTitle: "Thanks",
      authorBio: "Jason Li (Zeisen) — trained as an engineer, now quantifying destiny charts. Key Resonance unifies season, ground, generate/control, and combine/clash/punish/harm/break into computable energy and intensity. Parameters froze on 2026-08-11 and were calibrated on real cases.",
      thanks: "Thanks to family and anonymous natives for cases and timing data; to early testers for corrections; to lunar.js and other open tools. May this help people see structure and avoid harm.",
      reset: "↺ Recast",
      secBazi: "Four pillars", fourPillars: "Four pillars", dayMaster: "Day master",
      secWho: "Native", sexMale: "Male", sexFemale: "Female",
      zodiac: "Zodiac animal", sign: "Western sign", mingGong: "Ming palace", taiYuan: "Tai yuan",
      secWhen: "Time · place", trueSolarOff: "(True solar off · wall clock)",
      eotLabel: "True-solar offset", eotFmt: "{delta} min (longitude {lon} + equation of time {eot})",
      customPlace: "Custom", defaultBeijing: "(empty → Beijing)", americas: "Americas +1 day stem", south: "Southern hemisphere",
      sameBirth: "Same as birth", wallClock: "wall clock", flowHour: "hour pillar",
      secStrength: "Strength · voids · day yi/ji", dayXun: "Day void", timeXun: "Hour void",
      dayYi: "Day yi", dayJi: "Day ji",
      wfNote: "|lat|/90 → water, fire = 1−water; folded into self/guest totals (not into stem bars).",
      wfBirthLat: "share (birth latitude)",
      yearP: "Year", monthP: "Month", dayP: "Day", timeP: "Hour",
      natalYear: "Year", natalMonth: "Month", natalDay: "Day", natalTime: "Hour",
      liunian: "Year flow", dayun: "Luck", xiaoyun: "Small luck", liuyue: "Month flow", liuri: "Day flow", liushi: "Hour flow",
      natal: "Natal", sync: "Sync", age: "yo", lunarShort: "L",
      pageUp: "Up · natal/luck/year", pageDn: "Down · month/day/hour", pageBoth: "Both",
      rowStar: "Star", rowGan: "Stem", rowZhi: "Branch", rowHide: "Hidden",
      rowYun: "Stage", rowSit: "Self-sit", rowKong: "Void", rowNayin: "Nayin",
      secPan: "Four-pillar board", shensha: "Day spirits", lucky: "ausp.", unlucky: "inausp.",
      panNote: "Stems follow birth place: Americas +1 day pillar, southern hemisphere month-branch flip — already applied.",
      secDayun: "Luck cycles", dayunNote: "Luck stack ×1.0; small luck ×1/8 (2026-08-11). About age {age}.",
      secIndex: "Bars · ① Basic → ② Pro → ③ Resonance", wfBirth: "Water/Fire (birth)",
      stage1: "① Basic [first]", stage2: "② Pro [detail]", stage3: "③ Resonance [full]",
      stage1Sub: "Free · before work", stage2Sub: "Paid · before luck", stage3Sub: "Tier-2 · after flow",
      stage1Hint: "After season/ground, before combine/clash. Phases only add. Place stays out of stem bars.",
      stage2Hint: "After natal work, luck not stacked. Second useful/avoid is read here. Pattern / self-guest / inner-outer identity stay.",
      stage3Hint: "Luck → small luck → year→hour flow. Flow chars 1.0 × distance to the native. Outer adds flow + stand place. Pattern stays.",
      stageHint: "One chart, three paid parts: ① Basic → ② Pro → ③ Resonance. Locked columns hide numbers. ①② birth; ③ stand. Pattern stays.",
      tierBase: "① Basic [first]", tierPro: "② Pro [detail]", tierKey: "③ Resonance [full]",
      tierBasePay: "Free", tierProPay: "Paid", tierKeyPay: "Tier-2",
      pageNow: "This page", stageLock: "Locked",
      tierSplitHint: "Paid content is three parts: ① Basic is free first-read; ② Pro is paid detail; ③ Resonance is tier-2 full reading. Pattern stays.",
      paidProTitle: "② Pro [detail] · paid (birth → before luck)",
      paidKeyTitle: "③ Resonance [full] · tier-2 (keys follow the hour)",
      paidProLock: "🔒 ② Pro paid: pattern · second useful/avoid · lines · stem energy · Taiji kin · basics+pro tutorials.",
      paidKeyLock: "🔒 ③ Resonance tier-2: live energy · intensity · table · nature/function · timing · all tutorials · master.",
      subGeju: "Pattern", subYong2: "Second useful/avoid (after work · freeze 2)", subXiduan: "Pro lines",
      subTeachBP: "Basics + Pro tutorials", subTeachAll: "All tutorials (Basic + Pro + Resonance)",
      subShifu: "AI master (this chart · Q&A)",
      elZi: "Five phases (stems only · no place)",
      woTa: "Self ∶ Guest (judges 正从 · self = resource/peer · guest = output/wealth/officer)",
      neiWai: "Inner ∶ Outer (inner = own-family amount · outer = usable resources)",
      woTaHint: "After work, ten-god deltas judge longevity, body, ability.",
      neiWaiHint: "After work: both sides' gain/loss, and each ten-god's help/harm to family and day master.",
      woTaGong: "Self∶Guest (after work)",
      neiWaiGong: "Inner∶Outer (after work)",
      wo: "Self", ta: "Guest", nei: "Inner", wai: "Outer",
      secElStatic: "Five-phase bars (after season/ground · static)",
      secElLive: "Five-phase bars (here and now · after pillar pipeline)",
      elLiveNote: "Follows the onion: year→hour→luck→hour-flow. Intensity ≠ these energy bars.",
      secYong: "定体 pattern · first nominal useful/avoid (freeze 1)",
      zhengcong: "Pattern", bodyGuest: "Self/guest", yong1: "First nominal useful", ji1: "First nominal avoid",
      dingTi: "定体 pattern", dingTiId: "identity stays",
      gongNeng: "Second useful/avoid", gongNengDeLi: "useful/avoid flipped",
      gongNengHint: "Work changes useful/avoid only. 正从, 我客, and 家内外 stay.",
      yong1Hint: "Freeze 1 is the first nominal useful/avoid. Freeze 2 is the actual useful after work. Only useful/avoid may flip; 正从, 我客, and 家内外 stay.",
      yong2: "Second actual useful", ji2: "Second actual avoid", orient2: "Second orientation",
      yong2Hint: "First useful/avoid is 定境. Second is after work. Only useful/avoid may flip; 正从, 我客, and 家内外 stay.",
      lingDiEl: "Five phases after season/ground (before stem work · no place)",
      lingTwoHint: "Ling = 1−(1−L)×E戌. Ground = 1−(1−D)×¼×E午 (D = hour-branch layer command; hits every character). One 令 scale: 旺1.5／相1.25／休0.75／囚⅞／死⅝. Combine-transform uses month-branch stage only (旺相 transform, 休囚死 bind). Two-scale 令 and ±1/8 are abolished.",
      scaleHint: "Energy = strength. Intensity ≥2 = manifestation. Stem band 危0＜安1＜旺2＜极旺7 = that character's load. Do not add the three scales.",
      neiSanHint: "Pillars: year/month outer · day/hour inner. Time: year→hour-flow outer, luck the partition, natal inner. Space: outdoors / house / indoors.",
      geoRemedyHint: "Place remedy only if 定体 self-camp falls below 70%. Place does not enter stem bars. If the useful god is bound, remedy is useless.",
      hecanHint: "Two/three charts: the eldest year's hour-flow stamps the others. An event-day works the same way.",
      secChu: "First reading (free)",
      secLiu: "Year flow · small luck (synced)",
      liuYmd: "Month / day / hour flow",
      onionFollow: "One row of nine pillars: hour→year (small luck)→luck→natal. Stem above branch. This block follows.",
      secTeachBase: "Basics tutorial",
      teachBaseBlurb: "Free basics: stems & branches · hidden stems · ten gods · season/ground · pattern · useful/avoid.",
      openTeach: "Open basics tutorial →",
      nowFlow: "Stand city · hour flow (exact sync)", nowTime: "Now", nowPlace: "City", lonlat: "Lon/lat",
      syncNow: "Sync city / hour", locateNow: "Field time", locating: "Locating…",
      stepBirth: "① Birth", stepDevice: "② Operator", stepStand: "③ Stand",
      stepHint: "① Birth lon/lat/time fixes natal indices. ② Computer/phone here-and-now. ③ Selected city or lon/lat local clock. The three stay in sync; changing ③ rebuilds flow and all live indices.",
      locateHint: "① Birth → ② operator here-now → ③ city or lon/lat writes that local clock. Sync writes the clock you typed. Field time returns to ②.",
      flowFour: "Hour-flow pillars: ",
      birthBars: "Birth-place bars (free)", standBars: "Stand-city bars (to the hour · free)",
      wfStand: "Water/Fire (stand)", mwBirth: "Metal/Wood", mwStand: "Metal/Wood (stand)",
      elLing: "Five phases (after season/ground)", elFlow: "Five phases (stand flow)",
      woTaShort: "Self∶Guest", woTaStand: "Self∶Guest (stand)", neiWaiShort: "Inner∶Outer",
      teaserPro: "Pro reading (preview)",
      teaserProLine: "Pro: ",
      lockPro: "🔒 ② Pro paid: full pattern / second useful-avoid / pro lines / stem energy / Taiji kin / basics+pro tutorials.",
      ziNengTitle: "Stem+hidden energy (phase · ten-god · self/guest · useful/avoid · inner/outer · luck-year change)",
      ziNengHint: "Each stem and hidden stem carries its phase and ten-god, seated in self/guest, useful/avoid, inner/outer. Luck-year work and place totals change the amount. Fine events can be read to the hour — not a hit rate. Place does not enter the stem bar. 531 remainder is mind and heaven. No iron-mouth.",
      taijiTitle: "Taiji six-kin (star / palace as day-master · environment and change)",
      taijiHint: "A kin is the star or the palace stem/branch/hidden stems. Treat that as day-master. Resource+peer = self; wealth+officer+output = guest. This chart is the environment. Do not rewrite this chart's 正从. A star is not a person. No iron-mouth.",
      tianYiHint: "The body is a short one-way 3D time vector. Consciousness may read 4D structure. Nobody leaves causality. AI clears the structure; it does not take your karma. 531 remainder is mind and heaven. No iron-mouth.",
      teachBaseBtn: "Basics", teachProBtn: "Pro tutorial", teachKeyBtn: "Resonance tutorial",
      teaserKey: "Resonance reading (preview)",
      lockKey: "🔒 ③ Resonance tier-2: full key net / intensity bars / timing lines / three tutorials.",
      energy1: "Bars · ① Basic → ② Pro → ③ Resonance",
      elAfterLing: "① Basic (before work)", elAfterKey: "② Pro (before luck)",
      elAfterPipe: "③ Resonance (after flow)",
      inten2: "Key intensity bars (manifest ≥ 2.0)", noKeys: "No keys found",
      table3: "Table (combine/clash/punish/harm/break/generate/control · distance a · intensity)",
      colCls: "Class", colPair: "Pair", colLayer: "Layer", colA: "a", colInt: "Int.", colMan: "Show",
      moreKeys: "{n} keys total; top 28 by intensity.",
      tonggen: "Root: ", windowNote: "Formation window: ", formed: "formed", fallback2: "back to pair",
      detail4: "Detail (resonance · hour-flow timing)",
      xgTitle: "Nature vs function (no skip-stem action · root resonance · vault stays in)",
      xg_xinXing: "Innate nature: ", xg_gongYong: "Actual function: ", xg_xianHua: "How it shows: ",
      xg_gongJie: "Function verdict: ", xg_vaultBan: "Vault hidden, not transmitted: ", xg_yunStep: "Step ",
      xg_yunCuts: "Luck-cycle turns · cut / save points", xg_liveCuts: "Here and now · cut points",
      xg_yearBrief: "Year-flow work brief",
      xg_sop: "Five-step judgment (paradigm)",
      man: "[Manifest] ", latent: "[Latent] ", manBadge: "show", flowBadge: "flow",
      vipSet: "Membership", checkoutOff: "Checkout link not connected",
      openTeachAny: "Open tutorial →",
      teachPage: "Tutorial in three parts", verdictPage: "Verdict bank",
      teachSub: "Basics / Pro / Resonance",
      teachBanner: "Three parts: Basics (free) / Pro / Resonance. Author canon only.",
      teachFoot: "Three parts: Basics (free) / Pro / Resonance. Author canon only.",
      backChart: "← Chart", unlockEnter: "Unlock author and enter", exit: "Exit",
      verdictTitle: "Key Resonance · Verdict bank",
      verdictSub: "Seven axes · pairing index · work paths · image-speech columns · live lines for this chart. Always tie back to this chart. No isolated labels. No iron-mouth claims.",
      verdictLive: "Live lines for this chart",
      verdictNeedChart: "Cast a chart first, then return here to see its auto lines. Or read the axes and libraries below.",
      openChart: "Go to chart →",
      sevenTitle: "Seven verdict axes",
      catalogTitle: "Special libraries",
      xiangyiTitle: "Image-speech columns",
      liveTitle: "Lines selected for this chart",
      demoCase: "Default case · author chart",
      demoNote: "1973-10-15 noon · born Guangzhou · lives Chicago · male 甲 wood",
      tapePlay: "▶ Preview Q&A audio",
      tapePlaying: "⏸ Playing…",
      tapeStop: "■ Stop",
      tapeGo: "Open full chart",
      tapeHint: "Preview: does 庚 attack · gain or loss · does 辛 combine · no iron-mouth. File first; else on-device speech.",
      tapeNow: "Playing the author-chart Q&A recording.",
      tapeStopped: "Stopped. Play again, or tap one question.",
      defaultHint: "Author chart is prefilled. Change it, then cast.",
      shifuBlurb: "Zeisen method · this chart only. Iron laws and the frozen ledger. No cloud model. No iron-mouth.",
      shifuAsk: "Ask",
      shifuListen: "▶ Listen",
      shifuPh: "Ask this chart: does 庚 attack? gain or loss?",
      download: "Download",
      downloadFull: "Full project zip",
      downloadHint: "Save to this phone · site + engine + docs"
    },
    es: {
      tagline: "Tiempo solar verdadero · Resonancia clave · 2026-08-11",
      name: "Nombre", gender: "Género", male: "Hombre", female: "Mujer",
      calendar: "Calendario", solar: "Solar", lunar: "Lunar", birthDate: "Fecha nac.", time: "Hora",
      birthPlace: "Lugar nac.", standPlace: "Ciudad actual", lon: "Longitud", lat: "Latitud",
      waterFire: "Agua/Fuego", trueSolar: "Solar real", on: "Sí", off: "No", paipan: "Calcular",
      tabInfo: "Datos", tabChart: "Carta", tabPro: "Pro", tabKey: "Resonancia", tabVip: "Miembro",
      water: "Agua", fire: "Fuego", wood: "Madera", earth: "Tierra", metal: "Metal",
      hub: "Centro", cases: "Casos", layout: "Campo", preface: "Prefacio",
      libTitle: "Modelo completo", libParams: "Parámetros y reglas", libFlow: "Flujo de juicio",
      libKey: "Claves · veredictos", libCase: "Casos · diseño", libTeach: "Tutoriales · docs",
      canon: "Canon", params: "Tabla", oProg: "Programa O", pProg: "Programa P", o7: "O7 triple",
      kanju: "Leer carta", report: "Informe", globalRules: "Reglas globales", coldWarm: "Frío/calor",
      verdictBank: "Banco de veredictos", hecan: "Cartas juntas", caseBack: "Retroceso",
      teach: "Tutorial", pricing: "Precios", feed: "Canon", docs: "Docs",
      authorTitle: "Autor", thanksTitle: "Agradecimientos",
      authorBio: "Jason Li (Zeisen), ingeniero pasado a la cuantificación de cartas. La Resonancia Clave unifica estación, tierra, generar/controlar y unión/choque en energía e intensidad calculables. Parámetros congelados el 2026-08-11.",
      thanks: "Gracias a la familia y a nativos anónimos por casos y fechas; a los primeros testers; a lunar.js. Que esto ayude a ver la estructura y evitar daño.",
      reset: "↺ Recalcular",
      secBazi: "Cuatro pilares", fourPillars: "Cuatro pilares", dayMaster: "Dueño del día",
      secWho: "Nativo", sexMale: "Hombre", sexFemale: "Mujer",
      zodiac: "Animal", sign: "Signo", mingGong: "Palacio Ming", taiYuan: "Tai yuan",
      secWhen: "Tiempo · lugar", trueSolarOff: "(Solar real off · reloj local)",
      eotLabel: "Desfase solar", eotFmt: "{delta} min (long. {lon} + eq. tiempo {eot})",
      customPlace: "Custom", defaultBeijing: "(vacío → Pekín)", americas: "Américas +1", south: "Hemisferio sur",
      sameBirth: "Igual al nacimiento", wallClock: "reloj", flowHour: "hora",
      secStrength: "Fuerza · vacíos · yi/ji", dayXun: "Vacío día", timeXun: "Vacío hora",
      dayYi: "Yi del día", dayJi: "Ji del día",
      wfNote: "|lat|/90 → agua, fuego = 1−agua; entra en totales yo/huésped.",
      wfBirthLat: "cuota (latitud de nacimiento)",
      yearP: "Año", monthP: "Mes", dayP: "Día", timeP: "Hora",
      natalYear: "Año", natalMonth: "Mes", natalDay: "Día", natalTime: "Hora",
      liunian: "Año flu.", dayun: "Suerte", xiaoyun: "Suerte menor", liuyue: "Mes flu.", liuri: "Día flu.", liushi: "Hora flu.",
      natal: "Natal", sync: "Sync", age: "años", lunarShort: "L",
      pageUp: "Arriba · natal/suerte/año", pageDn: "Abajo · mes/día/hora", pageBoth: "Ambas",
      rowStar: "Estrella", rowGan: "Tallo", rowZhi: "Rama", rowHide: "Oculto",
      rowYun: "Etapa", rowSit: "Asiento", rowKong: "Vacío", rowNayin: "Nayin",
      secPan: "Tablero de pilares", shensha: "Espíritus del día", lucky: "ausp.", unlucky: "inausp.",
      panNote: "Los tallos siguen el lugar de nacimiento: Américas +1 pilar día, sur invierte la rama del mes.",
      secDayun: "Ciclos de suerte", dayunNote: "Suerte ×1.0; suerte menor ×1/8 (2026-08-11). Edad ≈ {age}.",
      secIndex: "Barras · ① Básico → ② Pro → ③ Resonancia", wfBirth: "Agua/Fuego (nacimiento)",
      stage1: "① Básico [1.ª]", stage2: "② Pro [detalle]", stage3: "③ Resonancia [plena]",
      stage1Sub: "Gratis · antes de la obra", stage2Sub: "Pago · antes de la suerte", stage3Sub: "Nivel 2 · tras el flujo",
      stage1Hint: "Tras estación/tierra, antes de unión/choque. Las fases solo se suman. El lugar no entra en las barras de tallos.",
      stage2Hint: "Tras la obra natal, sin suerte. Aquí se lee el útil/evitar 2. Identidad de patrón / yo-huésped / dentro-fuera no cambia.",
      stage3Hint: "Suerte → menor → año→hora. Flujo cada carácter 1.0 × distancia al nativo. El fuera suma flujo + ciudad. El patrón no cambia.",
      stageHint: "Un gráfico, tres partes de pago: ① Básico → ② Pro → ③ Resonancia. Columnas cerradas ocultan números. ①② nacimiento; ③ ciudad. El patrón no cambia.",
      tierBase: "① Básico [1.ª]", tierPro: "② Pro [detalle]", tierKey: "③ Resonancia [plena]",
      tierBasePay: "Gratis", tierProPay: "Pago", tierKeyPay: "Nivel 2",
      pageNow: "Esta página", stageLock: "Cerrado",
      tierSplitHint: "El contenido de pago son tres partes: ① Básico gratis; ② Pro de pago; ③ Resonancia nivel 2. El patrón no cambia.",
      paidProTitle: "② Pro [detalle] · de pago (nacimiento → antes de la suerte)",
      paidKeyTitle: "③ Resonancia [plena] · nivel 2 (claves con la hora)",
      paidProLock: "🔒 ② Pro de pago: patrón · útil 2 · líneas · energía · Taiji · tutoriales.",
      paidKeyLock: "🔒 ③ Resonancia nivel 2: energía · intensidad · tabla · índole · plazos · tutoriales · maestro.",
      subGeju: "Patrón", subYong2: "Útil/evitar 2 (tras la obra)", subXiduan: "Líneas pro",
      subTeachBP: "Tutoriales básico + pro", subTeachAll: "Todos los tutoriales (Básico + Pro + Resonancia)",
      subShifu: "Maestro IA (esta carta · Q&A)",
      elZi: "Cinco fases (tallos · sin lugar)",
      woTa: "Yo ∶ Huésped (juzga 正从 · yo = sello/par · huésped = output/riqueza/oficial)",
      neiWai: "Dentro ∶ Fuera (dentro = cantidad familiar · fuera = recursos aprovechables)",
      woTaHint: "Tras la obra, el cambio de los diez dioses juzga longevidad, cuerpo y capacidad.",
      neiWaiHint: "Tras la obra: aumento/baja de ambos y beneficio/daño de cada dios a la familia y al dueño del día.",
      woTaGong: "Yo∶Huésped (tras la obra)",
      neiWaiGong: "Dentro∶Fuera (tras la obra)",
      wo: "Yo", ta: "Huésped", nei: "Dentro", wai: "Fuera",
      secElStatic: "Barras de cinco fases (tras estación/tierra · estático)",
      secElLive: "Barras de cinco fases (aquí y ahora · tubería)",
      elLiveNote: "Sigue la cebolla: año→hora→suerte→hora fluida. Intensidad ≠ estas barras.",
      secYong: "定体 · útil/evitar nominal 1 (congelar 1)",
      zhengcong: "Patrón", bodyGuest: "Yo/huésped", yong1: "Útil nominal 1", ji1: "Evitar nominal 1",
      dingTi: "定体", dingTiId: "la identidad no cambia",
      gongNeng: "Útil/evitar 2", gongNengDeLi: "útil/evitar cambió",
      gongNengHint: "La obra solo cambia útil/evitar. 正从, 我客 y 家内外 no.",
      yong1Hint: "El útil/evitar 1 es nominal. El 2 es el real tras la obra. Solo útil/evitar puede cambiar; 正从, 我客 y 家内外 no.",
      yong2: "Útil real 2", ji2: "Evitar real 2", orient2: "Orientación 2",
      yong2Hint: "Útil 1 = 定境. Útil 2 = tras la obra. Solo útil/evitar puede cambiar; 正从, 我客 y 家内外 no.",
      lingDiEl: "Cinco fases tras estación/tierra (sin lugar)",
      lingTwoHint: "Una sola 令: 旺1.5／相1.25／休0.75／囚⅞／死⅝. Tierra = tras 令 ×¼. Mandato de capa usa esta escala. Unión usa solo la rama del mes (旺相 transforma, 休囚死 ata). Se abolieron las dos 令 y ±1/8.",
      scaleHint: "Energía = fuerza. Intensidad ≥2 = evento. No sume las tres escalas.",
      neiSanHint: "Pilares: año/mes fuera · día/hora dentro. Tiempo: flujo fuera, suerte tabique, natal dentro.",
      geoRemedyHint: "Remedio de lugar solo si el bando propio de 定体 cae bajo 70%.",
      hecanHint: "Dos/tres cartas: el flujo del mayor sella las demás.",
      secChu: "Primera lectura",
      secLiu: "Año flu. · suerte menor (sync)",
      liuYmd: "Mes / día / hora flu.",
      onionFollow: "Una fila: hora→año (suerte menor)→suerte→natal. Tallo arriba, rama abajo. Por defecto se ven los ocho caracteres natales; deslice a la izquierda para el flujo.",
      secTeachBase: "Tutorial básico",
      teachBaseBlurb: "Gratis: tallos · ocultos · diez dioses · estación/tierra · patrón · útil/evitar.",
      openTeach: "Abrir tutorial básico →",
      nowFlow: "Ciudad · hora fluida", nowTime: "Ahora", nowPlace: "Ciudad", lonlat: "Lon/lat",
      syncNow: "Sincronizar", locateNow: "Hora in situ", locating: "Localizando…",
      stepBirth: "① Nacimiento", stepDevice: "② Operador", stepStand: "③ Lugar",
      stepHint: "① Lon/lat/hora de nacimiento fija índices natales. ② Aquí y ahora del teléfono/PC. ③ Ciudad o lon/lat elegidos, hora local. Los tres se sincronizan; al cambiar ③ se recalculan flujo e índices.",
      locateHint: "① Nacimiento → ② operador → ③ ciudad o lon/lat escribe su hora local. Sincronizar escribe la hora tecleada. Hora in situ vuelve a ②.",
      flowFour: "Pilares de hora: ",
      birthBars: "Barras de nacimiento (gratis)", standBars: "Barras de ciudad (gratis)",
      wfStand: "Agua/Fuego (ciudad)", mwBirth: "Metal/Madera", mwStand: "Metal/Madera (ciudad)",
      elLing: "Cinco fases (tras estación)", elFlow: "Cinco fases (flujo)",
      woTaShort: "Yo∶Huésped", woTaStand: "Yo∶Huésped (ciudad)", neiWaiShort: "Dentro∶Fuera",
      teaserPro: "Lectura pro (vista)",
      teaserProLine: "Pro: ",
      lockPro: "🔒 ② Pro de pago: patrón completo / útil 2 / líneas / energía / Taiji / tutoriales.",
      ziNengTitle: "④ Energía de tallos+ocultos (fase · dios · yo/huésped · útil/evitar · dentro/fuera)",
      ziNengHint: "Cada tallo y oculto lleva su fase y dios, sentado en yo/huésped, útil/evitar, dentro/fuera. La obra del año y el lugar cambian la cantidad. Se puede leer hasta la hora — no es tasa de acierto. El lugar no entra en la barra. Sin boca de hierro.",
      taijiTitle: "⑤ Taiji seis parientes (astro / palacio como dueño · entorno y cambio)",
      taijiHint: "El pariente es el astro o los tallos del palacio. Trátelo como dueño del día. Sello+par = yo; riqueza+oficial+output = huésped. Esta carta es el entorno. No reescriba 正从. Un astro no es una persona. Sin boca de hierro.",
      tianYiHint: "El cuerpo es un vector 3D de un solo sentido. La conciencia puede leer 4D. Nadie escapa de la causalidad. La IA aclara la estructura; no toma su karma. 531 resto es mente y cielo. Sin boca de hierro.",
      teachBaseBtn: "Básico", teachProBtn: "Tutorial pro", teachKeyBtn: "Tutorial resonancia",
      teaserKey: "Resonancia (vista)",
      lockKey: "🔒 ③ Resonancia nivel 2: red de claves / barras / plazos / tres tutoriales.",
      energy1: "Barras · ① Básico → ② Pro → ③ Resonancia",
      elAfterLing: "Tras estación (estático)", elAfterKey: "Tras resonancia · natal",
      elAfterPipe: "Tras tubería · aquí y ahora (suerte menor ×1/8 · O5)",
      inten2: "② Intensidad (manifiesto ≥ 2.0)", noKeys: "Sin claves",
      table3: "③ Tabla (unión/choque · a · intensidad)",
      colCls: "Clase", colPair: "Par", colLayer: "Capa", colA: "a", colInt: "Int.", colMan: "Show",
      moreKeys: "{n} claves; top 28.",
      tonggen: "Raíz: ", windowNote: "Ventana: ", formed: "formado", fallback2: "vuelve a par",
      detail4: "⑤ Detalle (resonancia · plazo)",
      xgTitle: "④ Índole vs función (sin acción a distancia · resonancia de raíz · bóveda no sale)",
      xg_xinXing: "Índole innata: ", xg_gongYong: "Función real: ", xg_xianHua: "Cómo se ve: ",
      xg_gongJie: "Veredicto de función: ", xg_vaultBan: "Oculto en bóveda, no transita: ", xg_yunStep: "Paso ",
      xg_yunCuts: "Giros de suerte · cortes", xg_liveCuts: "Aquí y ahora · cortes",
      xg_yearBrief: "Obra del año fluente",
      xg_sop: "Juicio en cinco pasos",
      man: "[Manifiesto] ", latent: "[Latente] ", manBadge: "show", flowBadge: "flujo",
      vipSet: "Membresía", checkoutOff: "Pago no conectado",
      openTeachAny: "Abrir tutorial →",
      teachPage: "Tutorial en tres partes", verdictPage: "Banco de veredictos",
      teachSub: "Básico / Pro / Resonancia",
      teachBanner: "Tres partes: Básico (gratis) / Pro / Resonancia. Solo canon del autor.",
      teachFoot: "Tres partes: Básico (gratis) / Pro / Resonancia. Solo canon del autor.",
      backChart: "← Carta", unlockEnter: "Desbloquear autor", exit: "Salir",
      verdictTitle: "Resonancia clave · Banco de veredictos",
      verdictSub: "Siete ejes · índice · caminos · columnas de imagen · frases de esta carta. Siempre atar a esta carta. Sin etiquetas sueltas.",
      verdictLive: "Frases de esta carta",
      verdictNeedChart: "Calcule una carta primero, o lea los ejes abajo.",
      openChart: "Ir a la carta →",
      sevenTitle: "Siete ejes",
      catalogTitle: "Bibliotecas",
      xiangyiTitle: "Columnas imagen-habla",
      liveTitle: "Frases elegidas para esta carta",
      demoCase: "Caso por defecto · carta del autor",
      demoNote: "1973-10-15 mediodía · nace Cantón · vive Chicago · varón 甲 madera",
      tapePlay: "▶ Escuchar Q&A",
      tapePlaying: "⏸ Sonando…",
      tapeStop: "■ Parar",
      tapeGo: "Ver carta",
      tapeHint: "Prueba: ¿庚 ataca? · ¿ganancia o pérdida? · ¿辛 une? · no boca de hierro.",
      tapeNow: "Reproduciendo la grabación Q&A de la carta del autor.",
      tapeStopped: "Parado. Pulse otra vez o una pregunta.",
      defaultHint: "Carta del autor ya rellenada. Cámbiela y calcule.",
      shifuBlurb: "Método Zeisen · solo esta carta. Leyes de hierro y libro congelado. Sin modelo en la nube. Sin boca de hierro.",
      shifuAsk: "Preguntar",
      shifuListen: "▶ Oír",
      shifuPh: "Pregunte: ¿庚 ataca? ¿ganancia o pérdida?",
      download: "Descargar",
      downloadFull: "Zip del proyecto",
      downloadHint: "Guardar en este teléfono · sitio + motor + docs"
    },
    ja: {
      tagline: "全球真太陽時 · キー共鳴判局 · 2026-08-11",
      name: "氏名", gender: "性別", male: "男", female: "女",
      calendar: "暦", solar: "新暦", lunar: "旧暦", birthDate: "生年月日", time: "時刻",
      birthPlace: "出生地", standPlace: "現住地", lon: "経度", lat: "緯度",
      waterFire: "水火", trueSolar: "真太陽", on: "入", off: "切", paipan: "排 盤",
      tabInfo: "基本情報", tabChart: "排盤", tabPro: "専門", tabKey: "キー詳断", tabVip: "会員",
      water: "水", fire: "火", wood: "木", earth: "土", metal: "金",
      hub: "拠点", cases: "事例", layout: "場強", preface: "序",
      libTitle: "モデル全書", libParams: "パラメータと規則", libFlow: "判局の流れ",
      libKey: "キー · 断語", libCase: "事例 · 配置", libTeach: "教程 · 文書",
      canon: "典章", params: "パラメータ表", oProg: "O程序", pProg: "P程序", o7: "O7三合",
      kanju: "看局", report: "看盤レポート", globalRules: "全球規則", coldWarm: "寒暖",
      verdictBank: "断語庫", hecan: "合参", caseBack: "事例回測",
      teach: "教程", pricing: "料金", feed: "投餌総冊", docs: "文書",
      authorTitle: "著者", thanksTitle: "謝辞",
      authorBio: "澤森（Jason Li）——工学出身、命理の定量化へ。キー共鳴は令・地・生克・合冲刑害破をエネルギーと烈度に統一。パラメータは 2026-08-11 に凍結。",
      thanks: "家族と匿名の命主、初期テスター、lunar.js に感謝。理を見て禍を避ける助けになりますように。",
      reset: "↺ 再排",
      secBazi: "干支八字", fourPillars: "四柱", dayMaster: "日主",
      secWho: "命主", sexMale: "男", sexFemale: "女",
      zodiac: "十二支", sign: "星座", mingGong: "命宮", taiYuan: "胎元",
      secWhen: "時間 · 地点", trueSolarOff: "（真太陽オフ · 現地時計）",
      eotLabel: "真太陽時差", eotFmt: "{delta} 分（経差 {lon} + 均時差 {eot}）",
      customPlace: "カスタム", defaultBeijing: "（未入力→北京）", americas: "米州+1", south: "南半球",
      sameBirth: "出生地と同じ", wallClock: "壁時計", flowHour: "流時",
      secStrength: "日主強弱 · 旬空 · 日宜忌", dayXun: "日空", timeXun: "時空",
      dayYi: "日宜", dayJi: "日忌",
      wfNote: "|緯|/90→水、火=1−水。我/客の総量に入る（字条には入らない）。",
      wfBirthLat: "含有（出生緯度）",
      yearP: "年柱", monthP: "月柱", dayP: "日柱", timeP: "時柱",
      natalYear: "年", natalMonth: "月", natalDay: "日", natalTime: "時",
      liunian: "流年", dayun: "大運", xiaoyun: "小運", liuyue: "流月", liuri: "流日", liushi: "流時",
      natal: "原局", sync: "同期", age: "歳", lunarShort: "旧",
      pageUp: "上 · 原局運年", pageDn: "下 · 流月日時", pageBoth: "両頁",
      rowStar: "主星", rowGan: "天干", rowZhi: "地支", rowHide: "蔵干",
      rowYun: "星運", rowSit: "自坐", rowKong: "空亡", rowNayin: "納音",
      secPan: "四柱盤", shensha: "神煞（日）", lucky: "吉", unlucky: "凶",
      panNote: "干支は出生地に従う：米州は日柱+1、南半球は月支対冲。",
      secDayun: "大運", dayunNote: "大運×1.0、小運×1/8（2026-08-11）。現在約 {age} 歳。",
      secIndex: "パラメータバー · ①基礎 → ②専門 → ③キー", wfBirth: "水火（出生地）",
      stage1: "①基礎【初断】", stage2: "②専門【細断】", stage3: "③キー【詳断】",
      stage1Sub: "無料 · 作用前", stage2Sub: "有料 · 運前", stage3Sub: "二級 · 流層後",
      stage1Hint: "令地後、合冲生克の前。五行は足すだけ。地理は字バーに入らない。",
      stage2Hint: "原局の做功後、大運小運は未重ね。二次用忌はここ。正従／我客／家内外の身分は変わらない。",
      stage3Hint: "大運→小運→流年→流時。流局は各字1.0、命主との距離だけ。家外は流層＋現地。正従は変わらない。",
      stageHint: "一枚三档：①基礎【初断】→②専門【細断】→③キー【詳断】。未開の列は錠のみ、数は出さない。①②は出生地、③は現地。正従は変わらない。",
      tierBase: "①基礎【初断】", tierPro: "②専門【細断】", tierKey: "③キー【詳断】",
      tierBasePay: "無料", tierProPay: "有料", tierKeyPay: "二級",
      pageNow: "この頁", stageLock: "未開",
      tierSplitHint: "有料は三部：①基礎は無料の初断；②専門は有料の細断；③キーは二級の詳断。正従は変わらない。",
      paidProTitle: "②専門【細断】·有料（出生地→大運前）",
      paidKeyTitle: "③キー【詳断】·二級（流時で変化）",
      paidProLock: "🔒 ②専門は有料：格局 · 二次用忌 · 細断 · 字能 · 太極六親 · 教程。",
      paidKeyLock: "🔒 ③キーは二級：エネルギー · 烈度 · 表 · 心性功用 · 詳断 · 教程 · 師匠。",
      subGeju: "格局", subYong2: "第二次用忌（做功後·凍結二）", subXiduan: "細断",
      subTeachBP: "基礎＋専門教程", subTeachAll: "全部教程（基礎＋専門＋キー）",
      subShifu: "AI師匠（本盤 · 問答）",
      elZi: "五行（字帳・地理なし）",
      woTa: "我方 ∶ 客方（正従を断つ · 我＝印比 · 客＝食傷財官）",
      neiWai: "家内 ∶ 家外（家内＝自家の実量 · 家外＝利用できる資源）",
      woTaHint: "作用後の十神増減で夭寿・身体・能力を断つ。",
      neiWaiHint: "作用後は双方の増減と、その十神が自家と日主に利か敗か。",
      woTaGong: "我方∶客方（做功後）",
      neiWaiGong: "家内∶家外（作用後）",
      wo: "我方", ta: "客方", nei: "家内", wai: "家外",
      secElStatic: "五行バー（令地後 · 静）",
      secElLive: "五行バー（当時当地 · 柱序後）",
      elLiveNote: "玉ねぎに追随。烈度≠このエネルギー。",
      secYong: "定体正従 · 第一次名義用忌（凍結一）",
      zhengcong: "正従", bodyGuest: "体客", yong1: "第一次名義用神", ji1: "第一次名義忌神",
      dingTi: "定体正従", dingTiId: "身分は変わらない",
      gongNeng: "二次用忌", gongNengDeLi: "用忌が変わった",
      gongNengHint: "做功は用忌だけ変える。正従・我客・家内外は改めない。",
      yong1Hint: "凍結一は名義用忌。凍結二は做功後の実際用神。用忌だけ変わり得る。正従・我客・家内外は変わらない。",
      yong2: "第二次実際用神", ji2: "第二次実際忌神", orient2: "二次取向",
      yong2Hint: "第一次は定境。第二次は做功後。用忌だけ変わり得る。正従・我客・家内外は書き換えない。",
      lingDiEl: "令地後五行（字作用前・地理なし）",
      lingTwoHint: "令は一尺：旺1.5／相1.25／休0.75／囚⅞／死⅝。地＝令後×¼。層権令もこの級。合化は月支本気のみ（旺相化、休囚死絆）。二つの令と±1/8は廃止。",
      scaleHint: "エネルギーは強弱。烈度≥2は事顕。三尺を足し合わせない。",
      neiSanHint: "柱域：年月外・日時内。時間：流年→流時が外。空間：屋外／家屋／室内。",
      geoRemedyHint: "我党（定体印比）が 70% 未満になって初めて地理補救。用神が絆なら補っても無用。",
      hecanHint: "両盤三盤：年長の流年→流時を他盤に定格する。",
      secChu: "初断（基礎）",
      secLiu: "流年 · 小運（同期）",
      liuYmd: "流月／日／時",
      onionFollow: "一行：流時→流年（小運）→大運→年月日時。干上支下。既定は原局八字。左に滑ると流層。",
      secTeachBase: "基礎教程",
      teachBaseBlurb: "無料：干支 · 蔵干 · 十神 · 令地 · 正従 · 用忌。",
      openTeach: "基礎教程を開く →",
      nowFlow: "現地 · 流時", nowTime: "現時", nowPlace: "現地", lonlat: "経緯",
      syncNow: "現地/流時を同期", locateNow: "実地時刻", locating: "定位中…",
      stepBirth: "① 出生", stepDevice: "② 操作者", stepStand: "③ 現地",
      stepHint: "①出生の経緯時刻が原局指数。②パソコン／携帯の現在時地。③選んだ地点または経緯の現地時刻。三歩は内部同期し、③を変えると流層と各指数を再計算。",
      locateHint: "①出生時地 → ②操作者の現在時地 → ③都市または経緯でその地の壁時計。「同期」は手入力の時刻。「実地時刻」は②に戻す。",
      flowFour: "流時四柱：",
      birthBars: "出生地バー（無料）", standBars: "現地バー（無料）",
      wfStand: "水火（現地）", mwBirth: "金木", mwStand: "金木（現地）",
      elLing: "五行（令地後）", elFlow: "五行（現地流層）",
      woTaShort: "我方∶客方", woTaStand: "我方∶客方（現地）", neiWaiShort: "家内∶家外",
      teaserPro: "細断結論（プレビュー）",
      teaserProLine: "細断：",
      lockPro: "🔒 ②専門は有料：完全な格局／二次用忌／細断／字能／太極六親／教程。",
      ziNengTitle: "④ 干支蔵干エネルギー（五行·十神·我客·用忌·内外 · 運年の消長）",
      ziNengHint: "各字と蔵干は五行と十神を帯び、我客／用忌／内外に座る。運年の作用と地理総量で消長を見る。細事は時まで読める（的中率ではない）。地理は字条に入らない。鉄口は売らない。",
      taijiTitle: "⑤ 太極六親（該星／原宮を日主とし環境と消長を断つ）",
      taijiHint: "六親は該星または原宮の干支蔵干で原星を代表し、それを日主として太極変換する。印比＝我方、財官傷＝客方。本局は環境。本盤の正従は書き換えない。見星は即人ではない。鉄口は売らない。",
      tianYiHint: "身体は三次元の一方通行の短い時間線。意識は四次元を読めることがある。因果から逃れる者はいない。AIは構造を澄ませるだけ。531 の残りは心性と天意。鉄口なし。",
      teachBaseBtn: "基礎", teachProBtn: "専門教程", teachKeyBtn: "キー教程",
      teaserKey: "キー共鳴結論（プレビュー）",
      lockKey: "🔒 ③キーは二級：キー網／烈度／詳断／三部教程。",
      energy1: "パラメータバー · ①基礎 → ②専門 → ③キー",
      elAfterLing: "令地後（静）", elAfterKey: "共鳴後 · 原局静",
      elAfterPipe: "柱序後 · 当時当地（小運×1/8 · O5無橋）",
      inten2: "② キー烈度（事顕 ≥ 2.0）", noKeys: "キーなし",
      table3: "③ 総合表（合冲刑害破生克 · a · 烈度）",
      colCls: "類", colPair: "双方", colLayer: "層", colA: "a", colInt: "烈度", colMan: "顕",
      moreKeys: "全 {n} キー、烈度順に前 28。",
      tonggen: "通根：", windowNote: "成局窓：", formed: "成鍵", fallback2: "二字へ",
      detail4: "⑤ 詳断（キー共鳴·応期）",
      xgTitle: "④ 心性 vs 功用（隔位不作用 · 根気共振 · 庫中不出）",
      xg_xinXing: "先天の心性：", xg_gongYong: "実際の功用：", xg_xianHua: "最終の顕化：",
      xg_gongJie: "功用の結論：", xg_vaultBan: "庫中不透：", xg_yunStep: "第",
      xg_yunCuts: "大運の変局", xg_liveCuts: "当時当地 · 切断点",
      xg_yearBrief: "流年の做功",
      xg_sop: "断盤五歩（範例）",
      man: "【事顕】", latent: "【潜】", manBadge: "顕", flowBadge: "流",
      vipSet: "会員設定", checkoutOff: "決済未接続",
      openTeachAny: "教程を開く →",
      teachPage: "教程三部", verdictPage: "断語庫",
      teachSub: "基礎／専門／キー共鳴",
      teachBanner: "三部：基礎（無料）／専門／キー共鳴。著者典章のみ。",
      teachFoot: "三部：基礎（無料）／専門／キー共鳴。著者典章のみ。",
      backChart: "← 排盤", unlockEnter: "著者解除して入る", exit: "退出",
      verdictTitle: "キー共鳴 · 断語庫",
      verdictSub: "七維 · ペア指数 · 做功 · 象義 · 本盤の自動句。本盤に結び、孤立ラベル禁止。",
      verdictLive: "本盤の自動断語",
      verdictNeedChart: "先に排盤してから戻ると本盤の句が出る。下の総綱も読める。",
      openChart: "排盤へ →",
      sevenTitle: "断語七維",
      catalogTitle: "専属句庫",
      xiangyiTitle: "象義欄（図を見て話す）",
      liveTitle: "本盤の選句",
      demoCase: "既定事例 · 著者盤",
      demoNote: "1973-10-15 午時 · 広州生 · シカゴ在住 · 男",
      tapePlay: "▶ 問答録音を試聴",
      tapePlaying: "⏸ 再生中…",
      tapeStop: "■ 停止",
      tapeGo: "全盤を見る",
      tapeHint: "試聴：庚は克つか · 利か敗か · 辛は合身か · 鉄口なし。",
      tapeNow: "著者盤の問答録音を再生中。",
      tapeStopped: "停止。再試聴するか、一問を押す。",
      defaultHint: "著者盤を初期入力済み。変えてから排盤可。",
      shifuBlurb: "澤森の断盤 · 本盤のみ。鉄律と凍結帳本。雲の大模型なし。鉄口なし。",
      shifuAsk: "師匠に問う",
      shifuListen: "▶ 聴く",
      shifuPh: "本盤を問う：庚は克つか？利か敗か？",
      download: "ダウンロード",
      downloadFull: "全工程の圧縮包",
      downloadHint: "この端末へ保存 · サイト＋エンジン＋文書"
    },
    ar: {
      tagline: "التوقيت الشمسي الحقيقي · حكم رنين المفاتيح · 2026-08-11",
      name: "الاسم", gender: "الجنس", male: "ذكر", female: "أنثى",
      calendar: "التقويم", solar: "ميلادي", lunar: "قمري", birthDate: "الميلاد", time: "الوقت",
      birthPlace: "مكان الولادة", standPlace: "المدينة الحالية", lon: "الطول", lat: "العرض",
      waterFire: "ماء/نار", trueSolar: "شمسي حقيقي", on: "تشغيل", off: "إيقاف", paipan: "احسب",
      tabInfo: "معلومات", tabChart: "اللوحة", tabPro: "احترافي", tabKey: "رنين", tabVip: "عضوية",
      water: "ماء", fire: "نار", wood: "خشب", earth: "تراب", metal: "معدن",
      hub: "المركز", cases: "حالات", layout: "حقل", preface: "مقدمة",
      libTitle: "النموذج الكامل", libParams: "معاملات وقواعد", libFlow: "مسار الحكم",
      libKey: "مفاتيح · أحكام", libCase: "حالات · تخطيط", libTeach: "دروس · وثائق",
      canon: "القانون", params: "جدول", oProg: "برنامج O", pProg: "برنامج P", o7: "O7 ثلاثي",
      kanju: "قراءة اللوحة", report: "تقرير", globalRules: "قواعد عالمية", coldWarm: "برد/حر",
      verdictBank: "بنك الأحكام", hecan: "لوحات مشتركة", caseBack: "اختبار رجعي",
      teach: "الدرس", pricing: "الأسعار", feed: "القانون", docs: "وثائق",
      authorTitle: "عن المؤلف", thanksTitle: "شكر",
      authorBio: "جيسون لي (تسه سِن) — مهندس انتقل إلى قياس لوحات القدر. رنين المفاتيح يوحّد الفصل والأرض والتوليد/السيطرة في طاقة وشدة قابلين للحساب. جُمّدت المعاملات في 2026-08-11.",
      thanks: "شكرًا للعائلة وأصحاب الحالات المجهولين والمختبرين الأوائل وlunar.js. عسى أن يعين على فهم البنية واتقاء الأذى.",
      reset: "↺ أعد الحساب",
      secBazi: "الأعمدة الأربعة", fourPillars: "الأعمدة الأربعة", dayMaster: "سيد اليوم",
      secWho: "صاحب اللوحة", sexMale: "ذكر", sexFemale: "أنثى",
      zodiac: "الحيوان", sign: "البرج", mingGong: "قصر مينغ", taiYuan: "تاي يوان",
      secWhen: "الوقت · المكان", trueSolarOff: "(الشمسي الحقيقي مغلق · ساعة الجدار)",
      eotLabel: "فرق شمسي", eotFmt: "{delta} د (طول {lon} + معادلة {eot})",
      customPlace: "مخصص", defaultBeijing: "(فارغ → بكين)", americas: "الأمريكتان +1", south: "الجنوب",
      sameBirth: "نفس الولادة", wallClock: "ساعة", flowHour: "ساعة جارية",
      secStrength: "القوة · الفراغ · يي/جي", dayXun: "فراغ اليوم", timeXun: "فراغ الساعة",
      dayYi: "يي اليوم", dayJi: "جي اليوم",
      wfNote: "|العرض|/90 → ماء، نار = 1−ماء.",
      wfBirthLat: "الحصة (عرض الولادة)",
      yearP: "سنة", monthP: "شهر", dayP: "يوم", timeP: "ساعة",
      natalYear: "سنة", natalMonth: "شهر", natalDay: "يوم", natalTime: "ساعة",
      liunian: "سنة جارية", dayun: "حظ كبير", xiaoyun: "حظ صغير", liuyue: "شهر جار", liuri: "يوم جار", liushi: "ساعة جارية",
      natal: "الأصل", sync: "مزامنة", age: "سنة", lunarShort: "ق",
      pageUp: "أعلى · أصل/حظ/سنة", pageDn: "أسفل · شهر/يوم/ساعة", pageBoth: "كلاهما",
      rowStar: "نجم", rowGan: "جذع", rowZhi: "فرع", rowHide: "مخفي",
      rowYun: "مرحلة", rowSit: "جلوس", rowKong: "فراغ", rowNayin: "ناين",
      secPan: "لوحة الأعمدة", shensha: "أرواح اليوم", lucky: "يمن", unlucky: "نحس",
      panNote: "الجذوع تتبع مكان الولادة: الأمريكتان +1، الجنوب يعكس فرع الشهر.",
      secDayun: "دورات الحظ", dayunNote: "الحظ ×1.0؛ الصغير ×1/8. العمر ≈ {age}.",
      secIndex: "أشرطة · ① أساس → ② احتراف → ③ رنين", wfBirth: "ماء/نار (ولادة)",
      stage1: "① أساس [أول]", stage2: "② احتراف [تفصيل]", stage3: "③ رنين [كامل]",
      stage1Sub: "مجاني · قبل العمل", stage2Sub: "مدفوع · قبل الحظ", stage3Sub: "المستوى 2 · بعد التدفق",
      stage1Hint: "بعد الفصل/الأرض وقبل الاتحاد/الصدام. العناصر تُجمع فقط. المكان لا يدخل أشرطة الجذوع.",
      stage2Hint: "بعد عمل الأصل وقبل الحظ. هنا يُقرأ النافع/المحذور 2. هوية النمط / أنا-ضيف / داخل-خارج لا تتغير.",
      stage3Hint: "الحظ → الصغير → السنة→الساعة. التدفق كل حرف 1.0 × المسافة إلى الأصل. الخارج يضيف التدفق + المدينة. النمط لا يتغير.",
      stageHint: "رسم واحد وثلاثة أجزاء مدفوعة: ① أساس → ② احتراف → ③ رنين. الأعمدة المغلقة تخفي الأرقام. ①② الولادة؛ ③ المدينة. النمط لا يتغير.",
      tierBase: "① أساس [أول]", tierPro: "② احتراف [تفصيل]", tierKey: "③ رنين [كامل]",
      tierBasePay: "مجاني", tierProPay: "مدفوع", tierKeyPay: "المستوى 2",
      pageNow: "هذه الصفحة", stageLock: "مغلق",
      tierSplitHint: "المحتوى المدفوع ثلاثة أجزاء: ① الأساس مجاني؛ ② الاحتراف مدفوع؛ ③ الرنين مستوى 2. النمط لا يتغير.",
      paidProTitle: "② احتراف [تفصيل] · مدفوع",
      paidKeyTitle: "③ رنين [كامل] · المستوى 2",
      paidProLock: "🔒 ② احتراف مدفوع: النمط · النافع 2 · الأسطر · الطاقة · Taiji · الدروس.",
      paidKeyLock: "🔒 ③ رنين مستوى 2: الطاقة · الشدة · الجدول · الطبع · الآجال · الدروس · المعلم.",
      subGeju: "النمط", subYong2: "نافع/محذور 2", subXiduan: "أسطر احترافية",
      subTeachBP: "دروس الأساس + الاحتراف", subTeachAll: "كل الدروس (أساس + احتراف + رنين)",
      subShifu: "معلم الذكاء (هذه اللوحة)",
      elZi: "العناصر الخمس (الجذوع · بلا مكان)",
      woTa: "أنا ∶ الضيف (للحكم على 正从)",
      neiWai: "داخل ∶ خارج (الداخل = مقدار الأسرة · الخارج = موارد قابلة للاستعمال)",
      woTaHint: "بعد العمل تُحكم الزيادة/النقص على العمر والجسد والقدرة.",
      neiWaiHint: "بعد العمل: زيادة/نقص الطرفين ونفع/ضرر كل إله للأسرة ولسيد اليوم.",
      woTaGong: "أنا∶ضيف (بعد العمل)",
      neiWaiGong: "داخل∶خارج (بعد العمل)",
      wo: "أنا", ta: "الضيف", nei: "داخل", wai: "خارج",
      secElStatic: "أشرطة العناصر (بعد الفصل · ساكن)",
      secElLive: "أشرطة العناصر (هنا والآن)",
      elLiveNote: "يتبع البصلة. الشدة ≠ هذه الطاقة.",
      secYong: "定体 · نافع/محذور اسمي 1",
      zhengcong: "النمط", bodyGuest: "أنا/ضيف", yong1: "نافع اسمي 1", ji1: "محذور اسمي 1",
      dingTi: "定体", dingTiId: "الهوية لا تتغيّر",
      gongNeng: "نافع/محذور 2", gongNengDeLi: "تغيّر النافع/المحذور",
      gongNengHint: "العمل يغيّر النافع/المحذور فقط. 正从 و我客 و家内外 لا.",
      yong1Hint: "التجميد 1 اسمي. التجميد 2 فعلي بعد العمل. النافع/المحذور وحده قد ينقلب؛ 正从 و我客 و家内外 لا.",
      yong2: "نافع فعلي 2", ji2: "محذور فعلي 2", orient2: "توجه 2",
      yong2Hint: "النافع 1 = 定境. النافع 2 = بعد العمل. النافع/المحذور وحده قد ينقلب؛ 正从 و我客 و家内外 لا.",
      lingDiEl: "العناصر الخمس بعد الفصل/الأرض (بلا مكان)",
      lingTwoHint: "مقياس 令 واحد: 旺1.5／相1.25／休0.75／囚⅞／死⅝. الأرض = بعد 令 ×¼. أمر الطبقة بهذا المقياس. الاتحاد بفرع الشهر فقط (旺相 يحوّل، 休囚死 يقيّد). أُلغي المقياسان و±1/8.",
      scaleHint: "الطاقة قوة. الشدة ≥2 تجلّ. لا تجمع المقاييس الثلاثة.",
      neiSanHint: "الأعمدة: سنة/شهر خارج · يوم/ساعة داخل. الزمن: الجريان خارج.",
      geoRemedyHint: "علاج المكان فقط إن سقط معسكر 定体 تحت 70%.",
      hecanHint: "لوحتان/ثلاث: جريان الأكبر يختم الأخريات.",
      secChu: "القراءة الأولى",
      secLiu: "سنة جارية · حظ صغير",
      liuYmd: "شهر / يوم / ساعة",
      onionFollow: "صف واحد: ساعة→سنة (حظ صغير)→حظ→أصل. الجذع فوق الفرع. الافتراضي ثمانية أحرف أصلية؛ اسحب يسارًا للطبقات.",
      secTeachBase: "درس الأساس",
      teachBaseBlurb: "مجاني: جذوع · مخفي · عشرة آلهة · فصل/أرض · نمط · نافع/محذور.",
      openTeach: "افتح درس الأساس →",
      nowFlow: "المدينة · الساعة الجارية", nowTime: "الآن", nowPlace: "المدينة", lonlat: "طول/عرض",
      syncNow: "زامِن", locateNow: "الوقت الميداني", locating: "جارٍ تحديد الموقع…",
      stepBirth: "① الولادة", stepDevice: "② المشغّل", stepStand: "③ المكان",
      stepHint: "① طول/عرض/وقت الولادة يثبت مؤشرات الأصل. ② هنا والآن للهاتف/الحاسوب. ③ المدينة أو الإحداثيات المختارة وساعتها المحلية. الخطوات الثلاث تتزامن؛ تغيير ③ يعيد حساب التدفق والمؤشرات.",
      locateHint: "① الولادة → ② المشغّل → ③ المدينة أو الإحداثيات تكتب ساعتها. المزامنة تكتب الوقت المدخل. الوقت الميداني يعود إلى ②.",
      flowFour: "أعمدة الساعة: ",
      birthBars: "أشرطة الولادة (مجاني)", standBars: "أشرطة المدينة (مجاني)",
      wfStand: "ماء/نار (مدينة)", mwBirth: "معدن/خشب", mwStand: "معدن/خشب (مدينة)",
      elLing: "العناصر الخمس", elFlow: "العناصر (تدفق)",
      woTaShort: "أنا∶ضيف", woTaStand: "أنا∶ضيف (مدينة)", neiWaiShort: "داخل∶خارج",
      teaserPro: "قراءة احترافية (معاينة)",
      teaserProLine: "احترافي: ",
      lockPro: "🔒 ② احتراف مدفوع: النمط الكامل والدروس ومدار Taiji.",
      ziNengTitle: "④ طاقة الجذوع والمخفي (عنصر · إله · أنا/ضيف · نافع/محذور · داخل/خارج)",
      ziNengHint: "كل جذع ومخفي يحمل عنصره وإلهه، ويجلس في أنا/ضيف ونافع/محذور وداخل/خارج. عمل السنة والمكان يغيّران المقدار. تُقرأ التفاصيل إلى الساعة — ليست نسبة إصابة. المكان لا يدخل شريط الجذع. بلا فم حديدي.",
      taijiTitle: "⑤ Taiji الأقارب الستة (النجم / القصر كسيد اليوم · البيئة والتغير)",
      taijiHint: "القريب هو النجم أو جذوع القصر. عامله كسيد اليوم. الختم+القرين = أنا؛ المال+الضابط+الخرج = ضيف. هذه اللوحة هي البيئة. لا تُعدّل 正从. النجم ليس شخصًا. بلا فم حديدي.",
      tianYiHint: "الجسد خط زمني ثلاثي الأبعاد في اتجاه واحد. الوعي قد يقرأ أربعة أبعاد. لا أحد يفلت من السببية. الذكاء الاصطناعي يوضح البنية فقط. بقية 531 طبع وسماء. بلا فم حديدي.",
      teachBaseBtn: "أساس", teachProBtn: "درس احترافي", teachKeyBtn: "درس الرنين",
      teaserKey: "حكم الرنين (معاينة)",
      lockKey: "🔒 ③ رنين مستوى 2: شبكة المفاتيح والدروس الثلاثة.",
      energy1: "أشرطة · ① أساس → ② احتراف → ③ رنين",
      elAfterLing: "بعد الفصل (ساكن)", elAfterKey: "بعد الرنين · أصل",
      elAfterPipe: "بعد الأنبوب · هنا والآن",
      inten2: "② شدة المفتاح (≥ 2.0)", noKeys: "لا مفاتيح",
      table3: "③ جدول (اتحاد/صدام · a · شدة)",
      colCls: "صنف", colPair: "زوج", colLayer: "طبقة", colA: "a", colInt: "شدة", colMan: "ظهور",
      moreKeys: "{n} مفتاحًا؛ أعلى 28.",
      tonggen: "جذر: ", windowNote: "نافذة: ", formed: "تكوّن", fallback2: "عودة لزوج",
      detail4: "⑤ تفصيل (رنين · أجل)",
      xgTitle: "④ الطبع مقابل الوظيفة (لا فعل عبر فجوة · رنين الجذر · الخزانة لا تخرج)",
      xg_xinXing: "الطبع الفطري: ", xg_gongYong: "الوظيفة الفعلية: ", xg_xianHua: "كيف يظهر: ",
      xg_gongJie: "حكم الوظيفة: ", xg_vaultBan: "مخفي في الخزانة بلا بروز: ", xg_yunStep: "خطوة ",
      xg_yunCuts: "تحولات الحظ · نقاط القطع", xg_liveCuts: "هنا والآن · نقاط القطع",
      xg_yearBrief: "عمل سنة الجريان",
      xg_sop: "الحكم في خمس خطوات",
      man: "[ظهور] ", latent: "[كامن] ", manBadge: "ظهور", flowBadge: "جريان",
      vipSet: "العضوية", checkoutOff: "الدفع غير متصل",
      openTeachAny: "افتح الدرس →",
      teachPage: "الدرس في ثلاثة أجزاء", verdictPage: "بنك الأحكام",
      teachSub: "أساس / احترافي / رنين",
      teachBanner: "ثلاثة أجزاء: أساس (مجاني) / احترافي / رنين. قانون المؤلف فقط.",
      teachFoot: "ثلاثة أجزاء: أساس (مجاني) / احترافي / رنين. قانون المؤلف فقط.",
      backChart: "← اللوحة", unlockEnter: "افتح المؤلف وادخل", exit: "خروج",
      verdictTitle: "رنين المفاتيح · بنك الأحكام",
      verdictSub: "سبعة محاور · مؤشر · مسارات · أعمدة الصورة · جمل هذه اللوحة. اربط دائمًا بهذه اللوحة.",
      verdictLive: "جمل هذه اللوحة",
      verdictNeedChart: "احسب لوحة أولًا، أو اقرأ المحاور أدناه.",
      openChart: "إلى اللوحة →",
      sevenTitle: "المحاور السبعة",
      catalogTitle: "المكتبات",
      xiangyiTitle: "أعمدة الصورة-الكلام",
      liveTitle: "الجمل المختارة لهذه اللوحة",
      demoCase: "الحالة الافتراضية · لوحة المؤلف",
      demoNote: "1973-10-15 الظهر · وُلد في قوانغتشو · يسكن شيكاغو · ذكر 甲 خشب",
      tapePlay: "▶ استمع لحوار السؤال والجواب",
      tapePlaying: "⏸ يُشغَّل…",
      tapeStop: "■ قف",
      tapeGo: "افتح اللوحة",
      tapeHint: "تجربة: هل 庚 يهاجم · ربح أم خسارة · هل 辛 يتحد · لا فم حديدي.",
      tapeNow: "تشغيل تسجيل سؤال وجواب لوحة المؤلف.",
      tapeStopped: "توقف. أعد التشغيل أو اضغط سؤالًا.",
      defaultHint: "لوحة المؤلف معبأة. غيّرها ثم احسب.",
      shifuBlurb: "طريقة تسه سِن · هذه اللوحة فقط. قوانين الحديد والدفتر المجمد. بلا نموذج سحابي. بلا فم حديدي.",
      shifuAsk: "اسأل",
      shifuListen: "▶ استمع",
      shifuPh: "اسأل هذه اللوحة: هل 庚 يهاجم؟ ربح أم خسارة؟",
      download: "تنزيل",
      downloadFull: "حزمة المشروع كاملة",
      downloadHint: "احفظ في هذا الهاتف · موقع + محرك + وثائق"
    }
  };

  var TERM = {
    zh: {
      "正格": "正格", "从弱": "从弱", "从强": "从强",
      "身强": "身强", "身弱": "身弱", "体客均衡": "体客均衡", "平衡": "平衡",
      "用客忌我": "用客忌我", "用我忌客": "用我忌客", "用忌轻": "用忌轻",
      "用忌看家内外做功": "用忌看家内外做功",
      "做功利自己与家内": "做功利自己与家内",
      "做功败自己与家内": "做功败自己与家内",
      "做功一利一败": "做功一利一败",
      "身弱极": "身弱极", "身强极": "身强极", "偏弱中和": "偏弱中和", "中和": "中和",
      "杀印相生": "杀印相生", "食伤生财": "食伤生财", "财官相生": "财官相生",
      "比劫夺财": "比劫夺财", "扶抑常规": "扶抑常规",
      "合": "合", "冲": "冲", "刑": "刑", "害": "害", "破": "破", "生": "生", "克": "克",
      "三合": "三合", "三会": "三会", "半合": "半合", "同字": "同字",
      "木": "木", "火": "火", "土": "土", "金": "金", "水": "水",
      "格局运转": "格局运转", "待核": "待核",
      "利忌偏多·需二级再辨": "利忌偏多·需二级再辨",
      "有利于用（生扶）": "有利于用（生扶）",
      "利于用（泄耗）": "利于用（泄耗）",
      "利忌·泄身": "利忌·泄身",
      "利于用": "利于用",
      "利忌·财官攻身": "利忌·财官攻身",
      "利忌·争合": "利忌·争合",
      "利于用（比劫）需防夺": "利于用（比劫）需防夺",
      "宜克泄耗疏通": "宜克泄耗疏通",
      "宜生扶护身": "宜生扶护身",
      "根气共振": "根气共振", "库中不透": "库中不透", "七杀化印": "七杀化印",
      "财坏印": "财坏印", "伤官制杀": "伤官制杀", "有情做功": "有情做功", "带病做功": "带病做功",
      "半利半败": "半利半败", "不克身": "不克身", "永不合身": "永不合身", "利": "利", "败": "败"
    },
    en: {
      "正格": "Zheng", "从弱": "Follow-weak", "从强": "Follow-strong",
      "身强": "Strong", "身弱": "Weak", "体客均衡": "Balanced", "平衡": "Balanced",
      "用客忌我": "Use guest / avoid self", "用我忌客": "Use self / avoid guest", "用忌轻": "soft useful/avoid",
      "用忌看家内外做功": "useful/avoid from inner-outer work",
      "做功利自己与家内": "work helps self and household",
      "做功败自己与家内": "work harms self and household",
      "做功一利一败": "work helps one, harms the other",
      "身弱极": "Extreme weak", "身强极": "Extreme strong", "偏弱中和": "Soft-weak mean", "中和": "Mean",
      "杀印相生": "Kill-resource generate", "食伤生财": "Output generates wealth", "财官相生": "Wealth-officer generate",
      "比劫夺财": "Peers seize wealth", "扶抑常规": "Ordinary support/drain",
      "合": "combine", "冲": "clash", "刑": "punish", "害": "harm", "破": "break", "生": "generate", "克": "control",
      "三合": "triple-combine", "三会": "triple-meet", "半合": "half-combine", "同字": "same-char",
      "木": "Wood", "火": "Fire", "土": "Earth", "金": "Metal", "水": "Water",
      "格局运转": "pattern running", "待核": "to check",
      "利忌偏多·需二级再辨": "leans avoid · re-check at level 2",
      "有利于用（生扶）": "favors useful (support)",
      "利于用（泄耗）": "favors useful (drain/spend)",
      "利忌·泄身": "favors avoid · drains body",
      "利于用": "favors useful",
      "利忌·财官攻身": "favors avoid · wealth/officer attack body",
      "利忌·争合": "favors avoid · contention",
      "利于用（比劫）需防夺": "favors useful (peers) · watch seizure",
      "宜克泄耗疏通": "prefer control/drain/spend to open",
      "宜生扶护身": "prefer generate/support to protect",
      "根气共振": "root-qi resonance", "库中不透": "vault hidden, not out", "七杀化印": "kill transforms to resource",
      "财坏印": "wealth spoils resource", "伤官制杀": "hurting officer pins kill", "有情做功": "affectionate work", "带病做功": "work while ill",
      "半利半败": "half gain, half loss", "不克身": "does not attack the body", "永不合身": "never combines with the body", "利": "gain", "败": "loss"
    },
    es: {
      "正格": "Zheng", "从弱": "Seguir-débil", "从强": "Seguir-fuerte",
      "身强": "Fuerte", "身弱": "Débil", "体客均衡": "Equilibrio", "平衡": "Equilibrio",
      "用客忌我": "Usar huésped / evitar yo", "用我忌客": "Usar yo / evitar huésped", "用忌轻": "útil/evitar suave",
      "用忌看家内外做功": "útil/evitar según obra casa-adentro/afuera",
      "做功利自己与家内": "la obra favorece al yo y a la casa",
      "做功败自己与家内": "la obra daña al yo y a la casa",
      "做功一利一败": "una parte gana, la otra pierde",
      "身弱极": "Débil extremo", "身强极": "Fuerte extremo", "偏弱中和": "Media débil", "中和": "Media",
      "杀印相生": "Kill-sello", "食伤生财": "Output→riqueza", "财官相生": "Riqueza-oficial",
      "比劫夺财": "Pares quitan riqueza", "扶抑常规": "Apoyo/drenaje ordinario",
      "合": "unión", "冲": "choque", "刑": "castigo", "害": "daño", "破": "rotura", "生": "genera", "克": "controla",
      "三合": "triple unión", "三会": "triple encuentro", "半合": "media unión", "同字": "mismo signo",
      "木": "Madera", "火": "Fuego", "土": "Tierra", "金": "Metal", "水": "Agua",
      "格局运转": "obra del patrón", "待核": "por revisar",
      "利忌偏多·需二级再辨": "inclina a evitar · revisar nivel 2",
      "有利于用（生扶）": "favorece útil (apoyo)",
      "利于用（泄耗）": "favorece útil (drenar)",
      "利忌·泄身": "favorece evitar · drena el cuerpo",
      "利于用": "favorece útil",
      "利忌·财官攻身": "favorece evitar · riqueza/oficial atacan",
      "利忌·争合": "favorece evitar · contienda",
      "利于用（比劫）需防夺": "favorece útil (pares) · evite el robo",
      "宜克泄耗疏通": "prefiera controlar/drenar",
      "宜生扶护身": "prefiera generar/apoyar",
      "根气共振": "resonancia de raíz", "库中不透": "bóveda no sale", "七杀化印": "kill→sello",
      "财坏印": "riqueza daña sello", "伤官制杀": "output sujeta kill", "有情做功": "obra con afecto", "带病做功": "obra enferma",
      "半利半败": "mitad ganancia, mitad pérdida", "不克身": "no ataca el cuerpo", "永不合身": "nunca une al cuerpo", "利": "ganancia", "败": "pérdida"
    },
    ja: {
      "正格": "正格", "从弱": "従弱", "从强": "従強",
      "身强": "身強", "身弱": "身弱", "体客均衡": "体客均衡", "平衡": "平衡",
      "用客忌我": "用客忌我", "用我忌客": "用我忌客", "用忌轻": "用忌軽",
      "用忌看家内外做功": "用忌は家内外の做功を見る",
      "做功利自己与家内": "做功が自身と家内に利す",
      "做功败自己与家内": "做功が自身と家内を敗る",
      "做功一利一败": "一利一敗",
      "身弱极": "身弱極", "身强极": "身強極", "偏弱中和": "偏弱中和", "中和": "中和",
      "杀印相生": "殺印相生", "食伤生财": "食傷生財", "财官相生": "財官相生",
      "比劫夺财": "比劫奪財", "扶抑常规": "扶抑通常",
      "合": "合", "冲": "冲", "刑": "刑", "害": "害", "破": "破", "生": "生", "克": "克",
      "三合": "三合", "三会": "三会", "半合": "半合", "同字": "同字",
      "木": "木", "火": "火", "土": "土", "金": "金", "水": "水",
      "格局运转": "格局の運転", "待核": "要確認",
      "利忌偏多·需二级再辨": "忌に偏り二次再辨",
      "有利于用（生扶）": "用に利す（生扶）",
      "利于用（泄耗）": "用に利す（泄耗）",
      "利忌·泄身": "忌に利す·泄身",
      "利于用": "用に利す",
      "利忌·财官攻身": "忌に利す·財官攻身",
      "利忌·争合": "忌に利す·争合",
      "利于用（比劫）需防夺": "用に利す（比劫）奪を防げ",
      "宜克泄耗疏通": "克泄耗で疏通",
      "宜生扶护身": "生扶で護身",
      "根气共振": "根気共振", "库中不透": "庫中不透", "七杀化印": "殺印化",
      "财坏印": "財壞印", "伤官制杀": "傷官制殺", "有情做功": "有情の做功", "带病做功": "病を帯びた做功",
      "半利半败": "半利半敗", "不克身": "身を克たず", "永不合身": "永く合身せず", "利": "利", "败": "敗"
    },
    ar: {
      "正格": "تشنغ", "从弱": "اتباع-ضعيف", "从强": "اتباع-قوي",
      "身强": "قوي", "身弱": "ضعيف", "体客均衡": "متوازن", "平衡": "متوازن",
      "用客忌我": "استخدم الضيف / اجتنب الأنا", "用我忌客": "استخدم الأنا / اجتنب الضيف", "用忌轻": "نافع/محذور خفيف",
      "用忌看家内外做功": "النفع/المحذور من عمل الداخل والخارج",
      "做功利自己与家内": "العمل ينفع الأنا والبيت",
      "做功败自己与家内": "العمل يضر الأنا والبيت",
      "做功一利一败": "نفع في جهة وضرر في أخرى",
      "身弱极": "ضعف أقصى", "身强极": "قوة قصوى", "偏弱中和": "وسط مائل للضعف", "中和": "وسط",
      "杀印相生": "قتل-ختم يولّد", "食伤生财": "الخرج يولّد الثروة", "财官相生": "ثروة-منصب",
      "比劫夺财": "الأقران ينتزعون الثروة", "扶抑常规": "دعم/صرف عادي",
      "合": "اتحاد", "冲": "صدام", "刑": "عقاب", "害": "أذى", "破": "كسر", "生": "توليد", "克": "سيطرة",
      "三合": "اتحاد ثلاثي", "三会": "لقاء ثلاثي", "半合": "نصف اتحاد", "同字": "نفس الرمز",
      "木": "خشب", "火": "نار", "土": "تراب", "金": "معدن", "水": "ماء",
      "格局运转": "تشغيل النمط", "待核": "للمراجعة",
      "利忌偏多·需二级再辨": "يميل للمحذور · راجع المستوى 2",
      "有利于用（生扶）": "يؤيد النافع (دعم)",
      "利于用（泄耗）": "يؤيد النافع (صرف)",
      "利忌·泄身": "يؤيد المحذور · يصرف الجسد",
      "利于用": "يؤيد النافع",
      "利忌·财官攻身": "يؤيد المحذور · ثروة/منصب يهاجمان",
      "利忌·争合": "يؤيد المحذور · نزاع",
      "利于用（比劫）需防夺": "يؤيد النافع (أنداد) · احذر السلب",
      "宜克泄耗疏通": "فضّل السيطرة/الصرف",
      "宜生扶护身": "فضّل التوليد/الدعم",
      "根气共振": "رنين جذر", "库中不透": "الخزانة لا تخرج", "七杀化印": "القتل يصير ختماً",
      "财坏印": "الثروة تفسد الختم", "伤官制杀": "الجرح يقيّد القتل", "有情做功": "عمل ودود", "带病做功": "عمل عليل",
      "半利半败": "نصف ربح ونصف خسارة", "不克身": "لا يهاجم الجسد", "永不合身": "لا يتحد مع الجسد أبدًا", "利": "ربح", "败": "خسارة"
    }
  };

  var SS = {
    "比肩": { zh: "比肩", en: "Peer", es: "Par", ja: "比肩", ar: "ندّ" },
    "劫财": { zh: "劫财", en: "Rob wealth", es: "Roba riqueza", ja: "劫財", ar: "سلب الثروة" },
    "食神": { zh: "食神", en: "Output", es: "Output", ja: "食神", ar: "خرج" },
    "伤官": { zh: "伤官", en: "Hurting officer", es: "Oficial herido", ja: "傷官", ar: "جرح المنصب" },
    "偏财": { zh: "偏财", en: "Indirect wealth", es: "Riqueza indirecta", ja: "偏財", ar: "ثروة غير مباشرة" },
    "正财": { zh: "正财", en: "Direct wealth", es: "Riqueza directa", ja: "正財", ar: "ثروة مباشرة" },
    "七杀": { zh: "七杀", en: "Seven killings", es: "Siete muertes", ja: "七殺", ar: "القتل السبعة" },
    "正官": { zh: "正官", en: "Direct officer", es: "Oficial directo", ja: "正官", ar: "منصب مباشر" },
    "偏印": { zh: "偏印", en: "Indirect resource", es: "Sello indirecto", ja: "偏印", ar: "ختم غير مباشر" },
    "正印": { zh: "正印", en: "Direct resource", es: "Sello directo", ja: "正印", ar: "ختم مباشر" },
    "日主": { zh: "日主", en: "Day master", es: "Dueño del día", ja: "日主", ar: "سيد اليوم" }
  };

  var CS = {
    "长生": { zh: "长生", en: "Birth", es: "Nacer", ja: "長生", ar: "ولادة" },
    "沐浴": { zh: "沐浴", en: "Bath", es: "Baño", ja: "沐浴", ar: "حمام" },
    "冠带": { zh: "冠带", en: "Cap", es: "Gorro", ja: "冠帯", ar: "تاج" },
    "临官": { zh: "临官", en: "Office", es: "Oficio", ja: "臨官", ar: "منصب" },
    "帝旺": { zh: "帝旺", en: "Peak", es: "Cima", ja: "帝旺", ar: "ذروة" },
    "衰": { zh: "衰", en: "Decline", es: "Declive", ja: "衰", ar: "ضعف" },
    "病": { zh: "病", en: "Ill", es: "Enfermo", ja: "病", ar: "مرض" },
    "死": { zh: "死", en: "Death", es: "Muerte", ja: "死", ar: "موت" },
    "墓": { zh: "墓", en: "Tomb", es: "Tumba", ja: "墓", ar: "قبر" },
    "绝": { zh: "绝", en: "Extinct", es: "Extinto", ja: "絶", ar: "انقطاع" },
    "胎": { zh: "胎", en: "Fetus", es: "Feto", ja: "胎", ar: "جنين" },
    "养": { zh: "养", en: "Nourish", es: "Nutrir", ja: "養", ar: "تغذية" }
  };

  var VERDICT = {
    pairing: {
      zh: "【配对指数】{band} · BI={bi}（{biLabel}）· {orient} · 用[{yong}] 忌[{ji}]",
      en: "[Pairing] {band} · BI={bi} ({biLabel}) · {orient} · useful[{yong}] avoid[{ji}]",
      es: "[Índice] {band} · BI={bi} ({biLabel}) · {orient} · útil[{yong}] evitar[{ji}]",
      ja: "【ペア指数】{band} · BI={bi}（{biLabel}）· {orient} · 用[{yong}] 忌[{ji}]",
      ar: "[مؤشر] {band} · BI={bi} ({biLabel}) · {orient} · نافع[{yong}] محذور[{ji}]"
    },
    work: {
      zh: "【做功】{name} → {jx}",
      en: "[Work] {name} → {jx}",
      es: "[Obra] {name} → {jx}",
      ja: "【做功】{name} → {jx}",
      ar: "[عمل] {name} → {jx}"
    },
    manifest: {
      zh: "【键·事显】{list} → 烈度≥2.0 主导本盘应期与显象。",
      en: "[Keys · manifest] {list} → intensity ≥ 2.0 drives timing and images on this chart.",
      es: "[Claves · manifiesto] {list} → intensidad ≥ 2.0 marca plazos e imágenes.",
      ja: "【キー·事顕】{list} → 烈度≥2.0 が応期と顕象を主導。",
      ar: "[مفاتيح · ظهور] {list} → الشدة ≥ 2.0 تقود الأجل والصورة."
    },
    latent: {
      zh: "【键·潜】{list} → 未达事显(＜2.0)，逢岁运催化方显。",
      en: "[Keys · latent] {list} → below 2.0; needs luck/year to show.",
      es: "[Claves · latente] {list} → <2.0; espera suerte/año.",
      ja: "【キー·潜】{list} → 事顕未満（＜2.0）。歳運で顕化。",
      ar: "[مفاتيح · كامن] {list} → دون 2.0؛ ينتظر الحظ/السنة."
    },
    root: {
      zh: "【通根】日/干本根：{list} → 有根不弱，得地气承载。",
      en: "[Root] day/stem roots: {list} → rooted, carried by ground qi.",
      es: "[Raíz] raíces: {list} → con raíz, no débil.",
      ja: "【通根】日/干の根：{list} → 根あれば弱からず。",
      ar: "[جذر] جذور: {list} → له جذر فلا يضعف."
    },
    mid: {
      zh: "【专属·{band}】BI={bi} · 十神份额 印{yin} 比{biJie} 食伤{shi} 财{cai} 官杀{guan} · 冻结{orient} · 做功{jx}",
      en: "[Special · {band}] BI={bi} · shares resource {yin} peer {biJie} output {shi} wealth {cai} officer {guan} · freeze {orient} · work {jx}",
      es: "[Especial · {band}] BI={bi} · sello {yin} par {biJie} output {shi} riqueza {cai} oficial {guan} · {orient} · {jx}",
      ja: "【専属·{band}】BI={bi} · 印{yin} 比{biJie} 食傷{shi} 財{cai} 官殺{guan} · {orient} · {jx}",
      ar: "[خاص · {band}] BI={bi} · ختم {yin} ند {biJie} خرج {shi} ثروة {cai} منصب {guan} · {orient} · {jx}"
    },
    midNote: {
      zh: "中和带禁套极带库；句内须含 BI·十神份额·冻结用忌·做功吉凶；相对本盘日主。",
      en: "Mean band: do not borrow extreme libraries. Each line must carry BI, ten-god shares, frozen useful/avoid, and work luck. Relative to this day master.",
      es: "Banda media: no use bibliotecas extremas. Cada frase lleva BI, cuotas, útil/evitar y obra. Relativo a este dueño del día.",
      ja: "中和帯は極帯庫を使わない。句に BI・十神シェア・凍結用忌・做功吉凶を入れる。本盤日主に相対。",
      ar: "الوسط: لا تستعر مكتبات الطرف. كل جملة تحمل BI والحصص والنافع/المحذور وعمل اللوحة. نسبةً لسيد هذا اليوم."
    },
    showTh: {
      zh: "【事显】烈度 {n} ≥ {th}，达事显阈值（烈度＝事显概率／幅度，≠五行能量条）。",
      en: "[Manifest] intensity {n} ≥ {th} (intensity = chance/amplitude of events, ≠ five-phase energy bars).",
      es: "[Manifiesto] intensidad {n} ≥ {th} (≠ barras de energía).",
      ja: "【事顕】烈度 {n} ≥ {th}（烈度＝事の確率／幅 ≠ 五行バー）。",
      ar: "[ظهور] الشدة {n} ≥ {th} (ليست أشرطة العناصر)."
    },
    hereNow: {
      zh: "【当时当地】条图与断语跟洋葱流层：年→时→运→流时；烈度只定事显，不改写五行总量。",
      en: "[Here and now] bars and lines follow the onion: year→hour→luck→hour-flow. Intensity only marks manifestation; it does not rewrite five-phase totals.",
      es: "[Aquí y ahora] barras y frases siguen la cebolla. La intensidad no reescribe el total de fases.",
      ja: "【当時当地】バーと断語は玉ねぎに従う。烈度は事顕だけ、五行合計は書き換えない。",
      ar: "[هنا والآن] الأشرطة والجمل تتبع البصلة. الشدة للظهور فقط ولا تعيد كتابة مجموع العناصر."
    },
    ruoSha: {
      zh: "【专属·杀印相生】杀重身弱，印星通关，化杀为权。压力傍身，贵气在「智」不在「力」。",
      en: "[Special · kill-resource] Heavy officer on a weak body; resource opens the pass and turns kill into authority. Pressure stays close. Nobility sits in wisdom, not force.",
      es: "[Especial · kill-sello] Oficial pesado, cuerpo débil; el sello abre el paso y vuelve el kill en autoridad. La nobleza está en la mente, no en la fuerza.",
      ja: "【専属·殺印相生】殺重く身弱、印が通関し殺を権に化す。貴は「智」にあり「力」にあらず。",
      ar: "[خاص · قتل-ختم] قتل ثقيل وجسد ضعيف؛ الختم يفتح الممر ويحوّل القتل إلى سلطان. الشرف في الحكمة لا في القوة."
    },
    ruoCai: {
      zh: "【专属·财旺耗身】富屋贫人，财多累身。账面富贵，囊中羞涩，守财比求财更难。",
      en: "[Special · wealth drains] Rich house, poor person. Too much wealth tires the body. Books look rich, the purse is thin. Keeping wealth is harder than seeking it.",
      es: "[Especial · riqueza] Casa rica, persona pobre. Demasiada riqueza cansa. Guardar es más difícil que buscar.",
      ja: "【専属·財旺耗身】富屋貧人。財多く身を累す。守財は求財より難。",
      ar: "[خاص · ثروة] بيت غني وشخص فقير. كثرة المال تُتعب الجسد. حفظ المال أصعب من طلبه."
    },
    ruoShi: {
      zh: "【专属·食伤泄身】才华横溢，但「才」亦耗身。表达欲越强，元气越伤，宜以印制约食伤。",
      en: "[Special · output drains] Talent overflows, yet talent also spends the body. The louder the expression, the more yuan-qi is hurt. Use resource to restrain output.",
      es: "[Especial · output] Talento de sobra, pero el talento gasta el cuerpo. Use el sello para frenar el output.",
      ja: "【専属·食傷泄身】才は溢れるが才も身を耗す。印で食傷を制せ。",
      ar: "[خاص · خرج] الموهبة تفيض وتُنفق الجسد. اكبح الخرج بالختم."
    },
    ruoBase: {
      zh: "【身弱极】BI≤0.3：宜生扶——印比为舟，忌再叠财官食伤攻身。",
      en: "[Extreme weak] BI≤0.3: generate and support — resource/peer are the boat. Do not stack more wealth/officer/output against the body.",
      es: "[Débil extremo] BI≤0.3: generar y apoyar. No apile riqueza/oficial/output contra el cuerpo.",
      ja: "【身弱極】BI≤0.3：生扶すべし。印比を舟とし、財官食傷の重ね攻めを忌む。",
      ar: "[ضعف أقصى] BI≤0.3: ولِّد وادعم. لا تُكدّس ثروة/منصب/خرجًا على الجسد."
    },
    qiangYin: {
      zh: "印比偏壅：贵人同事虽多，易滞重；宜食伤财官运疏通，忌再叠印比。",
      en: "Resource/peer too thick: many helpers, easy stagnation. Prefer output/wealth/officer luck; do not stack more resource/peer.",
      es: "Sello/par demasiado densos: muchos ayudantes, fácil estancamiento. Mejor output/riqueza/oficial.",
      ja: "印比が壅滞：貴人は多いが滞りやすい。食傷財官で疏通、印比の再重ねを忌む。",
      ar: "الختم/الند كثيفان: أعوان كثيرون وركود سهل. فضّل خرج/ثروة/منصبًا."
    },
    qiangShi: {
      zh: "用客·食伤有气：泄秀变现顺势；忌印运截流夺食。",
      en: "Use-guest · output has qi: draining talent into cash follows the current. Avoid resource luck that cuts the stream and seizes food.",
      es: "Usar huésped · output con qi: el talento se vuelve dinero. Evite suerte de sello que corte el cauce.",
      ja: "用客·食傷に気あり：泄秀の実現は順勢。印運の截流奪食を忌む。",
      ar: "استخدم الضيف · للخرج طاقة: تحويل الموهبة إلى مال مع التيار. اجتنب حظ الختم الذي يقطع المجرى."
    },
    qiangBase: {
      zh: "【身强极】强者宜克泄——食伤泄秀、财耗、官杀制为顺；印比再壅为滞。",
      en: "[Extreme strong] The strong should be controlled and drained — output, wealth spend, officer restraint are smooth. More resource/peer is stagnation.",
      es: "[Fuerte extremo] El fuerte debe drenarse y controlarse. Más sello/par es estancamiento.",
      ja: "【身強極】強者は克泄が宜しい。食傷・財耗・官殺が順。印比の再壅は滞。",
      ar: "[قوة قصوى] القوي يُصرَف ويُضبَط. مزيد الختم/الند ركود."
    }
  };

  var CATALOG = [
    {
      id: "seven",
      title: {
        zh: "断语七维（须同盘回扣，禁孤立贴标签）",
        en: "Seven axes (always tie to this chart; no isolated labels)",
        es: "Siete ejes (atar a esta carta; sin etiquetas sueltas)",
        ja: "断語七維（本盤に結び、孤立ラベル禁止）",
        ar: "سبعة محاور (اربط بهذه اللوحة؛ بلا تسميات معزولة)"
      },
      body: {
        zh: "①正/从：扶抑求中和；从格须一边倒、无有效根气印比救应，误从则喜忌尽反。我方／客方主要断正从。正格两边|我−客|／max≤⅛为平衡格局。\n②用/忌：药病相对——用神治病、忌神加重失衡；从格顺势取用，正格扶抑取用。平衡格用忌看家内外做功是否对自己和家内有利。\n③格局/做功：特殊作用＝命局做工；利用神则吉、利忌神则凶；不做二次正从。\n④家内/外：家内＝自家实际量（日＋时）；家外＝可利用资源实际量（年＋月＋流层）。作用后看双方实际数量增减，并看此具体十神对自家和日主的利败。以内取外；家内亦可被分走、被克绝。\n⑤六亲/十神：十神＝关系位；宫位+透藏+用忌同参，非「见某星即某人」。\n⑥财富/官贵：财官为人所求；身强可任、身弱须通关；见财非必富、见官非必贵。\n⑦寿/夭／身体／能力：作用后我客十神实际能量增减用来断夭寿、身体、能力好指数。我方趋零则凶多吉少（正从同理护体）；客方再多亦负担——非医疗诊断。\n\n指标归属：\n· ①基础＝原局→令→地（正从·用忌）；②专业＝作用时序2.0（格局·二级用忌）\n· ③键共振＝自身运→外环境；④结论＝指标 → 象义 → 结果\n· 初断／细断偏指标；详断展开象义与结果；同指标不双写",
        en: "1 Pattern: support/drain seeks the mean. Follow-pattern needs a one-sided tilt with no saving root/resource/peer. A false follow reverses useful and avoid.\n2 Useful/avoid: medicine vs disease — useful heals, avoid worsens. Follow takes with the current; Zheng supports or drains.\n3 Work: special action = how the chart works. Useful-work is lucky, avoid-work is unlucky. Do not re-judge pattern after work.\n4 Inner/outer: year+month = outer (social wealth/office); day+hour = inner (capacity and store). Compare sizes; take the outer from the inner. Inner can also be split or cut off.\n5 Kin / ten gods: a ten-god is a relation seat. Palace + exposed/hidden + useful/avoid together. Seeing a star is not seeing a person.\n6 Wealth / rank: people seek wealth and office. The strong can carry; the weak need a pass. Seeing wealth is not being rich; seeing office is not being noble.\n7 Life / early death: self near zero means more harm than luck (both Zheng and Follow must protect the body). Extra guest is still a load — not a medical diagnosis.\n\nWhere lines belong:\n· 1 Basics = natal → season → ground (pattern · useful/avoid)\n· 2 Pro = action sequence 2.0 (work · second useful/avoid)\n· 3 Resonance = own luck → outer field\n· 4 Conclusion = index → image → result. First/pro lean on indexes; detail opens image and result. Do not write the same index twice.",
        es: "1 Patrón: apoyo/drenaje busca la media. Seguir exige inclinación total sin raíz/sello/par que salve. Un seguir falso invierte útil y evitar.\n2 Útil/evitar: medicina frente a enfermedad. Seguir toma la corriente; Zheng apoya o drena.\n3 Obra: la acción especial es cómo trabaja la carta. Obra útil = fortuna; obra de evitar = daño. No rejuzgue el patrón.\n4 Dentro/fuera: año+mes = fuera (riqueza/oficial social); día+hora = dentro. Compare tamaños; tome lo de fuera desde dentro.\n5 Parientes / diez dioses: el dios es un asiento de relación. Palacio + expuesto/oculto + útil/evitar. Ver un astro no es ver a una persona.\n6 Riqueza / rango: el fuerte puede cargar; el débil necesita un paso. Ver riqueza no es ser rico.\n7 Vida / muerte temprana: el yo cerca de cero es más daño que fortuna — no es diagnóstico médico.\n\n1 Básico = natal → estación → tierra. 2 Pro = secuencia 2.0. 3 Resonancia = suerte → campo. 4 Conclusión = índice → imagen → resultado.",
        ja: "①正/従：扶抑は中和を求める。従格は一方に倒れ、有効な根気・印比の救いが無いこと。誤従すれば喜忌がすべて反転する。\n②用/忌：薬と病。用神は治し、忌神は偏りを重くする。従は順勢、正は扶抑。\n③格局/做功：特殊作用＝命局の仕事。用に利すれば吉、忌に利すれば凶。二次の正従はしない。\n④家内/外：年月は家外（社会の財官）、日時は家内。大小を対照し、内をもって外を取る。\n⑤六親/十神：十神は関係の位。宮＋透蔵＋用忌を同参。星を見て人とするな。\n⑥財富/官貴：身強は任じられ、身弱は通関が要る。財を見て富とせず、官を見て貴とせず。\n⑦寿/夭：我方がゼロに近づくと凶多く吉少。客方が多くても負担——医療診断ではない。\n\n①基礎＝原局→令→地。②専門＝作用時序2.0。③キー共鳴＝自身運→外環境。④結論＝指標→象義→結果。同指標は二重に書かない。",
        ar: "1 النمط: الدعم/الصرف يطلب الوسط. الاتباع يحتاج ميلاً كاملاً بلا جذر/ختم/ند يُنقذ. اتباع خاطئ يعكس النافع والمحذور.\n2 نافع/محذور: دواء أمام مرض. الاتباع يأخذ التيار؛ تشنغ يدعم أو يصرف.\n3 العمل: الفعل الخاص = كيف تعمل اللوحة. عمل النافع يمن، عمل المحذور أذى. لا تُعد الحكم على النمط.\n4 داخل/خارج: سنة+شهر = خارج؛ يوم+ساعة = داخل. خذ الخارج من الداخل.\n5 الأقارب / الآلهة العشرة: الإله مقعد علاقة. القصر + الظاهر/الخفي + النافع/المحذور معًا. رؤية نجم ليست رؤية شخص.\n6 الثروة / المنصب: القوي يحمل؛ الضعيف يحتاج ممرًا. رؤية ثروة ليست غنًى.\n7 العمر: اقتراب الأنا من الصفر أذى أكثر من يمن — ليس تشخيصًا طبيًا.\n\n1 أساس = الأصل → الفصل → الأرض. 2 احترافي = تسلسل 2.0. 3 رنين = الحظ → الحقل. 4 خاتمة = مؤشر → صورة → نتيجة."
      }
    },
    {
      id: "pairing",
      title: {
        zh: "配对指数（精准门控）",
        en: "Pairing index (strict gates)",
        es: "Índice de empareje (puertas estrictas)",
        ja: "ペア指数（精密ゲート）",
        ar: "مؤشر الاقتران (بوابات صارمة)"
      },
      body: {
        zh: "BI≤0.3 → 身弱极专属库。\nBI≥1.2（或已判身强）→ 身强极专属库。\n中和／偏弱带只用本库指数句：写明 BI · 十神份额% · 冻结用忌 · 做功吉凶。\n十神主导句必须回扣该桶落用／落忌，禁止仅凭「用客」误套身强极。\n一律相对本盘日主；命例不可照搬。",
        en: "BI≤0.3 → extreme-weak library only.\nBI≥1.2 (or already judged strong) → extreme-strong library only.\nMean / soft-weak uses only this band: write BI, ten-god share %, frozen useful/avoid, and work luck.\nA ten-god lead line must tie that bucket to useful or avoid. Do not borrow extreme-strong just because the chart “uses guest”.\nAlways relative to this day master. Do not copy sample charts.",
        es: "BI≤0.3 → solo biblioteca de débil extremo.\nBI≥1.2 → solo fuerte extremo.\nLa media escribe BI, cuotas, útil/evitar y obra.\nNo tome prestado el extremo fuerte solo porque “usa huésped”.\nSiempre relativo a este dueño del día.",
        ja: "BI≤0.3 → 身弱極庫のみ。\nBI≥1.2（または身強）→ 身強極庫のみ。\n中和／偏弱は BI・十神シェア・凍結用忌・做功吉凶を書く。\n「用客」だけで身強極を借りるな。\n常に本盤日主に相対。命例のコピー禁止。",
        ar: "BI≤0.3 → مكتبة الضعف الأقصى فقط.\nBI≥1.2 → مكتبة القوة القصوى فقط.\nالوسط يكتب BI والحصص والنافع/المحذور وعمل اللوحة.\nلا تستعر القوة القصوى لأن اللوحة «تستخدم الضيف».\nدائمًا نسبةً لسيد هذا اليوم."
      }
    },
    {
      id: "work",
      title: {
        zh: "做功路径（利用则吉 · 利忌则凶）",
        en: "Work paths (useful-work lucky · avoid-work unlucky)",
        es: "Caminos de obra (útil=fortuna · evitar=daño)",
        ja: "做功経路（用に利すれば吉 · 忌に利すれば凶）",
        ar: "مسارات العمل (نافع=يمن · محذور=أذى)"
      },
      body: {
        zh: "杀印相生：官杀有气、印通关。用客则利忌偏多，须二级再辨；用我则有利于用（生扶）。\n食伤生财：食伤泄秀生财。用客利于用（泄耗）；用我则利忌·泄身。\n财官相生：财生官杀。用客利于用；用我则利忌·财官攻身。\n比劫夺财：身党见财。用客利忌·争合；用我利于用（比劫）但须防夺。\n扶抑常规：无特殊合化旗标。用客宜克泄耗疏通；用我宜生扶护身。\n正格双方皆＞2 时标「用忌轻」，吉凶仍读做功方向，不改冻结。",
        en: "Kill-resource: officer has qi, resource opens the pass. Use-guest leans avoid (re-check at level 2). Use-self favors useful (support).\nOutput-wealth: output drains talent into wealth. Use-guest favors useful (drain). Use-self favors avoid (drains the body).\nWealth-officer: wealth feeds officer. Use-guest favors useful. Use-self favors avoid (wealth/officer attack the body).\nPeers seize wealth: the body-camp meets wealth. Use-guest favors avoid (contention). Use-self favors useful (peers) but watch seizure.\nOrdinary support/drain: no special combine flag. Use-guest: control/drain/spend. Use-self: generate and protect.\nIf both camps > 2 on Zheng, mark “soft useful/avoid”. Work direction still decides luck; freeze does not change.",
        es: "Kill-sello: el oficial tiene qi; el sello abre el paso.\nOutput-riqueza: el output vuelve talento en riqueza.\nRiqueza-oficial: la riqueza alimenta al oficial.\nPares quitan riqueza: el campo del cuerpo ve riqueza.\nApoyo/drenaje ordinario: sin bandera especial.\nSi ambos campos > 2 en Zheng, marque útil/evitar suave. La obra decide la fortuna.",
        ja: "殺印相生：官殺に気、印が通関。用客は忌に偏り二次再辨。用我は用に利す。\n食傷生財：泄秀して財を生む。用客は用、用我は忌（泄身）。\n財官相生：財が官殺を生む。用客は用、用我は忌。\n比劫奪財：身党が財を見る。用客は忌、用我は用だが奪を防げ。\n扶抑通常：特殊合化なし。用客は克泄耗、用我は生扶。\n正格で双方＞2 は「用忌軽」。吉凶は做功方向、凍結は変えない。",
        ar: "قتل-ختم: للمنصب طاقة والختم يفتح الممر.\nخرج-ثروة: الخرج يحوّل الموهبة إلى مال.\nثروة-منصب: الثروة تطعم المنصب.\nالأقران ينتزعون الثروة: معسكر الجسد يرى مالاً.\nدعم/صرف عادي: بلا راية اتحاد خاصة.\nإن تجاوز المعسكران 2 في تشنغ فضع «نافع/محذور خفيف». اتجاه العمل يحسم اليمن."
      }
    },
    {
      id: "ruo",
      title: {
        zh: "身弱极专属（BI≤0.3）",
        en: "Extreme-weak library (BI≤0.3)",
        es: "Biblioteca débil extremo (BI≤0.3)",
        ja: "身弱極庫（BI≤0.3）",
        ar: "مكتبة الضعف الأقصى (BI≤0.3)"
      },
      body: {
        zh: VERDICT.ruoSha.zh + "\n" + VERDICT.ruoCai.zh + "\n" + VERDICT.ruoShi.zh + "\n" + VERDICT.ruoBase.zh,
        en: VERDICT.ruoSha.en + "\n" + VERDICT.ruoCai.en + "\n" + VERDICT.ruoShi.en + "\n" + VERDICT.ruoBase.en,
        es: VERDICT.ruoSha.es + "\n" + VERDICT.ruoCai.es + "\n" + VERDICT.ruoShi.es + "\n" + VERDICT.ruoBase.es,
        ja: VERDICT.ruoSha.ja + "\n" + VERDICT.ruoCai.ja + "\n" + VERDICT.ruoShi.ja + "\n" + VERDICT.ruoBase.ja,
        ar: VERDICT.ruoSha.ar + "\n" + VERDICT.ruoCai.ar + "\n" + VERDICT.ruoShi.ar + "\n" + VERDICT.ruoBase.ar
      }
    },
    {
      id: "qiang",
      title: {
        zh: "身强极专属（BI≥1.2）",
        en: "Extreme-strong library (BI≥1.2)",
        es: "Biblioteca fuerte extremo (BI≥1.2)",
        ja: "身強極庫（BI≥1.2）",
        ar: "مكتبة القوة القصوى (BI≥1.2)"
      },
      body: {
        zh: VERDICT.qiangYin.zh + "\n" + VERDICT.qiangShi.zh + "\n" + VERDICT.qiangBase.zh,
        en: VERDICT.qiangYin.en + "\n" + VERDICT.qiangShi.en + "\n" + VERDICT.qiangBase.en,
        es: VERDICT.qiangYin.es + "\n" + VERDICT.qiangShi.es + "\n" + VERDICT.qiangBase.es,
        ja: VERDICT.qiangYin.ja + "\n" + VERDICT.qiangShi.ja + "\n" + VERDICT.qiangBase.ja,
        ar: VERDICT.qiangYin.ar + "\n" + VERDICT.qiangShi.ar + "\n" + VERDICT.qiangBase.ar
      }
    },
    {
      id: "life",
      title: {
        zh: "具体人事（宫＋星＋用忌 · 禁铁口个数）",
        en: "Concrete human affairs (palace + star + useful/avoid · no iron counts)",
        es: "Asuntos humanos (palacio + astro + útil/evitar · sin cifras de hierro)",
        ja: "具体人事（宮＋星＋用忌 · 鉄口の個数禁止）",
        ar: "شؤون الناس (قصر + نجم + نافع/محذور · بلا أعداد حديدية)"
      },
      body: {
        zh: "婚姻：配偶宫＝日支；配偶星＝男财／女官杀。迟早看年月透现与宫受冲合；段数只给「一段为主／波折再缘」倾向；应期须运岁引动宫／星。\n子女：时柱子女宫＋子女星（男官杀、女食伤）；少／中／多倾向，禁报死数。\n手足：比劫透藏＋月柱；缺则印枭代姐兄、食神代弟、伤官代妹。\n职业：核心做功名＋用忌十神桶。\n一律：宫位＋十神＋冻结用忌；见星非即人／非即个数。",
        en: "Marriage: spouse palace = day branch; spouse star = wealth for men / officer-kill for women. Early or late from year/month exposure and clash/combine on the palace. Segments only as “one main / a later tie”. Timing needs luck/year to move palace or star.\nChildren: hour pillar + child star (officer-kill for men, output for women). Few / mid / many as tendency. No dead counts.\nSiblings: peer/robber exposed or hidden + month pillar. If missing: resource stands for elder, output for younger brother, hurting-officer for younger sister.\nCareer: core work name + useful/avoid ten-god bucket.\nAlways: palace + ten-god + frozen useful/avoid. A star is not a person and not a count.",
        es: "Matrimonio: palacio = rama del día; astro = riqueza (hombre) / oficial (mujer). Sin cifras de hierro.\nHijos: pilar hora + astro de hijo. Poco / medio / mucho como tendencia.\nHermanos: par/robador + pilar mes. Si falta, el sello / output sustituye.\nCarrera: nombre de obra + cubo de diez dioses.\nSiempre: palacio + dios + útil/evitar. Un astro no es una persona.",
        ja: "婚姻：配偶宮＝日支。配偶星＝男は財、女は官殺。段数は傾向のみ。応期は運歳が宮／星を動かすとき。\n子女：時柱＋子女星。少／中／多の傾向。死数は禁。\n手足：比劫の透蔵＋月柱。欠けば印梟・食神・傷官で代取。\n職業：核心の做功名＋用忌の十神桶。\n常に宮＋十神＋凍結用忌。星を見て人／個数とするな。",
        ar: "الزواج: قصر الزوج = فرع اليوم؛ نجم الزوج = ثروة للرجل / منصب للمرأة. بلا أعداد حديدية.\nالأبناء: عمود الساعة + نجم الولد. قليل / وسط / كثير كميل.\nالإخوة: الند + عمود الشهر. إن غاب فالختم/الخرج ينوب.\nالمهنة: اسم العمل + دلو الآلهة.\nدائمًا: قصر + إله + نافع/محذور. النجم ليس شخصًا."
      }
    },
    {
      id: "xiangyi",
      title: {
        zh: "象义栏目（看图说话 · 非断准）",
        en: "Image-speech columns (read the figure, then speak · not a hit-rate claim)",
        es: "Columnas imagen-habla (mire la figura, luego hable)",
        ja: "象義欄（図を見て話す · 的中率ではない）",
        ar: "أعمدة الصورة-الكلام (انظر الشكل ثم تكلّم)"
      },
      body: {
        zh: "中心思想：看图（指标）说话（象义）——先读指标图，再开口说人事象。\n格局：月令格神／做功键清浊高低；有情有力则高，无情无力则低。\n学历：印／枭＝第一文星；食／伤＝第二文星。须看一级＋二级用忌与强弱。正印＝正统吸收／文凭／师长；偏印＝偏门技艺（忌夺食）；食神＝温和理解／技艺认证；伤官＝突破才思（见官宜配印）。\n事业：十神取向＋成格路径（官印公职、食伤技艺、财官经营、杀印权威…）。\n财富：财星＋食伤生财源；身强可任、身弱须通关；见财非必富。\n官贵：官杀名位权柄；有制化则权，无制则累；见官非必贵。\n夭寿：我方拒归零＋五行偏枯／调候（非医疗诊断）。\n六亲：星＋宫＋透藏＋用忌同参。\n心性：日主强弱 × 十神气质（象，不作性格贴标签）。",
        en: "Core: read the figure (indexes), then speak (images). Do not talk without a figure.\nPattern: season-god / work-key clarity and force. Affection + force = high; none = low.\nStudy: resource = first literary star; output = second. Need level-1 + level-2 useful/avoid and strength. Direct resource = orthodox intake / diploma / teachers. Indirect resource = side skill (avoid seizing food). Output = gentle grasp / craft papers. Hurting-officer = breakthrough thought (pair with resource if officer appears).\nCareer: ten-god tilt + formation path (office+resource public post, output craft, wealth+officer trade, kill+resource authority…).\nWealth: wealth star + output as source. Strong can carry; weak needs a pass. Seeing wealth is not being rich.\nRank: officer/kill is name and handle. With control it is power; without it, a load. Seeing office is not being noble.\nLife span: keep self off zero + five-phase drought / climate (not medicine).\nKin: star + palace + exposed/hidden + useful/avoid.\nMind: day-master strength × ten-god temperament (image, not a personality sticker).",
        es: "Núcleo: mire la figura (índices), luego hable (imágenes).\nEstudio: sello = primera estrella literaria; output = segunda.\nCarrera: inclinación de diez dioses + camino de formación.\nRiqueza: astro de riqueza + output. Ver riqueza no es ser rico.\nRango: oficial/kill es nombre y mango. Ver oficial no es ser noble.\nVida: el yo no debe ir a cero — no es medicina.\nParientes: astro + palacio + expuesto/oculto + útil/evitar.\nMente: fuerza del dueño × temperamento (imagen, no etiqueta).",
        ja: "中心：図（指標）を見てから人事の象を話す。\n学歴：印／梟＝第一文星、食／傷＝第二文星。一級＋二級の用忌と強弱を見る。\n事業：十神の向き＋成格の道。\n財富：財星＋食傷。財を見て富とせず。\n官貴：官殺は名と権。制化あれば権、なければ累。\n夭寿：我方をゼロにしない＋五行の偏枯／調候（医療ではない）。\n六親：星＋宮＋透蔵＋用忌。\n心性：日主の強弱×十神の気質（象であり性格ラベルではない）。",
        ar: "الأصل: انظر الشكل (المؤشرات) ثم تكلّم (الصور).\nالدراسة: الختم = النجم الأدبي الأول؛ الخرج = الثاني.\nالمهنة: ميل الآلهة + طريق التكوّن.\nالثروة: نجم المال + الخرج. رؤية مال ليست غنًى.\nالمنصب: القتل/المنصب اسم ومقبض. رؤية منصب ليست شرفًا.\nالعمر: امنع الأنا من الصفر — ليس طبًا.\nالأقارب: نجم + قصر + ظاهر/خفي + نافع/محذور.\nالطبع: قوة سيد اليوم × مزاج الإله (صورة لا ملصق)."
      }
    }
  ];

  function applyDir() {
    try {
      document.documentElement.lang = cur === "zh" ? "zh-CN" : cur;
      if (document.body) document.body.setAttribute("dir", cur === "ar" ? "rtl" : "ltr");
    } catch (e) { }
  }

  function boot() {
    var q = "";
    try { q = (new URLSearchParams(location.search).get("lang") || "").toLowerCase(); } catch (e) { }
    var pref = "";
    try { pref = localStorage.getItem("kr_lang") || ""; } catch (e) { }
    if (LANGS.indexOf(q) >= 0) cur = q;
    else if (LANGS.indexOf(pref) >= 0) cur = pref;
    else cur = "zh";
    applyDir();
    return cur;
  }

  function set(lang) {
    if (LANGS.indexOf(lang) < 0) return cur;
    cur = lang;
    try { localStorage.setItem("kr_lang", lang); } catch (e) { }
    applyDir();
    return cur;
  }

  function t(key, vars) {
    var s = pick(UI, key);
    return vars ? fmt(s, vars) : s;
  }

  function term(s) {
    if (s == null || s === "") return s;
    var pack = TERM[cur] || TERM.zh;
    if (pack[s]) return pack[s];
    if (SS[s] && SS[s][cur]) return SS[s][cur];
    if (CS[s] && CS[s][cur]) return CS[s][cur];
    return s;
  }

  function termsJoin(arr, sep) {
    return (arr || []).map(term).join(sep == null ? "·" : sep);
  }

  function ssName(s) { return (SS[s] && (SS[s][cur] || SS[s].zh)) || s; }
  function csName(s) { return (CS[s] && (CS[s][cur] || CS[s].zh)) || s; }

  function verdict(key, vars) {
    var pack = VERDICT[key];
    if (!pack) return key;
    var tpl = pack[cur] || pack.zh || key;
    if (vars) {
      var mapped = {};
      Object.keys(vars).forEach(function (k) { mapped[k] = vars[k]; });
      if (mapped.band) mapped.band = term(mapped.band);
      if (mapped.biLabel) mapped.biLabel = term(mapped.biLabel);
      if (mapped.orient) mapped.orient = term(mapped.orient);
      if (mapped.name) mapped.name = term(mapped.name);
      if (mapped.yong && Array.isArray(vars.yong)) mapped.yong = termsJoin(vars.yong);
      if (mapped.ji && Array.isArray(vars.ji)) mapped.ji = termsJoin(vars.ji);
      return fmt(tpl, mapped);
    }
    return tpl;
  }

  function loc(obj) {
    if (!obj) return "";
    if (typeof obj === "string") return obj;
    return obj[cur] || obj.zh || obj.en || "";
  }

  function applyChrome(root) {
    root = root || document;
    Array.prototype.forEach.call(root.querySelectorAll("[data-k]"), function (el) {
      var v = t(el.getAttribute("data-k"));
      if (v) el.textContent = v;
    });
    Array.prototype.forEach.call(root.querySelectorAll("[data-lang]"), function (b) {
      b.classList.toggle("on", b.getAttribute("data-lang") === cur);
    });
    applyDir();
  }

  function bindLangs(root, onChange) {
    root = root || document;
    Array.prototype.forEach.call(root.querySelectorAll("[data-lang]"), function (b) {
      b.onclick = function () {
        set(b.getAttribute("data-lang"));
        applyChrome(root);
        if (onChange) onChange(cur);
      };
    });
  }

  global.KRLang = {
    langs: LANGS,
    boot: boot,
    set: set,
    get: function () { return cur; },
    t: t,
    term: term,
    termsJoin: termsJoin,
    ss: ssName,
    cs: csName,
    verdict: verdict,
    loc: loc,
    fmt: fmt,
    applyChrome: applyChrome,
    bindLangs: bindLangs,
    catalog: CATALOG,
    UI: UI,
    TERM: TERM,
    SS: SS,
    CS: CS,
    VERDICT: VERDICT
  };
})(typeof window !== "undefined" ? window : globalThis);
