import os, re, glob
# Find detail pages with "待补" / "unavailable" / "TBD" / "not available" markers
markers = ['待补', '待补全', '系站不可达', 'unavailable', 'TBD', 'to be determined', 'not publicly available', 'not specified', 'N/A']
hits = {}
for p in glob.glob('details/*.html'):
    try:
        with open(p, 'r', encoding='utf-8') as f:
            txt = f.read()
    except:
        continue
    found = []
    for mk in markers:
        if mk.lower() in txt.lower():
            found.append(mk)
    if found:
        hits[p] = found
print(f'Detail pages with pending markers: {len(hits)}')
# Sort by count of markers (more pending = more work)
for p, mks in sorted(hits.items(), key=lambda x: -len(x[1]))[:40]:
    sz = os.path.getsize(p)
    print(f'  {p}  ({sz}b)  markers={mks}')
