# -*- 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-analytics-ms.html"},\n];'
assert anchor in idx, "PROGRAMS anchor not found"

new_progs = (
'{id:"gatech-or-ms",s:"gatech",n:"运筹学硕士（MS Operations Research）",en:"Master of Science in Operations Research",dept:"工业与系统工程学院（ISyE）",college:"Georgia Tech",disc:"eng",lvl:"m",deg:"MS",dur:"30 学分，无论文；Practicum Track",stem:1,rank:"",test:{cls:""},ddl:"catalog 页未列具体轮次（待补）",lang:"TOEFL iBT / IELTS Academic（最低分待补）",tui:"catalog 页未列打包学费（待补）",url:"details/gatech-operations-research-ms.html"},\n'
'{id:"gatech-hs-ms",s:"gatech",n:"健康系统硕士（MS Health Systems）",en:"Master of Science in Health Systems",dept:"工业与系统工程学院（ISyE）",college:"Georgia Tech",disc:"med",lvl:"m",deg:"MS",dur:"33 学分，无论文；Predictive Health Track",stem:1,rank:"",test:{cls:""},ddl:"catalog 页未列具体轮次（待补）",lang:"TOEFL iBT / IELTS Academic（最低分待补）",tui:"catalog 页未列打包学费（待补）",url:"details/gatech-health-systems-ms.html"},\n'
'{id:"gatech-qcf-ms",s:"gatech",n:"量化与计算金融硕士（MS QCF）",en:"Master of Science in Quantitative and Computational Finance",dept:"跨学院（ISyE/Math/Scheller）",college:"Georgia Tech",disc:"biz",lvl:"m",deg:"MS",dur:"36 学分，无论文；Internship/Practicum Track；含 Capstone",stem:1,rank:"",test:{cls:""},ddl:"catalog 页未列具体轮次（待补）",lang:"TOEFL iBT / IELTS Academic（最低分待补）",tui:"catalog 页未列打包学费（待补）",url:"details/gatech-quantitative-and-computational-finance-ms.html"},\n'
'{id:"gatech-ie-ms",s:"gatech",n:"工业工程硕士（MS Industrial Engineering）",en:"Master of Science in Industrial Engineering",dept:"工业与系统工程学院（ISyE）",college:"Georgia Tech",disc:"eng",lvl:"m",deg:"MS",dur:"30 学分，无论文；Practicum Track",stem:1,rank:"",test:{cls:""},ddl:"catalog 页未列具体轮次（待补）",lang:"TOEFL iBT / IELTS Academic（最低分待补）",tui:"catalog 页未列打包学费（待补）",url:"details/gatech-industrial-engineering-ms.html"},\n'
'{id:"gatech-sce-ms",s:"gatech",n:"供应链工程硕士（MS Supply Chain Engineering）",en:"Master of Science in Supply Chain Engineering",dept:"工业与系统工程学院（ISyE）",college:"Georgia Tech",disc:"eng",lvl:"m",deg:"MS",dur:"30 学分；Practicum Track；含 6cr Capstone",stem:1,rank:"",test:{cls:""},ddl:"catalog 页未列具体轮次（待补）",lang:"TOEFL iBT / IELTS Academic（最低分待补）",tui:"catalog 页未列打包学费（待补）",url:"details/gatech-supply-chain-engineering-ms.html"},\n'
)

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

# 2) CATD 补录 2 条无占位（OR MS / IE MS）
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", "工业与系统工程学院", "Operations Research", "运筹学", "MS", "https://catalog.gatech.edu/programs/operations-research-ms/", "eng", "details/gatech-operations-research-ms.html"]'
',["gatech", "工业与系统工程学院", "Industrial Engineering", "工业工程", "MS", "https://catalog.gatech.edu/programs/industrial-engineering-ms/", "eng", "details/gatech-industrial-engineering-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-operations-research-ms.html"'
',"details/gatech-health-systems-ms.html"'
',"details/gatech-quantitative-and-computational-finance-ms.html"'
',"details/gatech-industrial-engineering-ms.html"'
',"details/gatech-supply-chain-engineering-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")
