import openpyxl
from openpyxl.styles import Font

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

col_widths = {"A": 18, "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, "龙头用paper cups和paper spoons拼好了。Justin拍拍手。", None, None, None, None],
    [None, None, None, None, None, "Justin", "The dragon head is ready!", None, None],
    [None, None, None, None, None, "Justin", "Now we need to decorate it.", None, None],
    [None, None, None, None, None, "Justin", "But remember, the patterns must be Chinese!", None, None],
    [None, None, None, None, None, "Justin", "Chinese cloud, Chinese dragon scales!", None, None],
    [None, None, None, None, "Sunny直接把几片叶子放到龙头上。", None, None, None, None],
    [None, None, None, None, None, "Sunny", "We can use these leaves to make it beautiful!", None, None],
    [None, None, None, None, None, "User", "No Sunny! Leaves are not Chinese!", None, None],
    ["中互动", None, None, None, "【教研图】几个装饰选项（叶子❌/Chinese money✅/其他❌），User选择Chinese money。", None, None, None, None],
    [None, None, None, None, None, "User", "We can use Chinese money to make it beautiful!", None, None],
    ["TL", None, None, None, "Sunny嘟嘴把叶子拿掉，换上Chinese money图案。其实她贴得很好看。", None, None, None, None],
    [None, None, None, None, None, "Sunny", "Fine... Chinese money then.", None, None],
    [None, None, None, None, None, "Ben", "Wow Sunny, that looks nice!", None, None],
    [None, None, None, None, None, "Sunny", "Of course it does.", None, None],
    ["TL", None, None, None, "画龙点睛时间。Justin骄傲地让Vicky来画龙的眼睛。他掏出手机准备拍照。", None, None, None, None],
    [None, None, None, None, None, "Justin", "Now, the eyes! My Vicky can do it!", None, None],
    [None, None, None, None, None, "Justin", "Everyone watch! I need to take a photo!", None, None],
    [None, None, None, None, "全班盯着看。Vicky拿起笔，手抖。", None, None, None, None],
    [None, None, None, None, None, "Vicky", "Grandpa... don't film me...", None, None],
    [None, None, None, None, "Vicky害羞，手一抖——眼睛画歪了。", None, None, None, None],
    [None, None, None, None, "【emoji】全班 emoji_shock", None, None, None, None],
    [None, None, None, None, None, "Matt", "Oh no! It's wrong!", None, None],
    [None, None, None, None, None, "Justin", "Ah... what can we do?", None, None],
    [None, None, None, None, "Matt从口袋掏出一块橡皮。", None, None, None, None],
    [None, None, None, None, None, "Vicky", "An eraser!", None, None],
    ["中互动", None, None, None, None, "User", "We can use an eraser to fix it!", None, None],
    ["TL", None, None, None, "Vicky拿起eraser擦掉，重新画。这次画好了。", None, None, None, None],
    [None, None, None, None, None, "Vicky", "There... much better.", None, None],
    [None, None, None, None, None, "Justin", "Beautiful! That's my girl!", None, None],
    [None, None, None, None, "【emoji】Vicky emoji_shy", None, None, None, None],
    ["TL", None, None, None, "Matt帮忙画龙嘴。追求完美——画了擦、擦了画，反复好多次。", None, None, None, None],
    [None, None, None, None, None, "Matt", "No... the mouth is not right.", None, None],
    [None, None, None, None, None, "Matt", "Again...", None, None],
    [None, None, None, None, None, "Matt", "Still not perfect!", None, None],
    [None, None, None, None, "Matt的eraser越来越短，快捏不住了。", None, None, None, None],
    [None, None, None, None, None, "Matt", "My eraser is too small now!", None, None],
    [None, None, None, None, None, "Matt", "Can I use yours?", None, None],
    ["中互动", None, None, None, None, "User", "Here! We can use my eraser to help you!", None, None],
    ["TL", None, None, None, "Matt终于画出满意的龙嘴。", None, None, None, None],
    [None, None, None, None, None, "Matt", "Yes! Perfect! Finally!", None, None],
    [None, None, None, None, "【emoji】全班 emoji_laugh", None, None, None, None],
    ["TL", None, None, None, "龙头完成了！大家围着看——Chinese money图案、完美的眼睛和嘴巴、paper cups做的角。", None, None, None, None],
    [None, None, None, None, None, "Justin", "Look at this dragon head!", None, None],
    [None, None, None, None, None, "Justin", "Tell everyone what we did!", None, None],
    ["核心互动（口语）", None, None, None, "【教研图】龙头特写。User口语介绍龙头。", None, None, None, None],
    [None, None, None, None, None, "User", "I used a ruler to measure. We used an eraser to fix it. And we put Chinese money on it. It's a paper dragon 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_第3段剧本.xlsx"
wb.save(output_path)
print(f"OK: {output_path}")
