/* 图标颜色管理：默认#999，悬停时按功能显示不同颜色 */

/* [新增] 图标默认颜色设置为#999 */
.icon-16,
.book-title-icon,
img.icon-16,
img.book-title-icon,
.search-icon,
.btn-tool img,
.btn-icon img,
.btn-icon-small img,
.tree-item img.icon-16 {
  filter: brightness(0) saturate(100%) invert(60%);
  opacity: 0.8;
  transition: filter 0.2s ease, opacity 0.2s ease;
}

/* 功能图标颜色定义 - 按功能分类 */
/* 刷新功能 - 蓝色 */
.btn-tool[id="btn-refresh-books"] img,
.btn-icon-small[id="btn-refresh-models"] img,
.btn-icon-small[id="btn-refresh-models"] img {
  --icon-color: #4a90e2;
}

/* 导入功能 - 绿色 */
.btn-tool[id="btn-import-all"] img {
  --icon-color: #67c23a;
}

/* 导出功能 - 黄色 */
.btn-tool[id="btn-export-all"] img,
.btn-tool[onclick*="exportFile"] img {
  --icon-color: #f1c40f;
}

/* 删除功能 - 红色 */
.btn-tool.danger img,
.btn-tool[id="btn-delete-mode"] img,
.btn-delete-node img,
.btn-delete-book img {
  --icon-color: #e74c3c;
}

.btn-delete-node img {
  filter: brightness(0) invert(1) !important;
  opacity: 1 !important;
}

/* 搜索功能 - 紫色 */
.search-icon {
  --icon-color: #9b59b6;
}

/* 新增/添加功能 - 青色 */
.btn-tool[id="btn-add-chapter"] img,
.btn-icon-small[id="btn-add-chapter"] img,
.btn-primary[id="btn-create-book"] img {
  --icon-color: #1abc9c;
}

/* 保存功能 - 橙色 */
.btn-primary[id="btn-save"] img {
  --icon-color: #e67e22;
}

/* 返回功能 - 灰色 */
.btn-icon[id="btn-back-home"] img {
  --icon-color: #95a5a6;
}

/* 文件夹/路径功能 - 棕色 */
.btn-tool[onclick*="chooseExportPath"] img {
  --icon-color: #d35400;
}

/* AI/机器人功能 - 粉色 */
.btn-icon[id="btn-toggle-ai"] img {
  --icon-color: #e91e63;
}

/* 关闭功能 - 深灰色 */
.close-ai,
.btn-delete-node {
  --icon-color: #7f8c8d;
}

/* 悬停时显示功能颜色 */
.btn-tool:hover img,
.btn-icon:hover img,
.btn-icon-small:hover img,
.search-box:hover .search-icon {
  filter: brightness(0) saturate(100%);
  opacity: 1;
}

/* 为不同功能设置悬停颜色 */
.btn-tool[id="btn-refresh-books"]:hover img,
.btn-icon-small[id="btn-refresh-models"]:hover img {
  filter: brightness(0) saturate(100%) invert(47%) sepia(95%) saturate(2000%) hue-rotate(195deg) brightness(0.95);
}

.btn-tool[id="btn-import-all"]:hover img {
  filter: brightness(0) saturate(100%) invert(62%) sepia(95%) saturate(500%) hue-rotate(80deg) brightness(0.95);
}

.btn-tool[id="btn-export-all"]:hover img,
.btn-tool[onclick*="exportFile"]:hover img {
  filter: brightness(0) saturate(100%) invert(82%) sepia(95%) saturate(2000%) hue-rotate(5deg) brightness(1.1);
}

.btn-tool.danger:hover img,
.btn-tool[id="btn-delete-mode"]:hover img,
.btn-delete-node:hover img,
.btn-delete-book:hover img {
  filter: brightness(0) saturate(100%) invert(24%) sepia(95%) saturate(5000%) hue-rotate(340deg) brightness(0.95);
}

.search-box:hover .search-icon {
  filter: brightness(0) saturate(100%) invert(43%) sepia(95%) saturate(2000%) hue-rotate(250deg) brightness(0.95);
}

.btn-tool[id="btn-add-chapter"]:hover img,
.btn-icon-small[id="btn-add-chapter"]:hover img,
.btn-primary[id="btn-create-book"]:hover img {
  filter: brightness(0) saturate(100%) invert(71%) sepia(95%) saturate(500%) hue-rotate(140deg) brightness(0.95);
}

.btn-primary[id="btn-save"]:hover img {
  filter: brightness(0) saturate(100%) invert(51%) sepia(95%) saturate(2000%) hue-rotate(10deg) brightness(0.95);
}

.btn-icon[id="btn-back-home"]:hover img {
  filter: brightness(0) saturate(100%) invert(60%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(0.95);
}

.btn-tool[onclick*="chooseExportPath"]:hover img {
  filter: brightness(0) saturate(100%) invert(29%) sepia(95%) saturate(2000%) hue-rotate(5deg) brightness(0.95);
}

.btn-icon[id="btn-toggle-ai"]:hover img {
  filter: brightness(0) saturate(100%) invert(29%) sepia(95%) saturate(5000%) hue-rotate(310deg) brightness(0.95);
}

/* 激活状态显示颜色 */
.book-card:hover .icon-16,
.book-card:hover .book-title-icon,
.book-card:hover img.icon-16,
.book-card:hover img.book-title-icon,
.tree-item.active .icon-16,
.tree-item.active img.icon-16 {
  filter: brightness(0) saturate(100%) invert(60%);
  opacity: 1;
}

