/* ========== Pixel Theme overrides (search boxes, back-to-top, pagination) ========== */
.pixel-theme { 
  --px: 6px; 
  --blue: #00b6ff; 
  --blue-dark: #0a6fb0; 
  --bg: #ffffff; 
  --red: #ff3b30; 
  --red-dark: #c21f1f; 
  --shadow: 0 10px 24px rgba(0, 0, 0, .18); 
}

/* ====== SEARCH BOX (首页 + 搜索页) ====== */
.pixel-theme #searchForm {
  width: min(92%, 860px);
  display: flex; 
  align-items: center; 
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border: var(--px) solid var(--blue);
  border-radius: 16px; /* 圆角 */
  box-shadow: var(--shadow);
  position: relative;
  isolation: isolate;
}

/* 删除四个角的蓝色短杠 */
.pixel-theme #searchForm::before,
.pixel-theme #searchForm::after {
  content: none;
}

.pixel-theme #searchForm input[type="text"],
.pixel-theme #searchForm input[type="search"] {
  flex: 1 1 auto; 
  min-width: 0;
  height: 48px;
  background: transparent;
  border: none;
  outline: none;
  box-shadow: none !important;
  font-size: 16px;
  padding: 0 6px;
}

.pixel-theme #searchForm .search-btn,
.pixel-theme #searchForm button[type="submit"] {
  height: 48px; 
  min-width: 48px;
  display: inline-flex; 
  align-items: center; 
  justify-content: center;
  padding: 0 18px;
  color: #fff; 
  font-weight: 700; 
  letter-spacing: .05em;
  background: var(--red);
  border: var(--px) solid var(--red-dark);
  border-radius: 999px; /* 红色圆形按钮 */
  box-shadow: 0 6px 0 var(--red-dark), 0 10px 18px rgba(0, 0, 0, .15);
  text-shadow: 0 1px 0 rgba(0, 0, 0, .25);
}

.pixel-theme #searchForm .search-btn:hover,
.pixel-theme #searchForm button[type="submit"]:hover { 
  transform: translateY(-1px); 
}

.pixel-theme #searchForm .search-btn:active,
.pixel-theme #searchForm button[type="submit"]:active { 
  transform: translateY(2px); 
  box-shadow: 0 2px 0 var(--red-dark); 
}

/* ====== BACK TO TOP ====== */
.pixel-theme .scroll-top {
  position: fixed;
  right: 18px; 
  bottom: 26px;
  z-index: 999;
  margin: 0;
  display: grid; 
  place-items: center;
  width: 80px; height: 80px;  /* Adjust size to fit text */
  user-select: none;
  cursor: pointer;
  background: var(--red);
  color: #fff;
  border: var(--px) solid var(--red-dark);
  border-radius: 12px;
  box-shadow: 0 8px 0 var(--red-dark), 0 16px 30px rgba(0,0,0,.2);
}

.pixel-theme .scroll-top dd {
  margin: 0; 
  font-weight: 700; 
  font-size: 10px;  /* Adjust this to make text smaller */
  text-align: center;
}

.pixel-theme .scroll-top dd:first-child {
  font-size: 14px; /* Adjust the icon size */
  line-height: 1;
}

/* ====== PAGINATION ====== */
.pixel-theme .pagination { display: flex; flex-wrap: wrap; gap: 8px; }
.pixel-theme .pagination .page-item,
.pixel-theme .pagination .page-link {
  display: inline-flex; 
  align-items: center; 
  justify-content: center;
  padding: 10px 14px;
  min-width: 44px; 
  height: 44px;
  font-weight: 700;
  background: var(--bg);
  border: var(--px) solid var(--blue);
  border-radius: 12px;  /* 圆角 */
  color: #0b4258;
  text-decoration: none;
  box-shadow: 0 6px 0 var(--blue-dark), 0 10px 18px rgba(0, 0, 0, .08);
  transition: all 0.3s ease; /* 添加平滑过渡效果 */
}

/* 鼠标悬停时的效果 */
.pixel-theme .pagination .page-item .page-link:hover {
  transform: translateY(-2px); /* 鼠标悬停时上移 */
}

/* 鼠标点击按下时的效果 */
.pixel-theme .pagination .page-item .page-link:active {
  transform: translateY(4px); /* 鼠标点击时下移 */
  box-shadow: 0 2px 0 var(--blue-dark); /* 点击后的阴影效果 */
}

/* 修改当前页的背景色，去掉蓝色背景 */
.pixel-theme .pagination .page-item.active .page-link {
  background: var(--blue) !important;
  color: #fff !important;
  border-radius: 999px !important;
  font-size: 16px !important;
  box-shadow: 0 4px 0 var(--blue-dark), 0 8px 16px rgba(0, 0, 0, .06) !important;
}

/* 确保选中页的样式不被其他规则覆盖 */
.pixel-theme .pagination .page-item.active .page-link {
  background: var(--blue) !important; 
  color: #fff !important; 
  border-radius: 999px !important; 
  font-size: 16px !important; 
  box-shadow: 0 4px 0 var(--blue-dark), 0 8px 16px rgba(0, 0, 0, .06) !important;
}

/* Hover and Active states for pagination */
.pixel-theme .pagination .page-item .page-link:hover {
  transform: translateY(-1px); /* 鼠标悬停效果 */
}

.pixel-theme .pagination .page-item .page-link:active {
  transform: translateY(2px); /* 按钮点击效果 */
  box-shadow: 0 2px 0 var(--blue-dark); /* 点击后的阴影 */
}

.pixel-theme .pagination .page-item.disabled .page-link {
  opacity: .5;
  box-shadow: none;
}

/* Keep original layout intact */
.pixel-theme .pagination .page-link,
.pixel-theme .pagination .page-item { 
  border-radius: 0.75rem; /* slightly rounded */
}

/* === Pixel add-on: 列表页的卡片边框（轻度像素风） === */
.pixel-theme .pages .card {
  position: relative;
  border: var(--px) solid var(--blue); /* 保留边框 */
  border-radius: 12px;
  box-shadow: 0 6px 0 var(--blue-dark), 0 10px 18px rgba(0, 0, 0, .06);
}

.pixel-theme .pages .card::after {
  content: none; /* 删除四个角的蓝色短杠 */
}

/* 与卡片列表相关的列表组/条目，统一更细致的像素描边 */
.pixel-theme .pages .list-group-item {
  border: var(--px) solid var(--blue);
  border-radius: 10px;
  margin-bottom: 8px;
}

/* === Pixel add-on: 分类/筛选区域的边框 === */
.pixel-theme .filter-box,
.pixel-theme .tag-cloud-card,
.pixel-theme .category-box,
.pixel-theme .filters,
.pixel-theme .filter-panel {
  position: relative;
  border: var(--px) solid var(--blue);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 0 var(--blue-dark), 0 12px 20px rgba(0, 0, 0, .05);
  padding-top: calc(var(--px) + 8px);
}

.pixel-theme .filter-box::before,
.pixel-theme .tag-cloud-card::before,
.pixel-theme .category-box::before,
.pixel-theme .filters::before,
.pixel-theme .filter-panel::before {
  content: none; /* 删除四个角的蓝色短杠 */
}

.pixel-theme .filter-divider { 
  border-top: var(--px) dashed #e6f7ff; 
}

/* 选中按钮更像素风（不影响按钮布局） */
.pixel-theme .filter-box .btn-info {
  border: var(--px) solid var(--blue-dark);
  box-shadow: 0 3px 0 var(--blue-dark), 0 8px 16px rgba(0, 0, 0, .06);
}

.pixel-theme .filter-box .btn-info:hover { 
  transform: translateY(-1px); 
}

.pixel-theme .filter-box .btn-info:active { 
  transform: translateY(1px); 
  box-shadow: 0 1px 0 var(--blue-dark); 
}

/* === Pixel add-on v3: 首页「精选代码」列表卡片的边框保留，同时去除四个角的蓝色短杠 === */
.pixel-theme .bg-white.py-5 > .container > .row > [class*="col-"] > .card {
  position: relative;
  border: var(--px) solid var(--blue); /* 保留边框 */
  border-radius: 8px;
  box-shadow: 0 6px 0 var(--blue-dark), 0 10px 18px rgba(0, 0, 0, .06);
}

.pixel-theme .bg-white.py-5 > .container > .row > [class*="col-"] > .card::after {
  content: none; /* 删除四个角的蓝色短杠 */
} 


/* ========== Pixel Theme overrides (底部信息栏样式) ========== */
/* 修改底部信息栏 */
.pixel-theme .footer-info {
    text-align: center; /* 居中显示 */
    font-size: 12px; /* 调整字体大小 */
    color: #333; /* 文字颜色 */
    padding: 2px 0; /* 上下间距 */
    background: #f0f0f0; /* 设置背景色 */
    border-radius: 6px; /* 添加圆角 */
    border: 1px solid #00b6ff; /* 边框颜色 */
}

/* 分类筛选布局与按钮 */
.filter-box {
  --filter-chip-height: 38px;
  --filter-chip-gap-y: 10px;
  --filter-chip-gap-x: 14px;
}

.filter-box .filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: stretch;
}

.filter-box .filter-label {
  flex: 0 0 230px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
}

.filter-box .filter-label-text {
  white-space: nowrap;
}

.filter-box .filter-options-window {
  flex: 1 1 0;
  position: relative;
  border-left: 1px dashed #e6f7ff;
  padding-left: 24px;
  min-height: calc(var(--filter-chip-height) + 14px);
}

.filter-box .filter-options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--filter-chip-gap-y) var(--filter-chip-gap-x);
  max-height: calc((var(--filter-chip-height) + var(--filter-chip-gap-y)) * 2 - var(--filter-chip-gap-y));
  overflow-y: auto;
  padding-right: 36px;
  scroll-behavior: smooth;
    scrollbar-width: none;        /* Firefox */
  -ms-overflow-style: none;     /* IE/Edge legacy */
}
.filter-box .filter-options::-webkit-scrollbar {
  width: 0;
  height: 0;    
}

.filter-box .filter-options:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 182, 255, .25);
  border-radius: 10px;
}

.filter-box .filter-chip {
  min-width: 92px;
  height: var(--filter-chip-height);
  padding: 0 18px;
  border-radius: 30px;
  border: 2px solid #00b6ff;
  background: #f4fbff;
  color: #0f172a;
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease, color .2s ease;
}

.filter-box .filter-chip:hover {
  background: #00b6ff;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, .12);
}

.filter-box .filter-chip.is-active {
  background: #00b6ff;
  color: #fff;
  box-shadow: 0 6px 12px rgba(0, 0, 0, .18);
}

.filter-box .filter-chip--all {
  min-width: 86px;
  flex-shrink: 0;
}

.filter-box .filter-options-window .filter-scroll-btn {
  position: absolute;
  right: 0;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 6px;
  background: #dff4ff;
  color: #0b4258;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0, 182, 255, .35);
  transition: background .2s ease, color .2s ease, opacity .2s ease;
}

.filter-box .filter-options-window .filter-scroll-btn--up {
  top: 0;
}

.filter-box .filter-options-window .filter-scroll-btn--down {
  bottom: 0;
}

.filter-box .filter-options-window .filter-scroll-btn:focus-visible {
  outline: 2px solid #00b6ff;
  outline-offset: 2px;
}

.filter-box .filter-options-window:not(.is-scrollable) .filter-scroll-btn {
  opacity: 0;
  pointer-events: none;
}

.filter-box .filter-options-window.at-top .filter-scroll-btn--up,
.filter-box .filter-options-window.at-bottom .filter-scroll-btn--down {
  opacity: .35;
  cursor: not-allowed;
}

.filter-divider {
  border: 0;
  border-top: 1px dashed #e2e8f0;
  margin: 20px 0;
}

@media (max-width: 1199.98px) {
  .filter-box .filter-label {
    flex: 0 0 200px;
  }
}

@media (max-width: 767.98px) {
  .filter-box .filter-row {
    flex-direction: column;
    gap: 12px;
  }
  .filter-box .filter-label {
    flex: 1 1 auto;
    justify-content: flex-start;
  }
  .filter-box .filter-options-window {
    border-left: 0;
    padding-left: 0;
  }
  .filter-box .filter-options {
    padding-right: 0;
  }
  .filter-box .filter-options-window .filter-scroll-btn {
    right: 4px;
  }
}
