# -*- 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()

# 1) PROGRAMS 末条锚点
anchor = 'url:"details/gatech-supply-chain-engineering-ms.html"},\n];'
assert anchor in idx, "PROGRAMS anchor not found"

new_progs = (
'{id:"gatech-cse-ms",s:"gatech",n:"计算科学与工程硕士（MS CSE）",en:"Master of Science in Computational Science and Engineering",dept:"跨学院（CoC/CoS/CoE）",college:"Georgia Tech",disc:"cs",lvl:"m",deg:"MS",dur:"30 学分；Core 5 选 4 + Minor 12cr + Course/Thesis 6cr",stem:1,rank:"",test:{cls:""},ddl:"catalog 页未列具体轮次（待补）",lang:"TOEFL iBT / IELTS Academic（最低分待补）",tui:"catalog 页未列打包学费（待补）",url:"details/gatech-computational-science-engineering-ms.html"},\n'
'{id:"gatech-econ-ms",s:"gatech",n:"经济学硕士（MS Economics）",en:"Master of Science in Economics",dept:"经济学院（Ivan Allen College）",college:"Georgia Tech",disc:"soc",lvl:"m",deg:"MS",dur:"30 学分，授课型；经济选修 + 导师批准选修",stem:1,rank:"",test:{cls:""},ddl:"catalog 页未列具体轮次（待补）",lang:"TOEFL iBT / IELTS Academic（最低分待补）",tui:"catalog 页未列打包学费（待补）",url:"details/gatech-economics-ms.html"},\n'
'{id:"gatech-urban-analytics-ms",s:"gatech",n:"城市分析硕士（MS Urban Analytics）",en:"Master of Science in Urban Analytics",dept:"城市区域规划学院 / 跨学院",college:"Georgia Tech",disc:"soc",lvl:"m",deg:"MS",dur:"30 学分；城市系统核心 + Capstone + 空间分析 + 计算统计",stem:1,rank:"",test:{cls:""},ddl:"catalog 页未列具体轮次（待补）",lang:"TOEFL iBT / IELTS Academic（最低分待补）",tui:"catalog 页未列打包学费（待补）",url:"details/gatech-urban-analytics-ms.html"},\n'
'{id:"gatech-me-ms",s:"gatech",n:"机械工程硕士（MS Mechanical Engineering）",en:"Master of Science in Mechanical Engineering",dept:"Woodruff 机械工程学院",college:"Georgia Tech",disc:"eng",lvl:"m",deg:"MS",dur:"30 学分；Non-Thesis/Thesis 双选；Major 21cr + Minor 6cr + Math 3cr；GPA≥3.0",stem:1,rank:"",test:{cls:""},ddl:"catalog 页未列具体轮次（待补）",lang:"TOEFL iBT / IELTS Academic（最低分待补）",tui:"catalog 页未列打包学费（待补）",url:"details/gatech-mechanical-engineering-ms.html"},\n'
'{id:"gatech-bioinfo-ms",s:"gatech",n:"生物信息学硕士（MS Bioinformatics）",en:"Master of Science in Bioinformatics",dept:"生物科学学院 / 跨学院",college:"Georgia Tech",disc:"sci",lvl:"m",deg:"MS",dur:"36 学分；Core + 统计要求 + Capstone + 生信选修",stem:1,rank:"",test:{cls:""},ddl:"catalog 页未列具体轮次（待补）",lang:"TOEFL iBT / IELTS Academic（最低分待补）",tui:"catalog 页未列打包学费（待补）",url:"details/gatech-bioinformatics-ms.html"},\n'
)

idx = idx.replace(anchor, 'url:"details/gatech-supply-chain-engineering-ms.html"},\n' + new_progs + '];', 1)

# 2) CATD 补录 4 条无占位（CSE/Econ/ME/Bioinfo；urban-analytics 已有占位）
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", "计算学院/跨学院", "Computational Science and Engineering", "计算科学与工程", "MS", "https://catalog.gatech.edu/programs/computational-science-engineering-ms/", "cs", "details/gatech-computational-science-engineering-ms.html"]'
',["gatech", "经济学院", "Economics", "经济学", "MS", "https://catalog.gatech.edu/programs/economics-ms/", "soc", "details/gatech-economics-ms.html"]'
',["gatech", "Woodruff 机械工程学院", "Mechanical Engineering", "机械工程", "MS", "https://catalog.gatech.edu/programs/mechanical-engineering-ms/", "eng", "details/gatech-mechanical-engineering-ms.html"]'
',["gatech", "生物科学学院/跨学院", "Bioinformatics", "生物信息学", "MS", "https://catalog.gatech.edu/programs/bioinformatics-ms/", "sci", "details/gatech-bioinformatics-ms.html"]'
)
idx = idx[:abs_catd_end] + catd_new + idx[abs_catd_end:]

# 3) VD 追加 5 条
vd_start2 = idx.find("const VERIFIED_DETAILS=new Set([")
vd_end = idx.find("]);", vd_start2)
vd_new = (
',"details/gatech-computational-science-engineering-ms.html"'
',"details/gatech-economics-ms.html"'
',"details/gatech-urban-analytics-ms.html"'
',"details/gatech-mechanical-engineering-ms.html"'
',"details/gatech-bioinformatics-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")
