/* =========================================
   全局鼠标指针修复 - 确保所有可点击元素显示小手图标
   ========================================= */

/* 默认光标 - 所有元素默认使用 default */
* {
  cursor: default;
}

/* 普通文本 - 悬停保持箭头（不显示 I-beam） */
p,
span,
div,
h1,
h2,
h3,
h4,
h5,
h6,
li,
td,
th,
label {
  cursor: default !important;
}

/* 输入/可编辑区域 - 使用 text 光标 */
textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="number"],
[contenteditable]:not([contenteditable="false"]) {
  cursor: text !important;
}

/* 按钮元素 - 小手图标 */
button,
.btn,
.button,
[role="button"],
input[type="button"],
input[type="submit"],
input[type="reset"] {
  cursor: pointer !important;
}

/* 直接绑定 onclick 的元素 - 小手图标 */
[onclick],
[onclick] * {
  cursor: pointer !important;
}

/* 按钮内的所有元素也显示小手 */
button *,
.btn *,
.button *,
[role="button"] *,
a * {
  cursor: pointer !important;
}

/* 链接和导航 */
a,
.link,
.tab-link,
.nav-link,
.menu-item,
.dropdown-item,
.nav-item,
.image-card,
.cursor-pointer,
.model-item,
.provider-item,
.size-item,
.history-item,
.chip,
.captcha-image {
  cursor: pointer !important;
}

/* 链接和导航内的所有元素也显示小手 */
.tab-link *,
.nav-link *,
.menu-item *,
.dropdown-item *,
.nav-item *,
.image-card *,
.cursor-pointer * {
  cursor: pointer !important;
}

.model-item *,
.provider-item *,
.size-item *,
.history-item *,
.chip * {
  cursor: pointer !important;
}

/* 图标按钮 */
.icon-btn,
.icon-button,
.icon-square-btn,
.icon-btn-ghost,
.icon-btn-square {
  cursor: pointer !important;
}

/* 图标按钮内的所有元素也显示小手 */
.icon-btn *,
.icon-button *,
.icon-square-btn *,
.icon-btn-ghost *,
.icon-btn-square * {
  cursor: pointer !important;
}

/* 菜单相关 */
.menu,
.dropdown,
.dropdown-menu,
.dropdown-toggle,
.menu-button,
.context-menu,
.popup-menu {
  cursor: pointer !important;
}

/* 卡片和列表项 */
.card[onclick],
.list-item[onclick],
.tree-item,
.tree-item-label,
[data-clickable="true"] {
  cursor: pointer !important;
}

/* 可点击卡片和列表项内的所有元素也显示小手 */
.card[onclick] *,
.list-item[onclick] *,
.tree-item *,
[data-clickable="true"] * {
  cursor: pointer !important;
}

/* 开关和切换 */
.toggle,
.switch,
.checkbox-label,
.radio-label,
.toggle-switch,
.toggle-button {
  cursor: pointer !important;
}

/* 特定组件 */
.agent-menu-item,
.settings-menu-item,
.tool-card,
.category-btn,
.version-toggle-btn,
.version-option,
.role-toggle-btn,
.role-option,
.session-action-btn,
.auth-button,
.username-clickable,
.username-dropdown-item,
.current-agent-name-display,
.api-platform-name,
.api-platform-item,
.status-indicator,
.model-tag,
.note-tag-remove,
.tag-add-btn {
  cursor: pointer !important;
}

/* 特定组件内的所有元素也显示小手 */
.agent-menu-item *,
.settings-menu-item *,
.tool-card *,
.category-btn *,
.version-toggle-btn *,
.version-option *,
.role-toggle-btn *,
.role-option *,
.session-action-btn *,
.auth-button *,
.username-dropdown-item *,
.current-agent-name-display *,
.api-platform-item * {
  cursor: pointer !important;
}

/* 关闭按钮 */
.close,
.close-btn,
.modal-close,
.notification-close-btn,
.profile-modal-close,
[aria-label*="close"],
[aria-label*="关闭"] {
  cursor: pointer !important;
}

/* 可拖拽元素 */
[draggable="true"] {
  cursor: grab !important;
}

[draggable="true"]:active {
  cursor: grabbing !important;
}

/* 选择器和下拉框 */
select,
.select,
.selector,
.quick-selector {
  cursor: pointer !important;
}

/* 标签页 */
.tab,
.tab-item,
.tab-button {
  cursor: pointer !important;
}

/* 工具栏按钮 */
.toolbar-btn,
.action-btn,
.control-btn {
  cursor: pointer !important;
}

/* 删除和危险操作按钮 */
.delete-btn,
.remove-btn,
.danger-button,
.warning-button {
  cursor: pointer !important;
}

/* 主要和次要按钮 */
.primary-button,
.secondary-button {
  cursor: pointer !important;
}

/* 所有button标签 */
button {
  cursor: pointer !important;
}

/* 主要和次要按钮内的所有元素也显示小手 */
.primary-button *,
.secondary-button * {
  cursor: pointer !important;
}

/* 文件上传 */
.file-upload-btn,
.upload-button,
label[for] {
  cursor: pointer !important;
}

/* 展开/折叠 */
.expand-btn,
.collapse-btn,
.accordion-header {
  cursor: pointer !important;
}

/* 分页 */
.pagination-btn,
.page-btn,
.notice-page-btn {
  cursor: pointer !important;
}

/* 过滤和排序 */
.filter-btn,
.sort-btn {
  cursor: pointer !important;
}

/* 编辑器工具栏 */
.editor-btn,
.format-btn,
.toolbar-icon {
  cursor: pointer !important;
}

/* 对话框按钮 */
.dialog-btn,
.modal-btn,
.confirm-btn,
.cancel-btn {
  cursor: pointer !important;
}

/* 搜索和输入相关 */
.search-btn,
.clear-btn,
.submit-btn {
  cursor: pointer !important;
}

/* 用户头像和个人资料 */
.avatar,
.user-avatar,
.profile-pic {
  cursor: pointer !important;
}

/* 通知和提示 */
.notification,
.toast,
.alert[onclick] {
  cursor: pointer !important;
}

/* 标签和徽章 */
.tag,
.badge,
.chip {
  cursor: pointer !important;
}

/* 树形结构 */
.tree-node,
.tree-toggle {
  cursor: pointer !important;
}

/* 表格行 */
tr[onclick],
td[onclick],
.table-row[onclick] {
  cursor: pointer !important;
}

/* 面板标题 */
.panel-header[onclick],
.section-header[onclick] {
  cursor: pointer !important;
}

/* 滑块和范围输入 */
input[type="range"] {
  cursor: pointer !important;
}

/* 颜色选择器 */
input[type="color"] {
  cursor: pointer !important;
}

/* 复选框和单选按钮 */
input[type="checkbox"],
input[type="radio"] {
  cursor: pointer !important;
}

/* SVG图标 */
svg[onclick],
.icon[onclick] {
  cursor: pointer !important;
}

/* 禁用状态 - 禁止图标 */
button:disabled,
.btn:disabled,
[disabled],
.disabled,
.permission-locked,
[data-locked],
.locked {
  cursor: not-allowed !important;
  pointer-events: auto !important;
}

/* 加载状态 - 等待图标 */
.loading,
[aria-busy="true"],
.processing {
  cursor: wait !important;
}

/* 拖拽状态 */
.dragging {
  cursor: grabbing !important;
}

/* 调整大小 */
.resizable-handle,
.resize-handle {
  cursor: nwse-resize !important;
}

/* 移动 */
.movable,
.draggable-handle {
  cursor: move !important;
}

/* 帮助/问号 */
.help,
[title]:not(button):not(a):not([onclick]) {
  cursor: help !important;
}

/* 缩放 */
.zoomable,
.zoom-in {
  cursor: zoom-in !important;
}

.zoom-out {
  cursor: zoom-out !important;
}

/* 复制 */
.copyable {
  cursor: copy !important;
}

/* 不允许选择的文本 */
.no-select,
.unselectable {
  cursor: default !important;
  user-select: none;
}

/* 图片和媒体 - 默认光标，除非可点击 */
img:not([onclick]):not(.clickable),
video:not([onclick]):not(.clickable),
audio:not([onclick]):not(.clickable) {
  cursor: default !important;
}

/* 链接/按钮内的媒体元素也必须显示小手 */
a img,
a svg,
a i,
button img,
button svg,
button i,
[role="button"] img,
[role="button"] svg,
[role="button"] i,
[onclick] img,
[onclick] svg,
[onclick] i {
  cursor: pointer !important;
}

/* 可点击的图片和媒体 */
img[onclick],
img.clickable,
video[onclick],
video.clickable,
.image-card img,
.nav-item img,
.menu-item img,
.cursor-pointer img,
.captcha-image {
  cursor: pointer !important;
}
