/* Shared close controls for modal and floating-window chrome. */
/* 关闭只是退出当前表面；删除、清空和移除继续使用各自的危险语义。 */
.close-btn,
.catalog-close-btn,
.agent-management-close,
.sms-header .sms-close,
.chat-close,
.chat-secondary-close,
.browser-close,
#agent-workspace-close,
.hr-close,
.archive-icon-btn,
.bookshelf-bind-head button {
    width: 32px;
    min-width: 32px;
    height: 32px;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    margin-left: auto;
    padding: 0;
    border: 1px solid transparent;
    border-radius: var(--ui-radius-md);
    background: transparent;
    color: var(--ui-text-muted);
    box-shadow: none;
    cursor: pointer;
    font-family: var(--ui-font-family);
    font-size: 18px;
    font-weight: 400;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    touch-action: manipulation;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.close-btn:hover,
.catalog-close-btn:hover,
.agent-management-close:hover,
.sms-header .sms-close:hover,
.chat-close:hover,
.chat-secondary-close:hover,
.browser-close:hover,
#agent-workspace-close:hover,
.hr-close:hover,
.archive-icon-btn:hover,
.bookshelf-bind-head button:hover {
    border-color: var(--ui-border-strong);
    background: var(--ui-panel);
    color: var(--ui-text-primary);
    box-shadow: none;
}

.close-btn:focus-visible,
.catalog-close-btn:focus-visible,
.agent-management-close:focus-visible,
.sms-header .sms-close:focus-visible,
.chat-close:focus-visible,
.chat-secondary-close:focus-visible,
.browser-close:focus-visible,
#agent-workspace-close:focus-visible,
.hr-close:focus-visible,
.archive-icon-btn:focus-visible,
.bookshelf-bind-head button:focus-visible {
    outline: 2px solid var(--ui-info);
    outline-offset: 2px;
}

.close-btn:disabled,
.catalog-close-btn:disabled,
.agent-management-close:disabled,
.sms-header .sms-close:disabled,
.chat-close:disabled,
.chat-secondary-close:disabled,
.browser-close:disabled,
#agent-workspace-close:disabled,
.hr-close:disabled,
.archive-icon-btn:disabled,
.bookshelf-bind-head button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.modal-header .close-btn {
    align-self: center;
}

.agent-management-close {
    justify-self: end;
}

.browser-close {
    font-size: 15px;
}

@media (max-width: 560px) {
    .chat-close,
    .chat-secondary-close,
    .sms-header .sms-close,
    .browser-close,
    #agent-workspace-close {
        width: 28px !important;
        min-width: 28px !important;
        height: 28px !important;
        min-height: 28px !important;
        border-radius: 6px !important;
        font-size: 14px;
    }
}
