import openpyxl
from openpyxl.styles import Font

wb = openpyxl.Workbook()
ws = wb.active
ws.title = "L3第2段剧本"

col_widths = {"A": 12, "B": 8, "C": 10, "D": 10, "E": 55, "F": 15, "G": 55, "H": 10, "I": 15}
for col, w in col_widths.items():
    ws.column_dimensions[col].width = w

headers = ["类型", "ID", "组件配置", "知识点", "剧情描述", "名字", "台词", "角色", "台词润色"]
bold = Font(bold=True)
for i, h in enumerate(headers, 1):
    cell = ws.cell(row=1, column=i, value=h)
    cell.font = bold

rows = [
    ["TL", None, None, None, "Justin拿出一张龙骨设计图展开。龙骨很长。", None, None, None, None],
    [None, None, None, None, None, "Justin", "Now, we need a dragon bone.", None, None],
    [None, None, None, None, None, "Justin", "The bone is paper too. If you fold it right, it is very strong!", None, None],
    [None, None, None, None, None, "Justin", "But it is very long. Each of you makes one piece.", None, None],
    [None, None, None, None, None, "Justin", "Every piece must be 15cm.", None, None],
    [None, None, None, None, None, "Matt", "How do we make sure?", None, None],
    [None, None, None, None, "Justin从工具箱拿出一把ruler。", None, None, None, None],
    [None, None, None, None, None, "Justin", "We can use a ruler to measure!", None, None],
    ["中互动", None, None, None, None, "Justin", "How do we make every piece the same?", None, None],
    [None, None, None, None, None, "User", "We can use a ruler to measure!", None, None],
    ["TL", None, None, None, "大家开始折龙骨。Matt折得很认真，每一下都量了又量。Ben大大咧咧直接折。Sunny懒洋洋地折了几下就停了。", None, None, None, None],
    [None, None, None, None, None, "Justin", "Good work everyone!", None, None],
    [None, None, None, None, None, "Justin", "Now, User, take this ruler.", None, None],
    [None, None, None, None, None, "Justin", "Check everyone's bone. Is it 15cm?", None, None],
    [None, None, None, None, "User拿着ruler，走到Ben面前量。", None, None, None, None],
    [None, None, None, None, None, "Ben", "How is mine?", None, None],
    [None, None, None, None, "Ben的龙骨明显太长了。", None, None, None, None],
    ["中互动", None, None, None, "User量度Ben的龙骨。", None, None, None, None],
    [None, None, None, None, None, "User", "It is too long! Cut it!", None, None],
    [None, None, None, None, None, "Ben", "Oops!", None, None],
    ["TL", None, None, None, "User走到Sunny面前量。Sunny的龙骨很短。", None, None, None, None],
    [None, None, None, None, None, "Sunny", "Is mine okay?", None, None],
    ["中互动", None, None, None, "User量度Sunny的龙骨。", None, None, None, None],
    [None, None, None, None, None, "User", "It is too short! Do it again!", None, None],
    [None, None, None, None, None, "Sunny", "But my hands are tired...", None, None],
    [None, None, None, None, None, "Vicky", "I'll help you, Sunny.", None, None],
    ["TL", None, None, None, "User走到Matt面前量——刚好15cm。", None, None, None, None],
    [None, None, None, None, None, "Matt", "How is mine?", None, None],
    [None, None, None, None, None, "User", "Perfect! 15cm!", None, None],
    [None, None, None, None, None, "Matt", "Of course. I measured it three times.", None, None],
    [None, None, None, None, "【emoji】全班 emoji_laugh", None, None, None, None],
    ["TL", None, None, None, "Ben剪掉多余的部分。Vicky拉着Sunny重新折。最后大家的龙骨都是15cm。", None, None, None, None],
    [None, None, None, None, None, "Justin", "Well done! Every piece is 15cm now.", None, None],
    [None, None, None, None, None, "Justin", "How did you do it?", None, None],
    ["中互动", None, None, None, None, "User", "My paper dragon bone is done! I used a ruler!", None, None],
    [None, None, None, None, None, "Justin", "Great! Now let's make the dragon body and head!", None, None],
]

for r_idx, row in enumerate(rows, 2):
    for c_idx, val in enumerate(row, 1):
        if val is not None:
            ws.cell(row=r_idx, column=c_idx, value=val)

output_path = "/root/.openclaw/workspace-xiaobian/output/U18_L3_第2段剧本.xlsx"
wb.save(output_path)
print(f"OK: {output_path}")
