# -*- coding: utf-8 -*-
import io, pathlib, json, time
BASE = pathlib.Path(r"D:\work buddy\2026-11-05-14-15-52")
P = BASE / "index_main.html"
s = io.open(P, encoding="utf-8").read()
old = "最终截止 2027-06-30（美东 23:59 口径按官网）"
new = "最终截止 2027-06-30"
assert s.count(old) == 1, s.count(old)
s = s.replace(old, new, 1)
io.open(P, "w", encoding="utf-8", newline="").write(s)
st = P.stat()
b = json.loads((BASE / "_heartbeat_baseline.json").read_text(encoding="utf-8"))
b["main_file_mtime"] = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(st.st_mtime))
b["main_file_bytes"] = st.st_size
(BASE / "_heartbeat_baseline.json").write_text(json.dumps(b, ensure_ascii=False, indent=1), encoding="utf-8")
print("patched", st.st_size, b["main_file_mtime"])
