/* 浮动工具栏样式 */
div#floating-toolbar.floating-toolbar {
  position: fixed !important;
  z-index: 1000 !important;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 6px;
  display: none;
  flex-direction: column;
  align-items: center;
  touch-action: none;
  user-select: none;
}

div#floating-toolbar.floating-toolbar.visible {
  display: flex !important;
  flex-direction: column;
  align-items: center;
}

/* 折叠状态 - 只显示一个图标 */
div#floating-toolbar.floating-toolbar.collapsed {
  padding: 4px;
  border-radius: 8px;
}

div#floating-toolbar .toolbar-collapsed {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  width: 48px;
  height: 48px;
}

div#floating-toolbar .toolbar-collapsed img.collapsed-icon {
  width: 40px;
  height: 40px;
  max-width: 40px;
  max-height: 40px;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

/* 展开状态 - 显示功能按钮列表 */
div#floating-toolbar.floating-toolbar.expanded {
  padding: 8px;
  border-radius: 12px;
}

div#floating-toolbar .toolbar-expanded {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: stretch;
}

div#floating-toolbar .toolbar-icons-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: stretch;
}

div#floating-toolbar .toolbar-divider {
  height: 1px;
  background: rgba(0, 0, 0, 0.1);
  margin: 6px 0;
}

/* 功能按钮 */
div#floating-toolbar button.toolbar-icon,
div#floating-toolbar .toolbar-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  max-width: 48px;
  max-height: 48px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  box-sizing: border-box;
}

div#floating-toolbar .toolbar-icon img {
  width: 28px;
  height: 28px;
  max-width: 28px;
  max-height: 28px;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

div#floating-toolbar .toolbar-icon:hover {
  background: rgba(59, 130, 246, 0.1);
}

div#floating-toolbar .toolbar-icon.collapse-btn {
  background: rgba(239, 68, 68, 0.06);
}

div#floating-toolbar .toolbar-icon.collapse-btn:hover {
  background: rgba(239, 68, 68, 0.12);
}

/* 拖拽状态 */
div#floating-toolbar.floating-toolbar.dragging {
  cursor: grabbing !important;
  opacity: 0.8;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
}

/* 工具提示 */
div#floating-toolbar .toolbar-icon:hover::after {
  content: attr(title);
  position: fixed;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-right: 10px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 1001;
  pointer-events: none;
}

/* 响应式 - 较小屏幕 */
@media (max-width: 1024px) {
  div#floating-toolbar .toolbar-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }
  div#floating-toolbar .toolbar-icon img {
    width: 26px;
    height: 26px;
    max-width: 26px;
    max-height: 26px;
  }
  div#floating-toolbar .toolbar-collapsed {
    width: 46px;
    height: 46px;
  }
  div#floating-toolbar .toolbar-collapsed img.collapsed-icon {
    width: 38px;
    height: 38px;
    max-width: 38px;
    max-height: 38px;
  }
}

@media (max-width: 640px) {
  div#floating-toolbar .toolbar-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }
  div#floating-toolbar .toolbar-icon img {
    width: 24px;
    height: 24px;
    max-width: 24px;
    max-height: 24px;
  }
  div#floating-toolbar .toolbar-collapsed {
    width: 44px;
    height: 44px;
  }
  div#floating-toolbar .toolbar-collapsed img.collapsed-icon {
    width: 36px;
    height: 36px;
    max-width: 36px;
    max-height: 36px;
  }
}

/* 打印时隐藏 */
@media print {
  div#floating-toolbar {
    display: none !important;
  }
}
