# -*- coding: utf-8 -*-
import io, sys, os, re, json
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
B = r"D:\work buddy\2026-11-05-14-15-52"
pub = os.path.join(B, "publish", "美加硕士项目查询库")
t = open(os.path.join(pub, "index_main.html"), encoding="utf-8").read()
refs = re.findall(r'"(details/[^"]+\.html)"', t)
disk = os.listdir(os.path.join(pub, "details"))
disk_lower = {n.lower(): n for n in disk}
mismatch, missing = [], []
for rel in refs:
    base = os.path.basename(rel)
    if base not in disk:
        if base.lower() in disk_lower:
            mismatch.append((base, disk_lower[base.lower()]))
        else:
            missing.append(rel)
print("引用数:", len(set(refs)))
print("精确大小写不匹配:", len(mismatch))
for a, b in mismatch[:15]: print("  引用:", a, "| 磁盘:", b)
print("磁盘缺失:", len(missing))
for m in missing[:10]: print("  ", m)
