with open('/www/wwwroot/gaokao/index.html', 'r') as f: c = f.read() old_footer_right = ' ' new_footer_right = ' ' if old_footer_right in c: c = c.replace(old_footer_right, new_footer_right) # Update grid columns c = c.replace('.footer-inner { display: grid; grid-template-columns: 1fr auto; gap: 40px;', '.footer-inner { display: grid; grid-template-columns: 1fr auto auto; gap: 40px;') # Add donate button CSS donate_css = '.footer-donate-btn{display:inline-block;margin-top:6px;color:#667eea;text-decoration:none;font-size:0.85rem;padding:5px 14px;border-radius:20px;border:1px solid rgba(102,126,234,0.3);transition:all 0.3s}.footer-donate-btn:hover{background:rgba(102,126,234,0.1);border-color:#667eea}' # Update contact-title alignment (remove text-align:right default) c = c.replace('.footer-contact-title { color: #888; font-size: 0.82rem; margin-bottom: 10px; text-align: right; }', '.footer-contact-title { color: #888; font-size: 0.82rem; margin-bottom: 10px; }') # Insert donate CSS before .footer-qr c = c.replace('.footer-qr {', donate_css + ' .footer-qr {') with open('/www/wwwroot/gaokao/index.html', 'w') as f: f.write(c) print('Done! Footer updated with donate button') else: print('Pattern not found') # Debug: find footer-right idx = c.find('footer-right') if idx >= 0: print('Context:', repr(c[idx-50:idx+150]))