/* 后台管理区块（由原 admin.html 内联样式迁入） */
.admin-container {
  display: none;
}

.admin-container.visible {
  display: block;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 15px 20px;
  background: rgba(255, 255, 255, var(--site-glass-opacity, 0.92));
  border-radius: var(--border-radius, 10px);
  box-shadow: var(--box-shadow, 0 2px 10px rgba(0, 0, 0, 0.08));
}

.logout-btn {
  background: #dc2626;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}

.logout-btn:hover {
  background: #b91c1c;
}

.exit-btn {
  background: #64748b;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}

.exit-btn:hover {
  background: #475569;
}

.admin-sites-board {
  background: rgba(255, 255, 255, var(--site-glass-opacity, 0.92));
  border-radius: var(--border-radius, 10px);
  padding: 20px;
  box-shadow: var(--box-shadow, 0 2px 10px rgba(0, 0, 0, 0.08));
  overflow-x: auto;
}

.admin-preview-categories {
  margin-top: 4px;
}

.admin-preview-categories .category-title {
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-preview-categories .category-title .category-title-label {
  min-width: 0;
  flex: 1;
}

.admin-category-quick-add {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(var(--primary-rgb, 234, 88, 12), 0.35);
  background: #fff;
  color: var(--primary-color, #ea580c);
  font-size: 1.25rem;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.admin-category-quick-add:hover {
  background: var(--primary-color, #ea580c);
  color: #fff;
  border-color: var(--primary-color, #ea580c);
}

.admin-category-quick-add:focus-visible {
  outline: 2px solid var(--primary-color, #ea580c);
  outline-offset: 2px;
}

/* 后台卡片：与首页同款 site-card，禁用整卡跳转，底部为操作条 */
.admin-site-card {
  cursor: default;
  text-decoration: none;
  color: inherit;
  min-height: 158px;
}

.admin-site-card:hover {
  border-color: rgba(var(--primary-rgb), 0.25);
}

.admin-site-card-toolbar {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding-top: 8px;
}

.admin-site-card .admin-card-btn {
  padding: 5px 10px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 600;
}

.admin-site-card .admin-card-btn.edit {
  background: var(--primary-color, #ea580c);
  color: white;
}

.admin-site-card .admin-card-btn.edit:hover {
  background: var(--secondary-color, #c2410c);
}

.admin-site-card .admin-card-btn.delete {
  background: #ef4444;
  color: white;
}

.admin-site-card .admin-card-btn.delete:hover {
  background: #dc2626;
}

.admin-site-card .admin-card-open {
  font-size: 0.72rem;
  font-weight: 600;
  color: #475569;
  text-decoration: none;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(241, 245, 249, 0.9);
}

.admin-site-card .admin-card-open:hover {
  color: var(--primary-color, #ea580c);
  background: #ffedd5;
}

.action-btns {
  display: flex;
  gap: 8px;
}

.btn-edit,
.btn-delete {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
}

.btn-edit {
  background: var(--primary-color, #ea580c);
  color: white;
}

.btn-edit:hover {
  background: var(--secondary-color, #c2410c);
}

.btn-delete {
  background: #ef4444;
  color: white;
}

.btn-delete:hover {
  background: #dc2626;
}

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.modal-overlay.active {
  display: flex;
}

.tag-display {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag-display .tag {
  background: #ffedd5;
  color: var(--secondary-color, #c2410c);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
}

.categories-panel {
  background: rgba(255, 255, 255, var(--site-glass-opacity, 0.92));
  border-radius: var(--border-radius, 10px);
  padding: 16px 20px;
  box-shadow: var(--box-shadow, 0 2px 10px rgba(0, 0, 0, 0.08));
  margin-bottom: 16px;
}

.categories-panel .panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.category-add {
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-add input {
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.9rem;
  min-width: 160px;
}

.category-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff7ed;
  border: 1px solid rgba(var(--primary-rgb), 0.2);
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.85rem;
}

.category-item .category-actions button {
  border: none;
  background: transparent;
  color: #475569;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0 2px;
}

.category-item .category-actions button:hover {
  color: var(--primary-color, #ea580c);
}

.sites-table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 15px;
}

.sites-table-header h2 {
  margin: 0;
}

.sites-filter {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sites-filter label {
  font-size: 0.9rem;
  color: #64748b;
}

#site-category-filter {
  padding: 6px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.9rem;
  min-width: 160px;
  background: white;
  cursor: pointer;
}

#site-category-filter:focus {
  outline: none;
  border-color: var(--primary-color, #ea580c);
}
