const fs = require("fs");
const { Document, Packer, Paragraph, TextRun, Table, TableRow, TableCell,
        Header, Footer, AlignmentType, LevelFormat, HeadingLevel,
        BorderStyle, WidthType, ShadingType, PageNumber, PageBreak,
        TabStopType, TabStopPosition } = require("docx");

const border = { style: BorderStyle.SINGLE, size: 1, color: "D0D0D0" };
const borders = { top: border, bottom: border, left: border, right: border };
const cellMargins = { top: 80, bottom: 80, left: 120, right: 120 };

function h1(text) {
  return new Paragraph({ heading: HeadingLevel.HEADING_1, children: [new TextRun(text)] });
}
function h2(text) {
  return new Paragraph({ heading: HeadingLevel.HEADING_2, children: [new TextRun(text)] });
}
function h3(text) {
  return new Paragraph({ heading: HeadingLevel.HEADING_3, children: [new TextRun(text)] });
}
function p(text, opts = {}) {
  return new Paragraph({ spacing: { after: 120 }, children: [new TextRun({ text, ...opts })] });
}
function bold(text) {
  return new TextRun({ text, bold: true });
}
function para(...runs) {
  return new Paragraph({ spacing: { after: 120 }, children: runs });
}
function bullet(text, ref = "bullets") {
  return new Paragraph({ numbering: { reference: ref, level: 0 }, spacing: { after: 60 },
    children: [new TextRun(text)] });
}
function bulletBold(label, desc) {
  return new Paragraph({ numbering: { reference: "bullets", level: 0 }, spacing: { after: 60 },
    children: [new TextRun({ text: label, bold: true }), new TextRun(` ${desc}`)] });
}

function featureTable(rows) {
  const colW = [1800, 2400, 5160];
  return new Table({
    width: { size: 9360, type: WidthType.DXA },
    columnWidths: colW,
    rows: [
      new TableRow({ children: ["Category", "Prefix", "Description"].map((t, i) =>
        new TableCell({ borders, width: { size: colW[i], type: WidthType.DXA }, margins: cellMargins,
          shading: { fill: "2E3A8C", type: ShadingType.CLEAR },
          children: [new Paragraph({ children: [new TextRun({ text: t, bold: true, color: "FFFFFF", font: "Malgun Gothic", size: 20 })] })] }))
      }),
      ...rows.map(([cat, prefix, desc]) =>
        new TableRow({ children: [cat, prefix, desc].map((t, i) =>
          new TableCell({ borders, width: { size: colW[i], type: WidthType.DXA }, margins: cellMargins,
            children: [new Paragraph({ children: [new TextRun({ text: t, font: "Malgun Gothic", size: 20, ...(i === 1 ? { font: "Consolas" } : {}) })] })] }))
        })
      )
    ]
  });
}

const doc = new Document({
  styles: {
    default: { document: { run: { font: "Malgun Gothic", size: 22 } } },
    paragraphStyles: [
      { id: "Heading1", name: "Heading 1", basedOn: "Normal", next: "Normal", quickFormat: true,
        run: { size: 36, bold: true, font: "Malgun Gothic", color: "1A1B2E" },
        paragraph: { spacing: { before: 360, after: 200 }, outlineLevel: 0 } },
      { id: "Heading2", name: "Heading 2", basedOn: "Normal", next: "Normal", quickFormat: true,
        run: { size: 28, bold: true, font: "Malgun Gothic", color: "2E3A8C" },
        paragraph: { spacing: { before: 280, after: 160 }, outlineLevel: 1 } },
      { id: "Heading3", name: "Heading 3", basedOn: "Normal", next: "Normal", quickFormat: true,
        run: { size: 24, bold: true, font: "Malgun Gothic", color: "4B5EFC" },
        paragraph: { spacing: { before: 200, after: 120 }, outlineLevel: 2 } },
    ]
  },
  numbering: {
    config: [
      { reference: "bullets",
        levels: [{ level: 0, format: LevelFormat.BULLET, text: "\u2022", alignment: AlignmentType.LEFT,
          style: { paragraph: { indent: { left: 720, hanging: 360 } } } }] },
      { reference: "numbers",
        levels: [{ level: 0, format: LevelFormat.DECIMAL, text: "%1.", alignment: AlignmentType.LEFT,
          style: { paragraph: { indent: { left: 720, hanging: 360 } } } }] },
    ]
  },
  sections: [{
    properties: {
      page: {
        size: { width: 11906, height: 16838 },
        margin: { top: 1440, right: 1260, bottom: 1440, left: 1260 }
      }
    },
    headers: {
      default: new Header({ children: [
        new Paragraph({ children: [
          new TextRun({ text: "AX Commander \u2014 Blog Post", font: "Malgun Gothic", size: 16, color: "999999" })
        ], alignment: AlignmentType.RIGHT })
      ]})
    },
    footers: {
      default: new Footer({ children: [
        new Paragraph({ alignment: AlignmentType.CENTER, children: [
          new TextRun({ text: "Page ", font: "Malgun Gothic", size: 16, color: "999999" }),
          new TextRun({ children: [PageNumber.CURRENT], font: "Malgun Gothic", size: 16, color: "999999" })
        ]})
      ]})
    },
    children: [

      // ─── 타이틀 ───
      new Paragraph({ spacing: { after: 80 }, alignment: AlignmentType.CENTER, children: [
        new TextRun({ text: "AX Commander", font: "Malgun Gothic", size: 48, bold: true, color: "1A1B2E" })
      ]}),
      new Paragraph({ spacing: { after: 40 }, alignment: AlignmentType.CENTER,
        border: { bottom: { style: BorderStyle.SINGLE, size: 6, color: "4B5EFC", space: 8 } },
        children: [
          new TextRun({ text: "\ud0a4\ubcf4\ub4dc \ud558\ub098\ub85c \ubaa8\ub4e0 \uc5c5\ubb34\ub97c \uc81c\uc5b4\ud558\ub294 \uc0ac\ub0b4 \uc804\uc6a9 \ub7f0\ucc98", font: "Malgun Gothic", size: 26, color: "555577" })
      ]}),
      new Paragraph({ spacing: { after: 300 }, alignment: AlignmentType.CENTER, children: [
        new TextRun({ text: "\ubc31\uc2b9\uc7ac \u00b7 AX\uc5f0\uad6c\uc18c AI\ud300 \u00b7 SW Architect", font: "Malgun Gothic", size: 20, color: "888899" })
      ]}),

      // ─── 1. 서문 ───
      h1("1. \uc65c \ub9cc\ub4e4\uc5c8\ub294\uac00"),
      p("\uc5c5\ubb34 \uc911 \uac00\uc7a5 \ub9ce\uc774 \ubc18\ubcf5\ud558\ub294 \ub3d9\uc791\uc774 \ubb50\ub0d0\uace0 \ubb3c\uc73c\uba74, \ub300\ubd80\ubd84\uc758 \uc0ac\ubb34\uc9c1 \uc9c1\uc6d0\uc774 \uc774\ub807\uac8c \ub300\ub2f5\ud569\ub2c8\ub2e4:"),
      bullet("\uc571\uc744 \ucc3e\uc544\uc11c \uc2e4\ud589\ud558\uae30"),
      bullet("\ud30c\uc77c\uc744 \ucc3e\uc544\uc11c \uc5f4\uae30"),
      bullet("\ud074\ub9bd\ubcf4\ub4dc\uc5d0\uc11c \ubcf5\uc0ac\ud55c \ub0b4\uc6a9 \ub2e4\uc2dc \ucc3e\uae30"),
      bullet("\uacc4\uc0b0\uae30 \uc5f4\uace0 \uac04\ub2e8\ud55c \uacc4\uc0b0\ud558\uae30"),
      p("\uc774 \ubaa8\ub4e0 \ub3d9\uc791\uc5d0 \ub9c8\uc6b0\uc2a4\ub97c \ub4e4\uace0, \ud0d0\uc0c9\uae30\ub97c \uc5f4\uace0, \ud074\ub9ad\ud558\uace0\u2026 \ud0a4\ubcf4\ub4dc\uc5d0\uc11c \uc190\uc744 \ub5bc \uc218\uac00 \uc5c6\uc2b5\ub2c8\ub2e4."),
      para(bold("AX Commander"), new TextRun("\ub294 \uc774 \ubb38\uc81c\ub97c \ud574\uacb0\ud569\ub2c8\ub2e4. Alt+Space \ud55c \ubc88\uc73c\ub85c \ubaa8\ub4e0 \uac83\uc744 \ud0a4\ubcf4\ub4dc\ub85c \uc81c\uc5b4\ud560 \uc218 \uc788\ub294 \ub7f0\ucc98\uc785\ub2c8\ub2e4.")),
      p("\ud2b9\ud788 \uc774 \ud504\ub85c\uc81d\ud2b8\ub294 LLM(Claude)\uacfc \ud568\uaed8 \uae30\ud68d\ubd80\ud130 \uad6c\ud604\uae4c\uc9c0 \uc9c4\ud589\ud55c \uc0ac\ub840\ub85c, AI\uc640 \ud611\uc5c5\ud558\ub294 \uc18c\ud504\ud2b8\uc6e8\uc5b4 \uac1c\ubc1c\uc758 \uc2e4\uc81c \uacbd\ud5d8\uc744 \ub2f4\uace0 \uc788\uc2b5\ub2c8\ub2e4."),

      new Paragraph({ children: [new PageBreak()] }),

      // ─── 2. AX Commander란? ───
      h1("2. AX Commander\ub780?"),
      para(new TextRun({ text: "Alt+Space", bold: true, font: "Consolas" }), new TextRun("\ub97c \ub204\ub974\uba74 \ud654\uba74 \uc0c1\ub2e8\uc5d0 \uae54\ub054\ud55c \ub7f0\ucc98 \ucc3d\uc774 \ub098\ud0c0\ub0a9\ub2c8\ub2e4. \uc5ec\uae30\uc5d0 \uc6d0\ud558\ub294 \uba85\ub839\uc744 \uc785\ub825\ud558\uba74 \ub429\ub2c8\ub2e4.")),
      bullet("\uc571 \uc774\ub984\uc744 \uce58\uba74 \uc571\uc774 \uc2e4\ud589\ub429\ub2c8\ub2e4"),
      bullet("= \ub97c \uce58\uba74 \uacc4\uc0b0\uae30\uac00 \ub429\ub2c8\ub2e4"),
      bullet("# \uc744 \uce58\uba74 \ud074\ub9bd\ubcf4\ub4dc \ud788\uc2a4\ud1a0\ub9ac\uac00 \ub098\ud0c0\ub0a9\ub2c8\ub2e4"),
      bullet("cap screen \uc744 \uce58\uba74 \ud654\uba74\uc774 \ucea1\ucc98\ub429\ub2c8\ub2e4"),
      bullet("win chrome \uc744 \uce58\uba74 \ud06c\ub86c \ucc3d\uc73c\ub85c \uc989\uc2dc \uc804\ud658\ub429\ub2c8\ub2e4"),
      p("\ud504\ub9ac\ud53d\uc2a4(\uc811\ub450\uc5b4) \uae30\ubc18\uc73c\ub85c 40\uac1c \uc774\uc0c1\uc758 \uba85\ub839\uc5b4\ub97c \uc9c0\uc6d0\ud558\uba70, \ud55c\uad6d\uc5b4 \ucd08\uc131 \uac80\uc0c9\ub3c4 \ub429\ub2c8\ub2e4 (\u3145\u3137 \u2192 \uc124\uc815)."),

      // ─── 3. 핵심 기능 ───
      h1("3. \ud575\uc2ec \uae30\ub2a5 \uc18c\uac1c"),
      p("AX Commander\ub294 \ub2e8\uc21c\ud55c \uc571 \ub7f0\ucc98\uac00 \uc544\ub2d9\ub2c8\ub2e4. \uc544\ub798\ub294 \uce74\ud14c\uace0\ub9ac\ubcc4 \uc8fc\uc694 \uae30\ub2a5\uc785\ub2c8\ub2e4."),

      h3("\uac80\uc0c9"),
      bullet("\ud37c\uc9c0 \uac80\uc0c9: \uc571/\ud30c\uc77c\uba85\uc744 \uc77c\ubd80\ub9cc \uc785\ub825\ud574\ub3c4 \ucc3e\uc544\uc90c"),
      bullet("\ud55c\uad6d\uc5b4 \ucd08\uc131: \u3147\u314e\u3134 \u2192 \uc544\ud55c\uae00 \uac80\uc0c9"),
      bullet("\uc2e4\ud589 \ube48\ub3c4 \ud559\uc2b5: \uc790\uc8fc \uc4f0\ub294 \uc571\uc774 \uc0c1\ub2e8\uc73c\ub85c"),

      h3("\uacc4\uc0b0 \u00b7 \ubcc0\ud658"),
      bullet("= sqrt(144), = 0xFF + 1, = 100km in miles"),
      bullet("= 100 USD to KRW (\uc2e4\uc2dc\uac04 \ud658\uc728)"),
      bullet("date +30d (30\uc77c \ud6c4 \ub0a0\uc9dc), date unix (\ud0c0\uc784\uc2a4\ud0ec\ud504)"),

      h3("\ud074\ub9bd\ubcf4\ub4dc"),
      bullet("# \ud788\uc2a4\ud1a0\ub9ac: \ubcf5\uc0ac \uc774\ub825 \uac80\uc0c9 \u00b7 \uc7ac\uc0ac\uc6a9 \u00b7 \ubcd1\ud569"),
      bullet("$ \ubcc0\ud658: JSON \uc815\ub82c, Base64, URL \uc778\ucf54\ub529 \ub4f1 12\uc885"),
      bullet("pipe \ud30c\uc774\ud504\ub77c\uc778: pipe upper > trim > b64e"),
      bullet("batch \uc77c\uad04 \ucc98\ub9ac: \uc904\ubc88\ud638, \uc815\ub82c, \uc911\ubcf5\uc81c\uac70, \ucebc\ub2f8\uc138 \uac10\uc2f8\uae30"),
      bullet("DPAPI \uc554\ud638\ud654: \ud074\ub9bd\ubcf4\ub4dc \ud788\uc2a4\ud1a0\ub9ac \ud30c\uc77c\uc774 \ud604\uc7ac Windows \uacc4\uc815\uc5d0\uc11c\ub9cc \ubcf5\ud638\ud654 \uac00\ub2a5"),

      h3("\uac1c\ubc1c\uc790 \ub3c4\uad6c"),
      bullet("json format / minify / validate"),
      bullet("encode base64 / url / sha256"),
      bullet("color #FF5500 \u2192 HEX/RGB/HSL/HSV 4\uc885 \ubcc0\ud658"),
      bullet("port 3000 \u2192 \uc810\uc720 \ud504\ub85c\uc138\uc2a4 \ud655\uc778"),
      bullet("env PATH \u2192 \ud658\uacbd\ubcc0\uc218 \uac80\uc0c9"),
      bullet("pick \u2192 \uc2a4\ud3ec\uc774\ub4dc\ub85c \ud654\uba74 \uc0c9\uc0c1 HEX \ucf54\ub4dc \ucd94\ucd9c"),

      h3("\ud654\uba74 \ucea1\ucc98"),
      bullet("cap screen / window / scroll / region"),
      bullet("\uc2a4\ud3ec\uc774\ub4dc(pick): \ub3cb\ubcf4\uae30 + \uc2e4\uc2dc\uac04 HEX \ud45c\uc2dc + 5\ucd08 \uacb0\uacfc\ucc3d"),
      bullet("\uae00\ub85c\ubc8c \ub2e8\ucd95\ud0a4(PrintScreen \ub4f1) \uc9c0\uc6d0"),
      bullet("\ubcf4\uc548: \ud074\ub9bd\ubcf4\ub4dc\uc5d0\ub9cc \ubcf5\uc0ac (\ud30c\uc77c \uc800\uc7a5 \uae30\ub2a5 \uc5c6\uc74c)"),

      h3("\ucc3d \uad00\ub9ac \u00b7 \uc2dc\uc2a4\ud15c"),
      bullet("! save/restore: \ucc3d \ubc30\uce58 \uc2a4\ub0c5\uc0f7"),
      bullet("snap left/right/full: \ucc3d \ubd84\ud560 \ub808\uc774\uc544\uc6c3"),
      bullet("win: \uc5f4\ub9b0 \ucc3d \uac80\uc0c9 \u2192 \uc989\uc2dc \uc804\ud658 (Alt+Tab \ub300\uccb4)"),
      bullet("/lock, /timer 5m, /alarm 14:30"),
      bullet("svc: Windows \uc11c\ube44\uc2a4 \uad00\ub9ac + \ud074\ub9bd\ubcf4\ub4dc \uac15\uc81c \uc7ac\uc2dc\uc791"),

      h3("\uc5c5\ubb34 \uc790\ub3d9\ud654"),
      bullet("journal: \uc624\ub298 \uc0ac\uc6a9\ud55c \uc571/\uba85\ub839\uc5b4 \uae30\ubc18 \uc5c5\ubb34 \uc77c\uc9c0 \ub9c8\ud06c\ub2e4\uc6b4 \uc790\ub3d9 \uc0dd\uc131"),
      bullet("routine: \ucd9c\uadfc/\ud1f4\uadfc \ub8e8\ud2f4 \ub4f1\ub85d \u2192 \ud55c \ubc88\uc5d0 \uc2e4\ud589"),
      bullet("scaffold: \ud504\ub85c\uc81d\ud2b8 \ud3f4\ub354 \uad6c\uc870 \ud15c\ud50c\ub9bf \uc77c\uad04 \uc0dd\uc131"),

      new Paragraph({ children: [new PageBreak()] }),

      // ─── 4. 보안 ───
      h1("4. \ubcf4\uc548 \u2014 \uc0ac\ub0b4 \uc804\uc6a9 \uc6d0\uce59"),
      p("AX Commander\ub294 \uc0ac\ub0b4 \uc804\uc6a9 \ud504\ub85c\uadf8\ub7a8\uc73c\ub85c, \uc678\ubd80 \ub124\ud2b8\uc6cc\ud06c \ud1b5\uc2e0\uc744 \uc77c\uccb4 \ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4."),
      bullet("\uc678\ubd80 HTTP/HTTPS \ud638\ucd9c \uae08\uc9c0 \u2014 HttpClient, WebClient \ub4f1 \uc0ac\uc6a9 \ubd88\uac00"),
      bullet("\uc678\ubd80 SDK \uc5f0\ub3d9 \uae08\uc9c0 \u2014 \ud074\ub77c\uc6b0\ub4dc AI, SaaS \ub77c\uc774\ube0c\ub7ec\ub9ac \ubd88\uac00"),
      bullet("\ud074\ub9bd\ubcf4\ub4dc \ud788\uc2a4\ud1a0\ub9ac \u2014 Windows DPAPI \uc554\ud638\ud654 (CurrentUser \ubc94\uc704)"),
      bullet("\ud654\uba74 \ucea1\ucc98 \u2014 \ud074\ub9bd\ubcf4\ub4dc\uc5d0\ub9cc \ubcf5\uc0ac, \ud30c\uc77c \uc800\uc7a5 \uae30\ub2a5 \uc644\uc804 \uc81c\uac70"),
      bullet("\uc2dc\uc2a4\ud15c \uba85\ub839 \u2014 \uc7ac\uc2dc\uc791/\uc885\ub8cc \ub4f1 \uc704\ud5d8 \uba85\ub839 \uc2e4\ud589 \uc804 2\ub2e8\uacc4 \ud655\uc778 \ub2e4\uc774\uc5bc\ub85c\uadf8"),

      // ─── 5. 테마 ───
      h1("5. \ud14c\ub9c8 \uc2dc\uc2a4\ud15c"),
      p("9\uac1c \ub0b4\uc7a5 \ud14c\ub9c8(Dark, Light, OLED, Nord, Monokai, Catppuccin, Sepia, Alfred, Alfred Light) + \ucee4\uc2a4\ud140 \ud14c\ub9c8\ub97c \uc9c0\uc6d0\ud569\ub2c8\ub2e4."),
      bullet("\uac01 \ud14c\ub9c8\ub294 \uc0c9\uc0c1\ubfd0 \uc544\ub2c8\ub77c \ubaa8\uc11c\ub9ac \ub77c\uc6b4\ub529 \ube44\uc728\ub3c4 \ub2e4\ub985\ub2c8\ub2e4 (OLED\uac00 \uac00\uc7a5 \ub465\uae00\uace0, Monokai\uac00 \uac00\uc7a5 \uac01\uc9d0)"),
      bullet("\ucee4\uc2a4\ud140 \ud14c\ub9c8\ub294 14\uac1c \uc0c9\uc0c1 + \ubaa8\uc11c\ub9ac \ub77c\uc6b4\ub529 \uc2ac\ub77c\uc774\ub354\ub85c \uc790\uc720\ub86d\uac8c \ud3b8\uc9d1"),
      bullet("\ud2b8\ub808\uc774 \uba54\ub274\ub3c4 \ud604\uc7ac \ud14c\ub9c8\ub97c \uc790\ub3d9\uc73c\ub85c \ub530\ub77c\uac10"),

      // ─── 6. 기술 스택 ───
      h1("6. \uae30\uc220 \uc2a4\ud0dd"),
      bullet(".NET 8, WPF (UseWPF=true), WinForms (ColorDialog/FolderBrowser \ub4f1 \uc81c\ud55c\uc801 \uc0ac\uc6a9)"),
      bullet("P/Invoke: SetWindowPos, PrintWindow, GlobalMemoryStatusEx, EnumWindows, GetPixel \ub4f1 Windows API \uc9c1\uc811 \ud638\ucd9c"),
      bullet("\ub2e8\uc77c EXE \ubc30\ud3ec: Self-Contained + PublishSingleFile + IncludeNativeLibrariesForSelfExtract"),
      bullet("\ubcf4\uc548: DPAPI(System.Security.Cryptography.ProtectedData), HKCU \ub808\uc9c0\uc2a4\ud2b8\ub9ac"),
      bullet("\ud14c\uc2a4\ud2b8: xUnit 2.9.0 + FluentAssertions (57\uac1c \ub2e8\uc704 \ud14c\uc2a4\ud2b8)"),

      // ─── 7. 마무리 ───
      h1("7. \ub9c8\ubb34\ub9ac \u2014 LLM\uacfc \ud568\uaed8 \ub9cc\ub4e0 \ud504\ub85c\uc81d\ud2b8"),
      p("AX Commander\ub294 \uae30\ud68d\ubd80\ud130 \uad6c\ud604, \ud14c\uc2a4\ud2b8, \ubb38\uc11c\ud654\uae4c\uc9c0 LLM(Claude)\uacfc \ud568\uaed8 \uc9c4\ud589\ud55c \ud504\ub85c\uc81d\ud2b8\uc785\ub2c8\ub2e4."),
      bullet("\uae30\ud68d: Alfred, Raycast \ub4f1 \uae30\uc874 \ub7f0\ucc98\uc758 \uc7a5\uc810\uc744 \ubd84\uc11d\ud558\uace0, \uc0ac\ub0b4 \ud658\uacbd\uc5d0 \ub9de\ub294 \uae30\ub2a5 \uc120\ubcc4"),
      bullet("\uad6c\ud604: WPF + P/Invoke \uae30\ubc18\uc73c\ub85c \uc678\ubd80 \uc758\uc874\uc131 \uc5c6\uc774 40\uac1c+ \uae30\ub2a5 \uad6c\ud604"),
      bullet("\uac80\uc218: \ucf54\ub4dc \ub9ac\ubdf0, \uc624\ub958 \ubd84\uc11d, \ubcf4\uc548 \uc810\uac80, \uc131\ub2a5 \ucd5c\uc801\ud654\ub97c LLM\uacfc \ud568\uaed8 \ubc18\ubcf5"),
      bullet("\ubb38\uc11c: \uac1c\ubc1c \ubb38\uc11c, \uc0ac\uc6a9\uc790 \ub9e4\ub274\uc5bc, \ube14\ub85c\uadf8 \uae00\uae4c\uc9c0 LLM\uc774 \uc791\uc131"),
      p(""),
      para(new TextRun({ text: "\uac1c\uc778\uc801\uc73c\ub85c \ub290\ub080 \uac83\uc740, LLM\uc740 \u2018\ucf54\ub4dc \uc0dd\uc131\uae30\u2019\uac00 \uc544\ub2c8\ub77c \u2018\ud568\uaed8 \uc0dd\uac01\ud558\ub294 \ub3d9\ub8cc\u2019\uc5d0 \uac00\uae5d\ub2e4\ub294 \uac83\uc785\ub2c8\ub2e4.", italics: true })),
      para(new TextRun({ text: "\u201c\uc774 \uae30\ub2a5\uc740 \uc774\ub807\uac8c \ud558\uba74 \uc5b4\ub5a0\ub0d0?\u201d \u201c\uc774 \ubd80\ubd84\uc740 \ubcf4\uc548 \ub9ac\uc2a4\ud06c\uac00 \uc788\uc5b4\u201d \u201c\uc0ac\uc6a9\uc790\uac00 \uc774\ub807\uac8c \uc4f0\uba74 \ubb38\uc81c\ub420 \uc218 \uc788\uc5b4\u201d \u2014 \uc774\ub7f0 \ud53c\ub4dc\ubc31\uc744 \uc8fc\uace0\ubc1b\uc73c\uba70 \ud504\ub85c\uc81d\ud2b8\ub97c \uc644\uc131\ud588\uc2b5\ub2c8\ub2e4.", italics: true })),
      p(""),
      p("AX Commander v1.0 \u2014 \ubaa8\ub4e0 \uc5c5\ubb34\ub97c \ud0a4\ubcf4\ub4dc \ud558\ub098\ub85c.", { bold: true }),

      new Paragraph({ spacing: { before: 400 },
        border: { top: { style: BorderStyle.SINGLE, size: 2, color: "CCCCCC", space: 8 } },
        children: [
          new TextRun({ text: "\ubc31\uc2b9\uc7ac \u00b7 AX\uc5f0\uad6c\uc18c AI\ud300 \u00b7 SW Architect \u00b7 www.swarchitect.net", size: 18, color: "999999" })
        ]
      }),
    ]
  }]
});

Packer.toBuffer(doc).then(buffer => {
  fs.writeFileSync("E:\\AX Commander\\docs\\AX_Commander_블로그_소개글.docx", buffer);
  console.log("Blog post DOCX created successfully!");
});
