# -*- coding: utf-8 -*-
import os, sys, io
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
os.chdir(r"D:\work buddy\2026-11-05-14-15-52")
p = "index_main.html"
idx = open(p, encoding="utf-8").read()
# 修复 CATD 段：up-edupol 记录末尾 "edu", ["up","CIS 系... 应为 "edu", "details/up-edupol.html"],["up","CIS 系...
bad = '"edu", ["up","CIS 系 / ESE 系","MSE in Artificial Intelligence"'
good = '"edu", "details/up-edupol.html"],["up","CIS 系 / ESE 系","MSE in Artificial Intelligence"'
assert bad in idx, "bad CATD pattern not found"
idx = idx.replace(bad, good, 1)
open(p, "w", encoding="utf-8").write(idx)
print("FIXED CATD up-edupol det")
