/* Shared action buttons. Tabs and selection controls retain their active state. */
:root {
    --action-button-bg: #f5f6df;
    --action-button-text: #30312b;
    --action-button-hover: #fffef1;
    --action-button-pressed: #e7e8cf;
    --action-button-disabled: #d0d0c4;
    --action-button-disabled-text: #68695f;
}

body[data-button-theme="solid"] :is(button, a.btn, a.btn-primary, a.btn-secondary, a.get-token-btn-floating):not(
    [role="tab"], .recharge-mode, .credit-auth-tab, .method-tab, .tab-btn,
    .filter-option, .auth-tabs *, .secondary-navigation *, .pagination *
) {
    /* Legacy inline colour overrides must not create a second button theme. */
    background-color: var(--action-button-bg) !important;
    background-image: none !important;
    border-color: var(--action-button-bg) !important;
    color: var(--action-button-text) !important;
    border-radius: 999px !important;
    font-weight: 500;
    box-shadow: none !important;
    opacity: 1 !important;
    text-decoration: none;
    transition: background-color .15s, border-color .15s, outline-color .15s;
}

body[data-button-theme="solid"] :is(button, a.btn, a.btn-primary, a.btn-secondary, a.get-token-btn-floating):not(
    [role="tab"], .recharge-mode, .credit-auth-tab, .method-tab, .tab-btn,
    .filter-option, .auth-tabs *, .secondary-navigation *, .pagination *
):hover:not(:disabled):not([aria-disabled="true"]) {
    background-color: var(--action-button-hover) !important;
    border-color: var(--action-button-hover) !important;
    color: var(--action-button-text) !important;
    transform: none;
}

body[data-button-theme="solid"] :is(button, a.btn, a.btn-primary, a.btn-secondary, a.get-token-btn-floating):not(
    [role="tab"], .recharge-mode, .credit-auth-tab, .method-tab, .tab-btn,
    .filter-option, .auth-tabs *, .secondary-navigation *, .pagination *
):active:not(:disabled):not([aria-disabled="true"]) {
    background-color: var(--action-button-pressed) !important;
    border-color: var(--action-button-pressed) !important;
}

/* btn-delete is also used by legacy edit/close controls. Only actual destructive
   actions get this solid warning colour; they retain the same capsule shape. */
body[data-button-theme="solid"] :is(.btn-danger, .btn-delete[title*="删除"], .btn-delete[onclick*="delete"],
    .btn-delete[onclick*="Delete"], .btn-delete[onclick*="clearUnbound"]):not(:disabled):not([aria-disabled="true"]) {
    --action-button-bg: #f8dcd6;
    --action-button-hover: #ffe9e4;
    --action-button-pressed: #edc6bf;
    --action-button-text: #74372e;
}

body[data-button-theme="solid"] :is(button, a.btn, a.btn-primary, a.btn-secondary, a.get-token-btn-floating):not(
    [role="tab"], .recharge-mode, .credit-auth-tab, .method-tab, .tab-btn,
    .filter-option, .auth-tabs *, .secondary-navigation *, .pagination *
):is(:disabled, [aria-disabled="true"]) {
    background-color: var(--action-button-disabled) !important;
    border-color: var(--action-button-disabled) !important;
    color: var(--action-button-disabled-text) !important;
    box-shadow: none !important;
    opacity: 1 !important;
    cursor: not-allowed;
}

body[data-button-theme="solid"] :is(button, a.btn, a.btn-primary, a.btn-secondary, a.get-token-btn-floating):focus-visible {
    outline: 2px solid #f5f6df;
    outline-offset: 4px;
}

body[data-button-theme="solid"] :is(button, a.btn, a.btn-primary, a.btn-secondary) :is(.btn-text, svg, i) {
    color: inherit;
}

body[data-button-theme="solid"] button .loader {
    border-color: #30312b33;
    border-top-color: currentColor;
}

@media (prefers-reduced-motion: reduce) {
    body[data-button-theme="solid"] :is(button, a.btn, a.btn-primary, a.btn-secondary) { transition: none; }
}
