body {
  font-family: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f3f4f6;
  color: #1f2937;
  min-height: 100vh;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.admin-header {
  background: white;
  padding: 1.5rem 2rem;
  border-radius: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 768px) {
  .admin-header {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

h1 {
  font-size: 1.875rem;
  font-weight: 700;
  color: #111827;
  margin: 0;
  letter-spacing: -0.025em;
}

.admin-subtitle {
  margin-top: 0.5rem;
  color: #6b7280;
  font-size: 0.875rem;
}

.logout-btn {
  background-color: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.logout-btn:hover {
  background-color: #e5e7eb;
  border-color: #9ca3af;
  color: #111827;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.refresh-btn {
  background-color: #ea580c;
  color: #ffffff;
  border: 1px solid #c2410c;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  font-size: 0.875rem;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  position: relative;
}

.refresh-btn:hover {
  background-color: #c2410c;
  color: #ffffff;
}

.refresh-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.tab-wrapper {
  margin-top: 2rem;
}

.tab-buttons {
  display: inline-flex;
  padding: 0.25rem;
  background-color: #e5e7eb;
  border-radius: 0.75rem;
  margin-bottom: 1.5rem;
  gap: 0.25rem;
}

.tab-button {
  background-color: transparent;
  border: none;
  padding: 0.5rem 1.25rem;
  border-radius: 0.5rem;
  cursor: pointer;
  color: #6b7280;
  font-weight: 500;
  font-size: 0.875rem;
  transition: all 0.2s;
}

.tab-button.active {
  background-color: white;
  color: #2563eb;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.tab-button:hover:not(.active) {
  color: #374151;
  background-color: rgba(255,255,255,0.5);
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.tab-content.active {
  display: block;
}

.import-export {
  background: white;
  padding: 1rem;
  border-radius: 1rem;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}

#searchInput {
  flex-grow: 1; /* 占据多余空间 */
  max-width: 300px; /* 设置一个最大宽度 */
  margin-right: auto; /* 将右侧的元素推开 */
}

#searchInput[contenteditable="true"] {
  overflow: hidden;
  white-space: nowrap;
}

#searchInput[contenteditable="true"][data-empty="true"]::before {
  content: attr(data-placeholder);
  color: #9ca3af;
  pointer-events: none;
}

/* [优化] 添加区域适配移动端 */
.add-new {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap; /* 核心：允许换行 */
}
.add-new > input {
  flex: 1 1 150px; /* 弹性布局，基础宽度150px，允许伸缩 */
  min-width: 150px; /* 最小宽度 */
}
.add-new > button {
  flex-basis: 100%; /* 在移动端，按钮占据一整行 */
}
input[type="text"] {
  padding: 10px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 1rem;
  outline: none;
  margin-bottom: 5px;
  transition: border-color 0.2s;
}
@media (min-width: 768px) {
  .add-new > button {
    flex-basis: auto; /* 在桌面端，按钮恢复自动宽度 */
  }
}
input[type="text"],
input[type="number"] {
  padding: 10px;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 1rem;
  outline: none;
  margin-bottom: 5px;
  transition: border-color 0.2s;
}
input[type="text"]:focus,
input[type="number"]:focus {
  border-color: #80bdff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}
button {
  background-color: #6c63ff; /* 主色调 */
  color: #fff;
  border: none;
  padding: 10px 15px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.3s;
}
button:hover {
  background-color: #534dc4;
}
/* [优化] 保证表格在小屏幕上可以横向滚动 */
.table-wrapper {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  table-layout: fixed; /* 新增：固定表格布局，使列宽不受内容影响 */
}
th,
td {
  border: 1px solid #dee2e6;
  padding: 10px;
  text-align: left;
  color: #495057; /* 表格文字颜色 */
  word-wrap: break-word; /* 强制长单词或URL换行 */
  overflow-wrap: break-word; /* word-wrap的现代标准名称 */
}
th {
  background-color: #f2f2f2;
  font-weight: 600;
}

/* 设置书签列表的列宽 */
#configTable th:nth-child(1) { width: 5%; } /* ID */
#configTable th:nth-child(2) { width: 15%; } /* Name */
#configTable th:nth-child(3) { width: 30%; } /* URL */
#configTable th:nth-child(4) { width: 5%; }  /* Logo */
#configTable th:nth-child(5) { width: 20%; } /* Description */
#configTable th:nth-child(6) { width: 10%; } /* Catelog */
#configTable th:nth-child(7) { width: 5%; }  /* 排序 */
#configTable th:nth-child(8) { width: 10%; } /* Actions */

/* 设置待审核列表的列宽 */
#pendingTable th:nth-child(1) { width: 5%; } /* ID */
#pendingTable th:nth-child(2) { width: 15%; } /* Name */
#pendingTable th:nth-child(3) { width: 35%; } /* URL */
#pendingTable th:nth-child(4) { width: 5%; }  /* Logo */
#pendingTable th:nth-child(5) { width: 20%; } /* Description */
#pendingTable th:nth-child(6) { width: 10%; } /* Catelog */
#pendingTable th:nth-child(7) { width: 10%; } /* Actions */
tr:nth-child(even) {
  background-color: #f9f9f9;
}
