/* 所有表单、确认和提示弹窗共用尺寸、标题、输入框及按钮样式。 */
.modal-overlay { padding: 16px; overflow-y: auto; background: rgba(12, 18, 20, .58); backdrop-filter: blur(8px); }
.modal {
  width: min(480px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 48px);
  padding: 26px;
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .28);
}
.site-dialog { margin: auto; overflow-y: auto; }
.site-dialog [hidden] { display: none !important; }
.site-dialog::backdrop { background: rgba(12, 18, 20, .58); backdrop-filter: blur(8px); }
.site-dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.site-dialog-heading h3 { margin: 3px 0 0; font-size: 20px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.site-dialog-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
}
.site-dialog-close:hover { background: var(--accent-bg); color: var(--text); }
.site-dialog-close:disabled { opacity: .45; cursor: wait; }
#siteDialogMessage { margin: -4px 0 20px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; line-height: 1.7; color: var(--text-secondary); }
#siteDialogMessage:empty { display: none; }
.modal .form-group { margin-bottom: 16px; }
.modal .form-group label { margin-bottom: 7px; font-size: 13px; font-weight: 500; }
.modal .form-group input, .modal .form-group select, .modal .form-group textarea { padding: 10px 12px; border-radius: 9px; font-size: 14px; }
.modal .form-group input:not([type="checkbox"]), .modal .form-group select { min-height: 42px; }
.modal .form-group input[aria-invalid="true"], .modal .form-group select[aria-invalid="true"] { border-color: #bd4141; }
.modal .modal-actions { margin-top: 24px; gap: 10px; }
.modal .modal-actions .btn { min-width: 80px; min-height: 38px; padding: 8px 16px; border-radius: 9px; font-size: 14px; }
.modal .category-name-hint { font-size: 13px; line-height: 1.7; color: var(--text-secondary); }
.site-dialog-error, .modal .category-name-error { color: #bd4141; font-size: 13px; line-height: 1.6; min-height: 0; margin-top: 8px; overflow-wrap: anywhere; }
html.dark .site-dialog-error, html.dark .modal .category-name-error { color: #ffa49c; }
.site-dialog-error:empty, .modal .category-name-error:empty { display: none; }
.site-dialog .modal-actions .btn-danger { border-color: transparent; background: #b8423d; color: #ffffff; }
.site-dialog .modal-actions .btn-danger:hover { background: #9e3530; color: #ffffff; }
html.dark .site-dialog .modal-actions .btn-danger { background: #b8423d; color: #ffffff; }
.modal[aria-busy="true"] { cursor: progress; }
@media (max-width: 520px) {
  .modal { width: calc(100vw - 32px); padding: 22px 20px; max-height: calc(100dvh - 32px); }
  .site-dialog-heading { margin-bottom: 20px; }
  .site-dialog-heading h3 { font-size: 19px; }
}
