import re

fp = r'e:\TRAE\生成式X\gen_lecture1.py'
with open(fp, 'r', encoding='utf-8') as f:
    content = f.read()

# Remove inline font-size patterns like font-size:.9rem; font-size:1.05rem; font-size:1.1rem; etc.
# Keep font-size values >= 1.5rem (these are intentional large headings)
def remove_small_fontsize(match):
    val = match.group(1)
    num = float(re.search(r'[\d.]+', val).group())
    if num < 1.5:
        return ''
    return match.group(0)

content = re.sub(r'font-size:\s*([\d.]+rem);?', remove_small_fontsize, content)

# Also fix the monospace font-size in the quote block (line 347)
# was font-size:.9rem -> remove it

with open(fp, 'w', encoding='utf-8') as f:
    f.write(content)

print("Done - removed small inline font-size declarations")
