/* Action controls: shared across records, toolbars, dialogs and drawers.
   Theme files own surfaces; this file owns button typography and interaction. */
:root{
  --action-font:-apple-system,BlinkMacSystemFont,"SF Pro Text","PingFang SC","Microsoft YaHei",sans-serif;
  --action-primary:var(--accent);
  --action-primary-hover:var(--accent-strong);
  --action-ink:color-mix(in srgb,var(--accent) 62%,var(--text));
  --action-surface:color-mix(in srgb,var(--accent) 5%,var(--panel));
  --action-border:color-mix(in srgb,var(--accent) 18%,var(--border));
}
html[data-color-theme="blue"]{
  --action-primary:#2469d8;
  --action-primary-hover:#1b58be;
}
html body :is(.btn,.back-parent){
  box-sizing:border-box;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  min-height:36px;
  height:auto;
  padding:7px 15px;
  border:1px solid var(--action-border);
  border-radius:8px;
  background:var(--action-surface);
  color:var(--action-ink);
  font-family:var(--action-font);
  font-size:14px;
  font-weight:500;
  line-height:20px;
  letter-spacing:0;
  text-decoration:none;
  text-shadow:none;
  white-space:nowrap;
  vertical-align:middle;
  box-shadow:0 1px 2px rgb(20 40 70 / 4%);
  backdrop-filter:none;
  -webkit-backdrop-filter:none;
  cursor:pointer;
  transform:none;
  transition:background-color .15s ease,border-color .15s ease,color .15s ease,box-shadow .15s ease;
}
html body :is(.btn,.back-parent):hover:not(:disabled):not([aria-disabled="true"]){
  background:color-mix(in srgb,var(--accent) 10%,var(--panel));
  border-color:color-mix(in srgb,var(--accent) 40%,var(--border));
  color:var(--action-ink);
  transform:none;
}
/* Return/cancel buttons carry less weight than secondary feature actions. */
html body :is(.btn.neutral,.back-parent,.btn[id$="Back"],.btn[id$="Cancel"],.btn[id*="Reset"],.btn[data-change-back],.btn[data-profile-close],.btn[data-review-close]){
  background:var(--panel);
  color:var(--text-2);
  border-color:var(--border);
  box-shadow:none;
}
html body .btn.primary{
  background:var(--action-primary);
  border-color:var(--action-primary);
  color:#fff;
  font-weight:550;
  box-shadow:0 2px 4px rgb(25 73 150 / 12%);
}
html body .btn.primary:hover:not(:disabled):not([aria-disabled="true"]){
  background:var(--action-primary-hover);
  border-color:var(--action-primary-hover);
  color:#fff;
  box-shadow:0 2px 5px rgb(25 73 150 / 15%);
}
html body .btn.danger{
  background:color-mix(in srgb,var(--danger) 5%,var(--panel));
  border-color:color-mix(in srgb,var(--danger) 22%,var(--border));
  color:var(--danger);
  box-shadow:none;
}
html body .btn.danger:hover:not(:disabled):not([aria-disabled="true"]){
  background:var(--danger-soft);
  border-color:var(--danger);
  color:var(--danger);
}
html body :is(.btn,.back-parent):active:not(:disabled):not([aria-disabled="true"]){ transform:none; box-shadow:inset 0 1px 3px rgb(20 40 70 / 14%); }
html body :is(.btn,.back-parent):focus-visible{ outline:2px solid var(--action-primary); outline-offset:3px; }
/* Esc 关闭弹层后浏览器把焦点还给触发按钮，键盘模态会误画描边；JS 打标 suppress 到下次 blur。 */
html body :is(button,.btn,.back-parent,a,input,select,textarea,summary,[tabindex])[data-focus-restored]:focus-visible{ outline:none !important; }
html body :is(.btn,.back-parent):is(:disabled,[aria-disabled="true"]){
  color:var(--text-3); background:var(--hover); border-color:var(--border);
  box-shadow:none; cursor:not-allowed; opacity:.65; transform:none;
}
html body .btn[aria-busy="true"]{ cursor:progress; }
html body :is(.btn,.back-parent)[hidden]{ display:none; }
/* Dense row operations, pagination, and map tools share a smaller scale. */
html body :is(td,.delivery-row-actions,.data-pagination,.bq-pagination,.geo-map-head,.evidence-actions,.role-sidebar-tools,.brand-logo-editor-actions,.brand-logo-crop-transforms) .btn, html body .btn.compact, html body .back-parent{
  min-height:30px; height:30px; padding:4px 10px; font-size:12px; line-height:20px;
}
html body :is(.store-row-actions,.mall-brand-store-actions,.delivery-row-actions,.settings-user-actions) .link{
  font-family:var(--action-font); font-size:12px; font-weight:500; line-height:20px;
  color:var(--action-ink); padding:4px 7px; border-radius:8px; text-shadow:none;
}
html body :is(.store-row-actions,.mall-brand-store-actions,.delivery-row-actions,.settings-user-actions) .link.danger{ color:var(--danger); }
html body :is(.record-page-actions,.store-record-actions,.bq-hero-actions,.brand-store-actions,.mall-brand-form-actions){ gap:8px; align-items:center; }
/* Keep crop mode buttons a segmented selector rather than an action toolbar. */
html body .brand-logo-crop-modes .btn{ min-height:30px; padding:4px 10px; font-size:12px; background:transparent; border-color:transparent; box-shadow:none; }
html body .brand-logo-crop-modes .btn.active{ color:var(--action-ink); background:var(--panel); border-color:var(--border); }
@media (prefers-reduced-motion:reduce) { html body :is(.btn,.back-parent){ transition:none; } }

html body .data-page-btn{ font-family:var(--action-font); font-size:12px; font-weight:500; border-radius:8px; }
html body .data-page-btn.active{ background:var(--action-primary); border-color:var(--action-primary); color:#fff; box-shadow:0 1px 3px rgb(25 73 150 / 10%); }
html body .brand-action{ font-family:var(--action-font); font-size:12px; color:var(--action-ink); }
html body .brand-action-delete{ color:var(--danger); }
