`).join('');
// Record the game's actual renderer commands as SVG for a static composition.
// Original PNG pixels are embedded unchanged; shared sampling and clip geometry
// match the game. This is a documentation adapter, not an alternative game UI.
let serial=0;
function sceneSVG(render,label){const nodes=[],defs=[];const points=pts=>pts.map(p=>`${p.x.toFixed(3)},${p.y.toFixed(3)}`).join(' ');
const painter={
polygon(pts,fill){nodes.push(``);},
line(pts,color,width){nodes.push(``);},
circle(x,y,r,fill){nodes.push(``);},
sprite(index,x,y,r){const f=tileSample(TILE_FRAMES[index]),w=r*2,h=w*TILE_ASPECT,id=`tile-clip-${serial++}`;defs.push(``);nodes.push(``);return true;},
};
render(painter);return ``;
}
const level=LEVELS[1];
const board=sceneSVG(p=>drawScene(p,level,level.tiles,layout(level.cells,360,360)),'第二关棋盘静态展示,使用游戏实际轨道、棋子图片与颜色');
const tiles=sceneSVG(p=>[0,1,2,3].forEach((color,i)=>drawTile(p,95+(i%2)*170,95+Math.floor(i/2)*170,75,{color,dir:0})),'蓝、粉、黄、紫四种实际棋子,黄色使用深色箭头');
const replacements={
TOKENS:Object.entries(THEME).map(([k,v])=>`--${k}:${v};`).join('')+`--pressMs:${MOTION.pressMs}ms;--modalMs:${MOTION.modalMs}ms;--starOne:${MOTION.starStartMs}ms;--starTwo:${MOTION.starStartMs+MOTION.starGapMs}ms;--starThree:${MOTION.starStartMs+MOTION.starGapMs*2}ms;--controlRadius:${RADII.control}px;--dialogRadius:${RADII.dialog}px;`,ICON_ATLAS:dataImage(ICON_ATLAS),ICON_CSS:iconCSS,
TILE_IMAGE:``,
BOARD:board,TILES:tiles,MOVES:level.moveLimit,SWATCHES:swatches,PAIR_ROWS:pairRows,
ICONS:Object.keys(ICONS).map(name=>`
${icon(name)}${iconNames[name]}${name}
`).join(''),
SPEC:renderMarkdown(markdown),PAYLOAD:JSON.stringify({markdown,theme:THEME,typography:TYPOGRAPHY,motion:MOTION,radii:RADII}).replace(/{if(!(key in replacements))throw new Error(`Unknown guide placeholder ${key}`);return replacements[key];});
writeFileSync(new URL('../Design.html',import.meta.url),output);
console.log(`Design.html built: ${Object.keys(THEME).length} colors, ${Object.keys(ICONS).length} original icons, ${reports.length} contrast pairs, complete specification. Standalone / offline.`);