body {
  background: var(--bg-primary);
  padding-top: var(--navbar-height);
  min-height: 100vh;
  font-family: var(--font-family-base);
  color: var(--text-primary);
}

.main-content {
  transition: var(--transition-base);
  padding: var(--spacing-md) var(--spacing-lg) var(--spacing-md)
    calc(var(--sidebar-width) + var(--spacing-lg));
}

body:not(.sidebar-active) .main-content {
  padding-left: var(--spacing-lg);
  padding-right: var(--spacing-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
}

body:not(.sidebar-active) .content-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

body:not(.bg-none) .main-content,
body:not(.bg-none) .content-container {
  color: #f3f3f3;
}

.category-heading {
  font-size: var(--font-size-xl);
  display: flex;
  align-items: center;
  font-weight: 600;
  color: var(--text-primary);
  position: relative;
  font-family: var(--font-family-heading);
  letter-spacing: -0.01em;
}

.category-icon {
  margin-right: var(--spacing-sm);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: var(--font-size-base);
  box-shadow: var(--shadow-sm);
}

@media (max-width: 768px) {
  .main-content {
    padding-left: var(--spacing-lg);
  }

  body:not(.sidebar-active) .main-content {
    padding-left: var(--spacing-lg);
  }
}

@media (max-width: 576px) {
  .categoriesContainer {
    justify-content: center;
  }
  .main-content {
    padding-left: 0 !important;
    padding-right: 0 !important;
    display: block !important;
  }
  .content-container {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
    box-sizing: border-box;
    max-width: 100vw;
  }
  .card-container {
    margin: 0;
    padding: 0;
    justify-content: center;
  }
  .site-card {
    width: 100%;
    margin: 0 0 20px 0;
    box-sizing: border-box;
  }
}

/* 卡片容器 */
.card-container {
  margin: 0 calc(-1 * var(--spacing-sm));
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
}

/* 拖拽说明 */
.drag-instructions {
  width: 100%;
  padding: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  display: none;
}

.drag-instructions.active {
  display: block;
  animation: fadeInDown 0.3s ease;
}

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

/* 通用工具类 */
.text-center {
  text-align: center;
}
.text-muted {
  color: var(--text-muted);
}
.mb-4 {
  margin-bottom: var(--spacing-md);
}
.mb-5 {
  margin-bottom: var(--spacing-lg);
}
.mt-3 {
  margin-top: var(--spacing-sm);
}
.py-4 {
  padding-top: var(--spacing-md);
  padding-bottom: var(--spacing-md);
}
.py-5 {
  padding-top: var(--spacing-lg);
  padding-bottom: var(--spacing-lg);
}
.me-1 {
  margin-right: var(--spacing-xs);
}
.me-2 {
  margin-right: var(--spacing-sm);
}

/* 父分类卡片精简：只居中、适当间距、圆角，无渐变、无阴影、无动画 */
.category-card {
  display: flex;
  justify-content: center;
  align-items: center;
  background: none;
  border-radius: 12px;
  box-shadow: none;
  border: none;
  position: relative;
  transition: none;
}

body:not(.bg-none) .category-heading {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.78);
  padding: 8px 20px;
  border-radius: 8px;
  border: none;
  box-shadow: none;
  margin: 0 auto;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  animation: none;
}

.category-icon {
  margin-right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  font-size: 1.2rem;
  background: var(--primary-gradient);
  box-shadow: none;
  transition: none;
}

/* 子分类标签美化：主色渐变描边、悬浮放大发光、动效 */
.subcategory-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  justify-content: center;
  margin-bottom: 15px;
}
body:not(.bg-none) .subcategory-tag {
  background: rgba(255, 255, 255, 0.92);
  border: 2px solid;
  border-image: linear-gradient(90deg, #7049f0 0%, #4a88fc 100%) 1;
  color: #7049f0;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(112, 73, 240, 0.07);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
  padding: 0.32rem 1.1rem;
  border-radius: 0.2rem;
  font-size: 1rem;
}
body:not(.bg-none) .subcategory-tag:hover {
  background: rgba(255, 255, 255, 0.99);
  color: #4a88fc;
  transform: scale(1.09) translateY(-2px);
  box-shadow: 0 4px 16px rgba(112, 73, 240, 0.13);
  border-color: #4a88fc;
}
body:not(.bg-none) .subcategory-tag.active {
  background: linear-gradient(90deg, #e6e6ff 0%, #f0f7ff 100%);
  color: #7049f0;
  border-color: #7049f0;
}

@media (max-width: 768px) {
  .category-card {
    padding: 18px 0 12px 0;
    border-radius: 12px;
  }
  body:not(.bg-none) .category-heading {
    padding: 8px 16px;
    font-size: 1.1rem;
    border-radius: 8px;
  }
  .category-icon {
    width: 32px;
    height: 32px;
    font-size: 1.2rem;
    border-radius: 8px;
    margin-right: 10px;
  }
  /* 提升优先级，强制横滑 */
  .content-container > .subcategory-tags,
  .page-container .subcategory-tags,
  .subcategory-tags {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    gap: 0.4rem;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #7049f0 #f1f1f1;
  }
  .subcategory-tags::-webkit-scrollbar {
    height: 4px;
  }
  .subcategory-tags::-webkit-scrollbar-thumb {
    background: #7049f0;
    border-radius: 2px;
  }
  .subcategory-tag {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
  }
  body:not(.bg-none) .subcategory-tag {
    font-size: 0.92rem;
    padding: 0.22rem 0.7rem;
    border-radius: 1rem;
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* 使背景类叠加正确 */
body.bg-image,
body.bg-gradient,
body.bg-color {
  background-attachment: fixed;
}

body.bg-none {
  /* 无背景状态 */
  background: var(--bg-primary);
}

/* 已彻底删除 .subcategory-tags 的毛玻璃、背景、阴影等样式，确保只保留前面清空和居中布局的部分 */

/* 父分类标题整体可点击，数量高亮 */
.category-heading-link {
  text-decoration: none;
  color: inherit;
  display: inline-block;
  transition: color 0.18s;
}
.category-heading-link:hover .category-heading {
  color: #7049f0;
}
.category-heading {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.78);
  padding: 8px 20px;
  border-radius: 8px;
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: color 0.18s;
}
.category-count {
  margin-left: 10px;
  font-size: 0.9rem;
  color: #7049f0;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  background-color: rgba(112, 73, 240, 0.15);
  border: 1px solid rgba(112, 73, 240, 0.2);
  border-radius: 0.75rem;
  padding: 0 0.5rem;
  transition: all 0.2s ease;
}

.category-heading-link:hover .category-count {
  background-color: rgba(112, 73, 240, 0.25);
  border-color: rgba(112, 73, 240, 0.3);
  transform: scale(1.05);
}

.subcategory-count {
  margin-left: 4px;
  color: #7049f0;
  font-weight: 500;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.3rem;
  height: 1.3rem;
  background-color: rgba(112, 73, 240, 0.15);
  border: 1px solid rgba(112, 73, 240, 0.2);
  border-radius: 0.65rem;
  padding: 0 0.4rem;
  transition: all 0.2s ease;
}

.subcategory-tag:hover .subcategory-count {
  background-color: rgba(112, 73, 240, 0.25);
  border-color: rgba(112, 73, 240, 0.3);
  transform: scale(1.05);
}

.search-header-with-summary {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.78);
  padding: 12px 28px;
  border-radius: 12px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(112, 73, 240, 0.07);
}
.search-header-content {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}
.search-summary {
  color: var(--text-primary);
  font-size: 1.08rem;
  font-weight: 500;
  margin-top: 2px;
}

.search-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.78);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(112, 73, 240, 0.07);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 12px 28px;
  margin-bottom: 24px;
  min-height: 48px;
}

.search-status-text {
  font-size: 1.08rem;
  font-weight: 500;
  color: var(--text-primary);
}
