# -*- coding: utf-8 -*- """CSS 完整性检查:花括号平衡 + 关键美化标记存活""" import sys src = open('templates/index.html', encoding='utf-8').read() style = src.split('')[0] ok = style.count('{') == style.count('}') marks = sum(1 for m in ['font-family: inherit', 'kw.on { text-shadow', 'uc-card:hover', 'theme-fading', 'textarea.input', 'prefers-reduced-motion', '美化层 v4', '美化层 v5', 'safe-area-inset'] if m in style) with open('_css_ok.txt', 'w', encoding='utf-8') as f: f.write(f'braces={style.count("{")}=={style.count("}")} {ok} | marks {marks}/9') print('ok')