# -*- coding: utf-8 -*-
import io, sys, os, ast
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
os.chdir(r"D:\work buddy\2026-11-05-14-15-52")

idx = open("index_main.html", encoding="utf-8").read()

anchor = 'url:"details/gatech-building-construction-facility-management-ms.html"},\n];'
assert anchor in idx, "PROGRAMS anchor not found"

new_progs = (
'{id:"gatech-inta-ms",s:"gatech",n:"国际事务硕士（MS International Affairs）",en:"Master of Science in International Affairs",dept:"Sam Nunn School of International Affairs",college:"Georgia Tech",disc:"soc",lvl:"m",deg:"MS",dur:"42 学分；2 年；需外语 2 年 + 经济学素养",stem:0,rank:"",test:{cls:""},ddl:"catalog 页未列具体轮次（待补）",lang:"TOEFL iBT / IELTS Academic（最低分待补）",tui:"catalog 页未列打包学费（待补）",url:"details/gatech-international-affairs-ms.html"},\n'
'{id:"gatech-gd-ms",s:"gatech",n:"全球发展硕士（MS Global Development）",en:"Master of Science in Global Development",dept:"Sam Nunn / CRP / Econ 跨学院",college:"Georgia Tech",disc:"soc",lvl:"m",deg:"MS",dur:"36 学分；12 个月；核心课 + 方向 + 顶点 Studio",stem:0,rank:"",test:{cls:""},ddl:"catalog 页未列具体轮次（待补）",lang:"TOEFL iBT / IELTS Academic（最低分待补）",tui:"catalog 页未列打包学费（待补）",url:"details/gatech-global-development-ms.html"},\n'
'{id:"gatech-mcrp",s:"gatech",n:"城市与区域规划硕士（MCRP）",en:"Master of City and Regional Planning",dept:"城市与区域规划学院（CRP）",college:"Georgia Tech",disc:"soc",lvl:"m",deg:"MCRP",dur:"55 学分；2 年；7 个专业方向；只招秋季；1/15 奖助 / 2/15 最终",stem:0,rank:"",test:{cls:""},ddl:"1/15 奖助截止；2/15 最终截止",lang:"TOEFL iBT / IELTS Academic（最低分待补）",tui:"catalog 页未列打包学费（待补）",url:"details/gatech-mcrp.html"},\n'
'{id:"gatech-march",s:"gatech",n:"建筑学硕士（M.Arch.）",en:"Master of Architecture",dept:"School of Architecture",college:"Georgia Tech",disc:"art",lvl:"m",deg:"M.Arch.",dur:"60-102 学分（视前置背景）；NAAB 认证；1/3 截止；需 portfolio",stem:1,rank:"",test:{cls:""},ddl:"1/3 秋季入学",lang:"TOEFL iBT 100+ / IELTS 7.5（catalog 页原文 TOEFL 5+ 疑笔误，以系站为准）",tui:"catalog 页未列打包学费（待补）",url:"details/gatech-march.html"},\n'
'{id:"gatech-biology-ms",s:"gatech",n:"生物学硕士（MS Biology）",en:"Master of Science in Biology",dept:"School of Biological Sciences",college:"Georgia Tech",disc:"sci",lvl:"m",deg:"MS",dur:"36 学分；Thesis/Non-Thesis 双选；默认 Non-thesis",stem:1,rank:"",test:{cls:""},ddl:"catalog 页未列具体轮次（待补）",lang:"TOEFL iBT / IELTS Academic（最低分待补）",tui:"catalog 页未列打包学费（待补）",url:"details/gatech-biology-ms.html"},\n'
)

idx = idx.replace(anchor, 'url:"details/gatech-building-construction-facility-management-ms.html"},\n' + new_progs + '];', 1)

# CATD 补录 3 条新建（Intl Affairs / Global Development 已有占位）
catd_start = idx.find("const CATD=")
vd_start = idx.find("const VERIFIED_DETAILS=")
catd_seg = idx[catd_start:vd_start]
catd_end = catd_seg.rfind("];")
abs_catd_end = catd_start + catd_end
catd_new = (
',["gatech", "城市与区域规划学院", "City and Regional Planning", "城市与区域规划", "MCRP", "https://catalog.gatech.edu/programs/mcrp/", "soc", "details/gatech-mcrp.html"]'
',["gatech", "建筑学院", "Architecture", "建筑学", "M.Arch.", "https://catalog.gatech.edu/programs/march/", "art", "details/gatech-march.html"]'
',["gatech", "生物科学学院", "Biology", "生物学", "MS", "https://catalog.gatech.edu/programs/biology-ms/", "sci", "details/gatech-biology-ms.html"]'
)
idx = idx[:abs_catd_end] + catd_new + idx[abs_catd_end:]

# VD 追加 5 条
vd_start2 = idx.find("const VERIFIED_DETAILS=new Set([")
vd_end = idx.find("]);", vd_start2)
vd_new = (
',"details/gatech-international-affairs-ms.html"'
',"details/gatech-global-development-ms.html"'
',"details/gatech-mcrp.html"'
',"details/gatech-march.html"'
',"details/gatech-biology-ms.html"'
)
idx = idx[:vd_end] + vd_new + idx[vd_end:]

open("index_main.html", "w", encoding="utf-8").write(idx)
print("DONE size:", len(idx))
ast.parse(open(__file__, encoding="utf-8").read())
print("syntax OK")
