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; /* 将右侧的元素推开 */
}

/* [优化] 添加区域适配移动端 */
.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;
}
.category-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 10px;
  flex-wrap: wrap;
}
.category-hint {
  margin: 0;
  font-size: 0.85rem;
  color: #6c757d;
}
#refreshCategories {
  background-color: #f8f9fa;
  color: #495057;
  border: 1px solid #ced4da;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.2s;
}
#refreshCategories:hover {
  background-color: #e9ecef;
}
.category-sort-input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #ced4da;
  border-radius: 4px;
}
.category-sort-input:focus {
  border-color: #80bdff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
  outline: none;
}
.category-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.category-actions button {
  padding: 5px 10px;
  font-size: 0.85rem;
}
.category-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.actions {
  display: flex;
  gap: 5px;
}
.actions button {
  padding: 5px 8px;
  font-size: 0.8rem;
}
.edit-btn {
  background-color: #17a2b8; /* 编辑按钮颜色 */
}

.del-btn {
  background-color: #dc3545; /* 删除按钮颜色 */
}
.pagination {
  text-align: center;
  margin-top: 20px;
}
.pagination button {
  margin: 0 5px;
  background-color: #e9ecef; /* 分页按钮颜色 */
  color: #495057;
  border: 1px solid #ced4da;
}
.pagination button:hover {
  background-color: #dee2e6;
}

.success {
  background-color: #28a745;
  color: #fff;
}
.error {
  background-color: #dc3545;
  color: #fff;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
}

.modal[style*="display: block"],
.modal[style*="display:block"] {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: #fff;
  margin: auto;
  padding: 2rem;
  width: 90%;
  max-width: 600px;
  border-radius: 1rem;
  position: relative;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  color: #9ca3af;
  position: absolute;
  right: 1.5rem;
  top: 1.5rem;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.modal-close:hover {
  background-color: #f3f4f6;
  color: #111827;
}

.modal-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #111827;
  margin-top: 0;
  margin-bottom: 1.5rem;
}

.form-group {
  display: flex;
  align-items: center;
  margin-bottom: 1.25rem;
}

.form-group label {
  width: 100px;
  flex-shrink: 0;
  text-align: right;
  margin-right: 1rem;
  margin-bottom: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
  flex: 1;
  width: auto;
  padding: 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  transition: all 0.2s;
  background-color: #fff;
  min-width: 0; /* Fix flex overflow */
}

/* Ensure custom dropdown wrapper also flexes correctly */
.form-group .custom-dropdown-wrapper {
  flex: 1;
}

/* Fix switch alignment in flex layout */
.form-group .switch {
  margin: 0 !important;
}

/* Make sure the switch label takes remaining space or behaves correctly */
.form-group .flex.items-center.justify-between {
  width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #3b82f6;
  ring: 2px solid #93c5fd;
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.modal-content button[type='submit'] {
  background-color: #007bff;
  color: #fff;
  border: none;
  padding: 10px 15px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.3s;
}

.modal-content button[type='submit']:hover {
  background-color: #0056b3;
}

.custom-select {
  /* 1. 去除浏览器默认样式（最关键的一步） */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;

  /* 2. 基础样式设置 */
  width: 100%;                /* 宽度填满容器 */
  padding: 10px 15px;         /* 内边距 */
  padding-right: 40px;        /* 右侧留出更多空间给箭头，防止文字覆盖 */
  font-size: 1rem;
  line-height: 1.5;
  color: #495057;
  background-color: #fff;
  border: 1px solid #ced4da;
  border-radius: 4px;
  
  /* 3. 自定义箭头图标 (使用 SVG Data URI) */
  /* 这是一个灰色的向下箭头 */
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center; /* 箭头位置：靠右 10px，垂直居中 */
  background-size: 16px 12px;             /* 箭头大小 */

  /* 4. 过渡动画 */
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  cursor: pointer;
}

/* 聚焦时的样式（与你之前的 input 保持一致） */
.custom-select:focus {
  border-color: #80bdff;
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* 禁用状态 */
.custom-select:disabled {
  background-color: #e9ecef;
  cursor: not-allowed;
}



/* AI 设置模态框样式 */
#aiSettingsBtn {
  background-color: #28a745; /* 绿色，表示 AI 或智能操作 */
}

#aiSettingsBtn:hover {
  background-color: #218838;
}

.modal-content .radio-group {
  display: flex;
  align-items: center;
  gap: 15px;
}

.modal-content .radio-group input[type="radio"] {
  width: auto;
  margin-bottom: 0;
}

.modal-content .radio-group label {
  margin-bottom: 0;
  font-weight: normal;
}

.batch-operations {
  margin-top: 20px;
  border-top: 1px solid #eee;
  padding-top: 20px;
}

.batch-operations h3 {
  margin-top: 0;
}

.batch-operations p {
  color: #6c757d;
  font-size: 0.9rem;
}

#batchCompleteDescBtn {
  width: 100%;
  margin-top: 10px;
  background-color: #007bff;
}

#batchCompleteDescBtn:hover {
  background-color: #0056b3;
}

/* =================================== */
/* 新版 AI 设置模态框样式 (Settings Modal) */
/* =================================== */

.settings-modal .modal-content-wrapper {
  background-color: #fff;
  margin: 5% auto;
  padding: 0;
  border: 1px solid #dee2e6;
  width: 90%;
  max-width: 550px;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
}

.settings-modal .modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.settings-modal .modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.settings-modal .modal-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: #6c757d;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}
.settings-modal .modal-close-btn:hover {
  color: #343a40;
}

.settings-modal .modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  space-y: 1.5rem;
}

.settings-modal .form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.settings-modal .provider-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.settings-modal .provider-btn {
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid #ced4da;
  background-color: #f8f9fa;
  color: #495057;
  transition: all 0.2s;
  font-weight: 500;
  cursor: pointer;
}

.settings-modal .provider-btn:hover {
  border-color: #adb5bd;
}

.settings-modal .provider-btn.active {
  border-color: #007bff;
  background-color: #e7f1ff;
  color: #0056b3;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}

.settings-modal .form-group-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

.settings-modal .form-label-icon {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  font-weight: 500;
  color: #495057;
  margin-bottom: 0.25rem;
}

.settings-modal .form-input {
  width: 100%;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid #ced4da;
  background-color: #fff;
  font-size: 1rem;
  transition: all 0.2s;
  box-sizing: border-box;
}

.settings-modal .form-input:focus {
  outline: none;
  border-color: #80bdff;
  box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

.settings-modal .form-hint {
  font-size: 0.75rem;
  color: #6c757d;
  margin-top: 0.25rem;
}

.settings-modal .batch-actions-section {
  margin-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

.settings-modal .section-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.settings-modal .bulk-action-box {
  background-color: #f8f9fa;
  padding: 1rem;
  border-radius: 8px;
}

.settings-modal .progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #495057;
  margin-bottom: 0.5rem;
}

.settings-modal .progress-bar-container {
  width: 100%;
  background-color: #e9ecef;
  border-radius: 99px;
  height: 0.75rem;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.settings-modal .progress-bar {
  background-color: #007bff;
  height: 100%;
  width: 0%;
  border-radius: 99px;
  transition: width 0.3s ease;
}

.settings-modal .modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid #e5e7eb;
  background-color: #f8f9fa;
  flex-shrink: 0;
}

.settings-modal .button-primary,
.settings-modal .button-secondary,
.settings-modal .button-tertiary,
.settings-modal .button-danger {
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.settings-modal .button-primary {
  background-color: #007bff;
  color: white;
}
.settings-modal .button-primary:hover {
  background-color: #0056b3;
}

.settings-modal .button-secondary {
  width: 100%;
  justify-content: center;
  background-color: #fff;
  color: #495057;
  border-color: #ced4da;
}
.settings-modal .button-secondary:hover {
  background-color: #f8f9fa;
  border-color: #007bff;
  color: #007bff;
}

.settings-modal .button-tertiary {
  background-color: #e9ecef;
  color: #495057;
}
.settings-modal .button-tertiary:hover {
  background-color: #dee2e6;
}

.settings-modal .button-danger {
  width: 100%;
  justify-content: center;
  background-color: #fbebee;
  color: #dc3545;
  border-color: #f5c6cb;
}
.settings-modal .button-danger:hover {
  background-color: #f8d7da;
}

/* AI 生成按钮 */
.ai-generate-btn {
  margin-left: 10px;
  padding: 8px 12px;
  background-color: #6f42c1; /* Purple to distinguish AI */
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
  flex-shrink: 0;
  width: 36px;
  height: 38px;
}

.ai-generate-btn:hover {
  background-color: #59359a;
}

.ai-generate-btn:disabled {
  background-color: #a58ac4;
  cursor: not-allowed;
}

/* AI Loading Spinner */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.ai-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s linear infinite;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Modal Messages */
.modal-message {
  padding: 10px 15px;
  margin-bottom: 20px;
  border-radius: 6px;
  font-size: 0.95rem;
  visibility: hidden;
}

.modal-message.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.modal-message.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.modal-message.info {
  background-color: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

/* Card Preview Variables & Base Styles */
:root {
  --card-padding: 1.25rem;
  --card-radius: 1rem;
  --frosted-glass-blur: 15px;
}

.site-card {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, box-shadow;
  border-radius: var(--card-radius);
  width: 100%;
  background: white;
  border: 1px solid #f3f4f6; /* Subtle border */
  position: relative;
  overflow: hidden;
}

.site-card-content {
  padding: var(--card-padding);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.preview-card-fixed {
  overflow: hidden;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.site-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.15);
  z-index: 10;
  border-color: #d1d5db;
}

/* 图标消失动画 - Removed strict hover effects for cleaner look, or keep subtle */
.site-icon {
  width: 2.5rem;
  height: 2.5rem;
  margin-right: 1rem;
  transition: all 0.3s ease;
}

.site-card:hover .site-icon {
  transform: scale(1.1);
}

/* 标题放大动画 */
.site-title {
  transform-origin: left center;
  transition: color 0.2s;
  font-weight: 600;
  font-size: 1rem;
  color: #111827;
}

.site-card:hover .site-title {
  color: #2563eb;
}

.line-clamp-2 {
  display: -webkit-box !important;
  -webkit-line-clamp: 2 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  word-break: break-word;
}

/* Settings Tabs */
.settings-tabs {
  display: flex;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 1.5rem;
  gap: 1rem;
}

.settings-tab-btn {
  padding: 0.5rem 1rem;
  border: none;
  background: none;
  font-size: 0.95rem;
  font-weight: 500;
  color: #6c757d;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.settings-tab-btn:hover {
  color: #343a40;
}

.settings-tab-btn.active {
  color: #007bff;
  border-bottom-color: #007bff;
}

.settings-tab-content {
  display: none;
}

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

/* Switch / Toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 48px !important; /* Force width to override form-group label styles */
  height: 24px;
  margin: 0 !important; /* Reset margin */
  min-width: 48px; /* Prevent shrinking */
}

.switch input { 
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  -webkit-transition: .4s;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  -webkit-transition: .4s;
  transition: .4s;
}

input:checked + .slider {
  background-color: #2196F3;
}

input:focus + .slider {
  box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
  -webkit-transform: translateX(24px);
  -ms-transform: translateX(24px);
  transform: translateX(24px);
}

/* Rounded sliders */
.slider.round {
  border-radius: 24px;
}

.slider.round:before {
  border-radius: 50%;
}

/* 毛玻璃效果 - Copied from style.css */
.frosted-glass-effect {
  background: rgba(255, 255, 255, 0.5) !important;
  backdrop-filter: blur(var(--frosted-glass-blur, 15px)) !important;
  -webkit-backdrop-filter: blur(var(--frosted-glass-blur, 15px)) !important;
  border: 1px solid rgba(255, 255, 255, 0.4) !important;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05) !important;
}

.frosted-glass-effect:hover {
  background: rgba(255, 255, 255, 0.7) !important;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15) !important;
  border: 1px solid rgba(255, 255, 255, 0.8) !important;
}

/* Fix: Ensure datalist arrow is visible and interactive */
input[list]::-webkit-calendar-picker-indicator {
  opacity: 1 !important;
  display: block !important;
  background-image: url('data:image/svg+xml;charset=utf-8,%3Csvg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23666" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"%3E%3Cpolyline points="6 9 12 15 18 9"%3E%3C/polyline%3E%3C/svg%3E');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 16px;
  width: 24px;
  height: 24px;
  cursor: pointer;
  margin-left: -10px; /* Pull it slightly left if needed, or stick to right */
  transition: all 0.2s;
}

input[list]:hover::-webkit-calendar-picker-indicator {
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 50%;
}

/* ========================================= */
/* 风格二 (Style 2): 垂直布局 - Copied from style.css */
/* ========================================= */
.site-card.style-2 .flex.items-start {
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.site-card.style-2 .site-icon {
    margin-right: 0;
    margin-bottom: 0.5rem;
    width: 3rem; 
    height: 3rem;
    transition: transform 0.3s ease;
}

.site-card.style-2:hover .site-icon {
    transform: scale(1.1);
}

.site-card.style-2 .site-icon img,
.site-card.style-2 .site-icon div {
    margin: 0 auto;
}

.site-card.style-2 .site-title {
    text-align: center;
    margin-bottom: 0.25rem;
    display: block;
    width: 100%;
}

.site-card.style-2 .flex-1 {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.site-card.style-2 .preview-category {
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
}

.site-card.style-2 p {
    text-align: center;
    margin-top: 0.5rem;
}

.site-card.style-2 .preview-links {
    margin-top: 0.75rem;
    justify-content: space-between; 
    padding-top: 0.5rem;
    border-top: 1px solid rgba(0,0,0,0.05);
}

/* Toast Message (Right Top) */
#message {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  min-width: 300px;
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-size: 0.95rem;
  font-weight: 500;
  animation: slideInRight 0.3s ease-out;
  display: none;
  background-color: white; /* default fallback */
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* 禁用背景滚动 */
body.modal-open {
  overflow: hidden !important;
}

/* 修复：批量更改分类模态框 (batchCategoryModal) 下拉框显示不全的问题 */
/* 必须允许 overflow visible，否则 absolute 定位的下拉菜单会被截断 */
#batchCategoryModal .modal-content {
  overflow: visible !important;
  /* min-height: 300px;  Removed to avoid blank space */
}

/* 确保批量管理大模态框 (batchModal) 的内容不溢出 */
#batchModal .modal-content {
  overflow: hidden !important; /* 恢复 hidden，防止滚动条溢出圆角 */
  display: flex;
  flex-direction: column;
}

/* 恢复表格区域的正常滚动 */
#batchModal .flex-1.overflow-auto {
  padding-bottom: 0;
  margin-bottom: 0;
  overflow: auto !important;
}



