// Second-confirmation gate for destructive admin actions.
// The server independently requires confirm=yes; this is the UI half.
document.addEventListener('submit', function (e) {
  var form = e.target;
  if (form.classList && form.classList.contains('confirm')) {
    var msg = form.getAttribute('data-confirm') || '确认执行此操作？';
    if (!window.confirm(msg)) {
      e.preventDefault();
    }
  }
}, true);
