import openpyxl
from openpyxl.styles import Font

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

col_widths = {"A": 12, "B": 8, "C": 10, "D": 10, "E": 50, "F": 15, "G": 50, "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 = [
    # === 11号耍宝 ===
    ["TL", None, None, None, "【镜头】11号从角落探出来，黑烟已经散了一些。它挺起胸膛。", None, None, None, None],
    [None, None, None, None, None, "Eleven", "Bip Bop! I am a good teacher!", None, None],
    [None, None, None, None, None, "Eleven", "I showed an example for my students!", None, None],
    [None, None, None, None, None, "Eleven", "Doctor Eleven is the best example! BipBop!", None, None],
    [None, None, None, None, None, "Ben", "Haha! You? A good example?", None, None],
    [None, None, None, None, None, "Ben", "You can't even read the blackboard!", None, None],
    [None, None, None, None, "【emoji】全班 emoji_laugh", None, None, None, None],
    # === 中互动8：Example ===
    ["中互动", None, None, None, None, "Ben", "Was Eleven a good example?", None, None],
    [None, None, None, None, None, "User", "No! Eleven is a bad example!", None, None],
    # === 11号冒烟退场 ===
    ["TL", None, None, None, "【emoji】Eleven emoji_sad", None, None, None, None],
    [None, None, None, None, None, "Eleven", "Bip...Bip... I'm a good teacher...", None, None],
    [None, None, None, None, "11号又开始冒黑烟，缩回角落。", None, None, None, None],
    [None, None, None, None, None, "Eleven", "I need to cool down again... BipBip...", None, None],
    [None, None, None, None, "【emoji】全班 emoji_laugh", None, None, None, None],
    # === Justin进入正题 ===
    [None, None, None, None, "Justin笑着摇头。", None, None, None, None],
    [None, None, None, None, None, "Justin", "Okay okay. Let me help.", None, None],
    [None, None, None, None, None, "Justin", "This is not hero change.", None, None],
    [None, None, None, None, None, "Justin", "This is a dragon dance!", None, None],
    [None, None, None, None, None, "Leo", "Dragon dance?", None, None],
    [None, None, None, None, None, "Justin", "Yes! But first, you need to stand in a line.", None, None],
    [None, None, None, None, None, "Justin", "Come! Everyone, stand in line!", None, None],
    [None, None, None, None, "Leo第一个冲到最前面。", None, None, None, None],
    [None, None, None, None, None, "Leo", "I'm number 1! I'm first in line!", None, None],
    [None, None, None, None, "Ben排到Leo后面，Vicky排第三。", None, None, None, None],
    [None, None, None, None, None, "Ben", "I'm number 2.", None, None],
    [None, None, None, None, None, "Vicky", "And I'm number 3 in line.", None, None],
    [None, None, None, None, None, "Justin", "Good! Now, number 1 does move 1.", None, None],
    [None, None, None, None, None, "Justin", "Number 2 does move 2.", None, None],
    [None, None, None, None, None, "Justin", "When you all move together, you look like a dragon!", None, None],
    # === 中互动9：Line拖拽 ===
    ["中互动", None, None, None, "【教研图】教室场景，同学散乱站着。User把Leo拖到位置1、Ben到位置2、Vicky到位置3，排成一条line。完成后队列亮起。", None, None, None, None],
    [None, None, None, None, None, "User", "Stand in line! Leo is 1, Ben is 2, Vicky is 3!", None, None],
    # === Justin示范，Leo做不好 ===
    ["TL", None, None, None, "大家排好了。Justin走到队伍前方。", None, None, None, None],
    [None, None, None, None, None, "Justin", "Number 1 is the dragon head.", None, None],
    [None, None, None, None, None, "Justin", "The head move is very important.", None, None],
    [None, None, None, None, None, "Justin", "Take me as an example.", None, None],
    [None, None, None, None, None, "Justin", "Watch my head and arms.", None, None],
    [None, None, None, None, "Justin做了一个流畅的龙头动作——抬头、双臂向前划。", None, None, None, None],
    [None, None, None, None, None, "Leo", "Easy! Watch me!", None, None],
    [None, None, None, None, "Leo尝试模仿，但做成了超人变身招式。", None, None, None, None],
    [None, None, None, None, None, "Justin", "No no, not hero change!", None, None],
    [None, None, None, None, "Leo再试一次，胳膊不协调地乱甩。", None, None, None, None],
    [None, None, None, None, "【emoji】Leo emoji_sad", None, None, None, None],
    [None, None, None, None, None, "Leo", "Hmm... it's hard.", None, None],
    [None, None, None, None, "Justin看了一眼Vicky。", None, None, None, None],
    [None, None, None, None, None, "Justin", "My Vicky's move is so good!", None, None],
    [None, None, None, None, None, "Justin", "She's always the best!", None, None],
    [None, None, None, None, "【emoji】Vicky emoji_shy", None, None, None, None],
    [None, None, None, None, None, "Vicky", "Grandpa... not again...", None, None],
    [None, None, None, None, "【emoji】全班 emoji_laugh", None, None, None, None],
    # === 中互动10 ===
    ["中互动", None, None, None, None, "Justin", "Is Leo in the right place?", None, None],
    [None, None, None, None, None, "User", "Leo is number 1 in line. But his move is wrong!", None, None],
    # === Leo退出，User接替 ===
    ["TL", None, None, None, "Leo又试了一次，还是做不好。", None, None, None, None],
    [None, None, None, None, None, "Leo", "Ahh... I can't do it.", None, None],
    [None, None, None, None, None, "Leo", "I'm a Hero... not a Dragon.", None, None],
    [None, None, None, None, None, "Leo", "Hero change is my thing!", None, None],
    [None, None, None, None, "Leo从1号位退出来，有点失落。", None, None, None, None],
    [None, None, None, None, None, "Ben", "It's okay Leo.", None, None],
    [None, None, None, None, None, "Leo", "Someone better can be number 1.", None, None],
    [None, None, None, None, "大家看向User。", None, None, None, None],
    [None, None, None, None, None, "Justin", "We need a new number 1 in line.", None, None],
    [None, None, None, None, None, "Justin", "Who wants to be the dragon head?", None, None],
    # === 中互动11 ===
    ["中互动", None, None, None, None, "User", "I'll stand in line! I'm number 1!", None, None],
    # === User做龙头 ===
    ["TL", None, None, None, "User站到队伍最前面。队伍变成：User 1号、Ben 2号、Vicky 3号。", None, None, None, None],
    [None, None, None, None, None, "Justin", "Good! Now do the head move.", None, None],
    [None, None, None, None, "Justin再次示范龙头动作。User跟着做，比Leo协调。", None, None, None, None],
    [None, None, None, None, None, "Justin", "Yes! Very good!", None, None],
    [None, None, None, None, "Leo在后面挥拳。", None, None, None, None],
    [None, None, None, None, None, "Leo", "Go go go! Dragon head!", None, None],
    [None, None, None, None, None, "Justin", "Everyone, follow the head. Move!", None, None],
    [None, None, None, None, "大家跟着动起来，歪歪扭扭但有了雏形。", None, None, None, None],
    [None, None, None, None, "【emoji】全班 emoji_laugh", None, None, None, None],
    [None, None, None, None, None, "Vicky", "We look so funny!", None, None],
    [None, None, None, None, None, "Ben", "But it's working!", None, None],
    # === 中互动12 ===
    ["中互动", None, None, None, None, "Leo", "How does it feel? Being the dragon head?", None, None],
    [None, None, None, None, None, "User", "I'm the head of the line! Let's move together!", 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_L2_第3幕剧本_v2.xlsx"
wb.save(output_path)
print(f"OK: {output_path}")
