/* 编辑工具栏样式 */
#editToolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #65B521 0%, #4c8c1e 100%);
  color: white;
  z-index: 9999;
  padding: 8px 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

.edit-toolbar-content {
  width: 1190px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toolbar-title {
  font-size: 14px;
  font-weight: bold;
}

.toolbar-buttons {
  display: flex;
  gap: 8px;
  align-items: center;
}

.toolbar-btn {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #4c8c1e;
  color: #4c8c1e;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.3s;
}

.toolbar-btn:hover {
  background: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.toolbar-btn .icon {
  font-size: 12px;
}

.toolbar-divider {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.3);
  margin: 0 4px;
}

/* 编辑模式下的可编辑区域样式 */
.edit-mode .category-section,
.edit-mode .hot-row,
.edit-mode .sort-row {
  position: relative;
}

/* 左侧分类区域编辑样式 */
.edit-mode .category-section {
  border: 2px dashed #68B922;
  margin-bottom: 13px;
  padding: 3px;
  border-radius: 5px;
}

.edit-mode .category-header {
  position: relative;
  padding-right: 60px;
}

.edit-mode .category-header .drag-handle {
  position: absolute;
  left: -50px;
  top: 50%;
  transform: translateY(-50%);
  color: #68B922;
  font-size: 16px;
  cursor: move;
  padding: 5px;
}

.edit-mode .category-header .edit-icons {
  position: absolute;
  right: 0;
  top: 0;
  display: flex;
  gap: 5px;
  height: 30px;
  align-items: center;
}

.edit-icon, .delete-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.edit-icon {
  background: #68B922;
  color: white;
}

.delete-icon {
  background: #FC6060;
  color: white;
}

.edit-icon:hover, .delete-icon:hover {
  transform: scale(1.1);
}

/* 链接项编辑样式 */
.edit-mode .link-item,
.edit-mode .hot-item,
.edit-mode .sort-links-links {
  position: relative;
}

.edit-mode .link-item {
  padding-right: 40px;
}

.edit-mode .link-item .link-delete,
.edit-mode .link-item .link-edit,
.edit-mode .hot-item .link-delete,
.edit-mode .hot-item .link-edit,
.edit-mode .sort-links-links .link-delete,
.edit-mode .sort-links-links .link-edit {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.edit-mode .link-item .link-delete,
.edit-mode .hot-item .link-delete,
.edit-mode .sort-links-links .link-delete {
  background: #FC6060;
  color: white;
  right: 20px;
}

.edit-mode .link-item .link-edit,
.edit-mode .hot-item .link-edit,
.edit-mode .sort-links-links .link-edit {
  background: #68B922;
  color: white;
  right: 0;
}

.edit-mode .link-item:hover .link-delete,
.edit-mode .link-item:hover .link-edit,
.edit-mode .hot-item:hover .link-delete,
.edit-mode .hot-item:hover .link-edit,
.edit-mode .sort-links-links:hover .link-delete,
.edit-mode .sort-links-links:hover .link-edit {
  opacity: 1;
}

/* 添加按钮样式 */
.add-link-btn, .add-hot-btn, .add-sort-btn {
  width: 26px;
  height: 26px;
  background: #68B922;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 5px auto;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s;
}

.add-link-btn:hover, .add-hot-btn:hover, .add-sort-btn:hover {
  background: #599D20;
  transform: scale(1.1);
}

/* 热门网站编辑样式 */
.edit-mode .hot-row {
  border: 2px dashed #68B922;
  padding: 6px;
  border-radius: 5px;
}

.edit-mode .hot-item {
  position: relative;
  padding-right: 40px;
}

/* 分类内容编辑样式 */
.edit-mode .sort-row {
  border: 2px dashed #68B922;
  margin: 0;
  padding: 0;
  border-radius: 5px;
  position: relative;
}

.edit-mode .sort-row .drag-handle {
  position: absolute;
  left: -25px;
  top: 15px;
  color: #68B922;
  font-size: 16px;
  cursor: move;
  padding: 5px;
}

.edit-mode .sort-header {
  position: relative;
  padding-right: 60px;
}

.edit-mode .sort-header .edit-icons {
  position: absolute;
  right: 0;
  top: 0;
  display: flex;
  gap: 5px;
  height: 30px;
  align-items: center;
}

.edit-mode .sort-links-links {
  position: relative;
  padding-right: 40px;
  margin: 2px 20px 2px 0;
}

/* 模态框样式 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: white;
  border-radius: 8px;
  width: 400px;
  max-width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  padding: 15px 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f9f9f9;
  border-radius: 8px 8px 0 0;
}

.modal-header h3 {
  margin: 0;
  color: #333;
  font-size: 16px;
  font-weight: bold;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
  line-height: 1;
  padding: 0;
  width: 24px;
  height: 24px;
  transition: color 0.2s;
}

.modal-close:hover {
  color: #333;
}

.modal-body {
  padding: 20px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  color: #666;
  font-size: 14px;
  font-weight: 500;
}

.form-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
  transition: all 0.2s;
}

.form-input:focus {
  outline: none;
  border-color: #6dba2b;
  box-shadow: 0 0 0 3px rgba(109, 186, 43, 0.1);
}

.form-hint {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

.modal-footer {
  padding: 15px 20px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f9f9f9;
  border-radius: 0 0 8px 8px;
}

.modal-actions {
  display: flex;
  gap: 10px;
}

.modal-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  min-width: 70px;
}

.cancel-btn {
  background: #f5f5f5;
  color: #666;
  border: 1px solid #ddd;
}

.cancel-btn:hover {
  background: #e8e8e8;
}

.save-btn {
  background: #6dba2b;
  color: white;
  border: 1px solid #5da024;
}

.save-btn:hover {
  background: #5da024;
}

.delete-btn {
  background: #ff4444;
  color: white;
  border: 1px solid #dd2222;
}

.delete-btn:hover {
  background: #dd2222;
}

/* 拖拽样式 */
.dragging {
  opacity: 0.5;
  background: #f0f9eb !important;
}

.drag-over {
  border: 2px dashed #6dba2b !important;
  background: #f0f9eb !important;
}

/* 提示信息 */
.edit-hint {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #68B922;
  color: white;
  padding: 10px 15px;
  border-radius: 4px;
  font-size: 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  z-index: 9998;
  animation: fadeInOut 3s ease;
  max-width: 300px;
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translateY(10px); }
  10% { opacity: 1; transform: translateY(0); }
  90% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-10px); }
}

/* 拖拽手柄样式 */
.drag-handle {
  cursor: move;
  color: #6dba2b;
  user-select: none;
}

.drag-handle:hover {
  color: #5da024;
}

/* 链接编辑按钮容器 */
.edit-mode .link-item {
  position: relative;
}

.edit-mode .sort-links-links {
  display: inline-block;
  position: relative;
  vertical-align: middle;
}

/* draggable-sort 样式 */
.draggable-sort {
    display: block;
    width: 100%;
}

.draggable-categories {
    display: block;
    width: 100%;
}

/* 添加分类工具栏按钮样式 - 只在编辑模式下显示 */
.addclasstoolbar-btn {
  display: none; /* 默认隐藏 */
  text-align: center;
  margin: 10px 0;
}

/* 编辑模式下显示添加分类按钮 */
#container.edit-mode .addclasstoolbar-btn {
  display: block; /* 编辑模式下显示 */
}