{
  "schemaVersion": 1,
  "atomId": "responsive_2d_layout.aicomponent",
  "bundleType": "aicomponent",
  "category": "layout",
  "mode": "fixed",
  "label": { "zh": "2D 自适应布局", "en": "Responsive 2D layout" },
  "tags": ["layout", "responsive", "scale", "design-size", "ui-scale", "phaser", "layout-canon", "framework-agnostic"],
  "bindingRoles": ["responsiveLayout"],
  "scaffold": {
    "files": {
      "src/game/utils/UiLayout.ts": {
        "source": "ref/UiLayout.ts",
        "mode": "full",
        "weight": 10
      }
    }
  },
  "imports": [
    { "slot": "engine", "pinAtomId": "phaser.aicomponent", "edgeKind": "requires", "bindAs": "engine" }
  ],
  "exports": [
    { "name": "computeUiLayout", "kind": "function",  "location": "src/game/utils/UiLayout.ts" },
    { "name": "UiLayoutConfig",  "kind": "interface", "location": "src/game/utils/UiLayout.ts" },
    { "name": "UiLayoutResult",  "kind": "interface", "location": "src/game/utils/UiLayout.ts" }
  ],
  "neutralDescriptor": {
    "geometry": "framework-agnostic layout canon: design WxH, viewport Wr/Hr, uiScale = clamp(min(scaleX,scaleY), minScale, maxScale), vScale = scaleY; Phaser ref in ref/UiLayout.ts",
    "layers": ["coordinate-system", "scaling", "layout-math", "design-tokens"],
    "replaceable": ["base design resolution", "min/max scale bounds", "engine adapter"]
  },
  "usageHints": [
    "先读 SKILL.md 第一节 Layout Canon：公式与引擎无关，任何运行时都应复用同一套 uiScale/vScale 定义",
    "默认设计稿 750×1334；uiScale = clamp(min(Wr/Wd, Hr/Hd), minScale, maxScale)；vScale = Hr/Hd",
    "同一画面只算一次布局系数，全 UI 共用；安全区先缩小 Wr/Hr 再代入公式",
    "Phaser 项目用 computeUiLayout(scene)；非 Phaser 实现等价纯函数，禁止仅复制 Phaser 类型",
    "GameConfig.baseWidth/Height/minScale/maxScale 可覆盖默认值"
  ],
  "files": {
    "skill": "SKILL.md",
    "uiLayout": "ref/UiLayout.ts"
  }
}
