/* ============================================================
 * ip-supermarket 列表页通用筛选组件（专利/商标/版权/域名共用）
 *
 * 统一「购买查询」人机交互的通用组件：
 *   - 筛选面板 .ip-filter-panel（卡片 + 左标签右选项行）
 *   - 胶囊选项 .ip-filter-chip（未选浅边框，选中主色填充）
 *   - 搜索框 .ip-search（关键词 + 模糊/精确切换 + 搜索按钮）
 *   - 排序栏 .sort-bar（下划线 tab + 联系客服）
 *   - 联系客服 .sort-contact（胶囊 + hover 二维码）
 *   - 已选条件 .active-filters（可删 tag + 清空）
 *
 * 主色 #423dff，与站点 modern.css 令牌一致；浅色主题。
 * ============================================================ */

/* ==================== 筛选面板 ==================== */
.ip-filter-panel {
  width: 100%;
  margin: 0 0 14px 0;
  background: #fff;
  border: 1px solid #e8eaee;
  border-radius: 10px;
  overflow: hidden;
  box-sizing: border-box;
}

.ip-filter-row {
  display: flex;
  align-items: stretch;
  width: 100%;
  border-bottom: 1px solid #f0f1f4;
  box-sizing: border-box;
}

.ip-filter-row:last-child {
  border-bottom: 0;
}

.ip-filter-label {
  flex: 0 0 110px;
  width: 110px;
  padding: 14px 0 0 20px;
  box-sizing: border-box;
  background: #fafbfc;
  font-size: 14px;
  font-weight: 700;
  color: #3c4048;
}

.ip-filter-label .ip-filter-label__hint {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 400;
  color: #9aa1ad;
}

.ip-filter-options {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #fff;
  box-sizing: border-box;
}

/* ==================== 胶囊选项 ==================== */
.ip-filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 15px;
  font-size: 13px;
  line-height: 1.5;
  color: #555;
  background: #fff;
  border: 1px solid #e5e7eb;
  text-decoration: none;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}

.ip-filter-chip:hover {
  color: #423dff;
  border-color: #423dff;
}

.ip-filter-chip.is-active {
  color: #fff;
  background: #423dff;
  border-color: #423dff;
}

/* 分面计数（R7-13）：chip 右侧命中数 */
.ip-filter-chip__count {
  margin-left: 4px;   /* B8 热门角标对齐终值（原 5px 被 :716 覆盖块静默覆盖） */
  font-size: 11px;
  line-height: 1;
  opacity: .55;
  font-variant-numeric: tabular-nums;
}

.ip-filter-chip.is-active .ip-filter-chip__count {
  opacity: .85;
}

/* 计数为 0：置灰但仍可点（便于用户试探组合条件） */
.ip-filter-chip.is-empty {
  color: #b9bec9;
  border-color: #eef0f4;
}

.ip-filter-chip.is-empty:hover {
  color: #423dff;
  border-color: #423dff;
}

/* 商标页复用胶囊时的选项间距（trademark.css 的 .filter-options/.price-filter 无 gap） */
.filter-options,
.price-filter {
  gap: 8px;
}

/* ==================== 搜索框 ==================== */
.ip-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 280px;
}

.ip-search__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #dcdfe6;
  border-radius: 6px;
  font-size: 14px;
  color: #1f2329;
  box-sizing: border-box;
  outline: none;
  transition: border-color .15s ease;
}

.ip-search__input:focus {
  border-color: #423dff;
}

.ip-mode-toggle {
  flex: 0 0 auto;
  height: 36px;
  padding: 0 14px;
  border: 1px solid #dcdfe6;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  color: #666;
  cursor: pointer;
  box-sizing: border-box;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}

.ip-mode-toggle.is-active {
  background: #f0f0ff;
  color: #423dff;
  border-color: #423dff;
}

.ip-search__btn {
  flex: 0 0 auto;
  height: 36px;
  padding: 0 22px;
  background: #423dff;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  box-sizing: border-box;
  transition: background .15s ease;
}

.ip-search__btn:hover {
  background: #0f3fb0;
}

/* ==================== 排序栏（左排序 + 右联系客服） ====================
   R7-15 批 7：sticky 吸顶——长列表（专利 4,632 页）滚动中排序/计数常驻。 */
.sort-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin: 0 0 14px 0;
  background: #fff;
  border: 1px solid #e8eaee;
  border-radius: 10px;
  padding: 0 16px;
  height: 48px;
  box-sizing: border-box;
  position: sticky;
  top: 0;
  z-index: 30;
}

.sort-bar__conditions {
  display: flex;
  align-items: center;
  margin: 0;
}

.sort-bar__trade {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 0 auto;
}

.service-tips {
  font-size: 13px;
  color: #8a9099;
  margin: 0;
}

.sort-item {
  display: inline-flex;
  align-items: center;
  line-height: 48px;
  padding: 0 16px;
  font-size: 14px;
  color: #3c4048;
  text-decoration: none;
  position: relative;
  transition: color .15s ease;
}

.sort-item:hover {
  color: #423dff;
}

.sort-item--active {
  color: #423dff;
  font-weight: 600;
}

.sort-item--active::after {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 0;
  height: 2px;
  border-radius: 1px;
  background: #423dff;
}

.sort-item--price {
  gap: 6px;
}

.sort-arrows {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.sort-arrow {
  display: block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
}

.sort-arrow--up {
  border-bottom: 5px solid #9aa1ad;
}

.sort-arrow--down {
  border-top: 5px solid #9aa1ad;
}

.sort-arrow.is-active {
  border-bottom-color: #423dff;
  border-top-color: #423dff;
}

.sort-item--price:hover .sort-arrow--up {
  border-bottom-color: #423dff;
}

.sort-item--price:hover .sort-arrow--down {
  border-top-color: #423dff;
}

.sort-bar__count {
  margin: 0 0 0 12px;
  font-size: 13px;
  color: #8a9099;
}

/* 联系客服（胶囊 + hover 二维码） */
.sort-contact {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  height: 30px;
  border: 1px solid #423dff;
  border-radius: 15px;
  background: #fff;
  cursor: pointer;
  box-sizing: border-box;
  transition: background .15s ease;
}

.sort-contact:hover {
  background: #423dff;
}

.sort-contact__icon {
  position: relative;
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 1.5px solid #423dff;
  border-radius: 50% 50% 50% 0;
  box-sizing: border-box;
  transition: border-color .15s ease;
}

.sort-contact__icon::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 5px;
  height: 5px;
  transform: translate(-50%, -50%);
  background: #423dff;
  border-radius: 50%;
  transition: background .15s ease;
}

.sort-contact__label {
  font-size: 13px;
  color: #423dff;
  transition: color .15s ease;
}

.sort-contact:hover .sort-contact__icon,
.sort-contact:hover .sort-contact__icon::after {
  border-color: #fff;
}

.sort-contact:hover .sort-contact__icon::after {
  background: #fff;
}

.sort-contact:hover .sort-contact__label {
  color: #fff;
}

.sort-contact__popup {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  width: 168px;
  background: #fff;
  border: 1px solid #e8eaee;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .12);
  padding: 14px;
  box-sizing: border-box;
  display: none;
  z-index: 999;
  text-align: center;
}

.sort-contact:hover .sort-contact__popup {
  display: block;
}

.sort-contact__arrow {
  position: absolute;
  top: -7px;
  right: 30px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-left: 1px solid #e8eaee;
  border-top: 1px solid #e8eaee;
  transform: rotate(45deg);
}

.sort-contact__img {
  width: 138px;
  height: 138px;
  display: block;
  margin: 0 auto;
}

.sort-contact__tip {
  margin-top: 8px;
  font-size: 12px;
  color: #8a9099;
}

/* ==================== 已选条件 ==================== */
.active-filters {
  width: 100%;
  border: 1px solid #e8eaee;
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
  box-sizing: border-box;
  margin: 0 0 14px 0;
}

.active-filters ul {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.active-filters li {
  margin: 0;
  list-style: none;
}

.active-filters__label {
  flex: 0 0 110px;
  width: 110px;
  padding: 0 0 0 20px;
  line-height: 50px;
  box-sizing: border-box;
  background: #fafbfc;
  align-self: stretch;
  border-radius: 10px 0 0 10px;
}

.active-filters__label span {
  font-weight: 700;
  color: #3c4048;
}

.active-filters__tags {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  background: #fff;
  padding: 0 0 0 12px;
  min-height: 50px;
  box-sizing: border-box;
}

.active-filters__tags a {
  display: inline-block;
  color: #423dff;
  border: 1px solid #e6f1fb;
  background: #e6f1fb;
  border-radius: 14px;
  padding: 0 12px;
  height: 26px;
  line-height: 26px;
  margin: 0 10px 0 0;
  font-size: 13px;
  text-decoration: none;
  transition: background .15s ease;
}

.active-filters__tags a::after {
  content: ' ×';
  font-weight: 700;
  margin-left: 2px;
}

.active-filters__tags a:hover {
  background: #d5e6fa;
}

.active-filters__clear {
  flex: 0 0 auto;
  padding: 0 16px 0 0;
  box-sizing: border-box;
}

.active-filters__clear .clear-all {
  display: inline-block;
  line-height: 50px;
  padding: 0 8px;
  font-size: 13px;
  color: #8a9099;
  text-decoration: none;
  transition: color .15s ease;
}

.active-filters__clear .clear-all:hover {
  color: #423dff;
}

/* ==================== 自定义价格区间（2026-11-05 B3b 统一到公共层） ====================
   商标页原本定义在 trademark.css，专利/版权/域名用内联 style 各写一套；
   统一到 filter-common.css 后四品类共用同一份标记与样式。 */
.price-custom {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0 2px 10px;
  box-sizing: border-box;
}

.price-custom__field {
  position: relative;
  display: flex;
  align-items: center;
}

.price-custom__input {
  width: 92px;
  height: 28px;
  border: 1px solid var(--border, #e8eaee);
  border-radius: 4px;
  padding: 0 22px 0 10px;
  font-size: 13px;
  color: var(--text-primary, #1f2329);
  box-sizing: border-box;
  transition: border-color .15s ease;
}

.price-custom__input:focus {
  border-color: var(--brand, #423dff);
  outline: none;
}

.price-custom__unit {
  position: absolute;
  right: 8px;
  font-size: 12px;
  color: var(--text-hint, #9aa1ad);
  pointer-events: none;
}

.price-custom__dash {
  color: var(--text-tertiary, #8a9099);
  font-size: 13px;
}

.price-custom__btns {
  display: flex;
  gap: 8px;
  margin-left: 6px;
}

.price-custom__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  padding: 0 14px;
  font-size: 13px;
  border-radius: 4px;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
  transition: opacity .15s ease, border-color .15s ease, color .15s ease;
}

.price-custom__btn--clear {
  background-color: #fff;
  border: 1px solid var(--border, #e8eaee);
  color: var(--text-secondary, #3c4048);
}

.price-custom__btn--clear:hover {
  border-color: var(--brand, #423dff);
  color: var(--brand, #423dff);
}

.price-custom__btn--ok {
  background-color: var(--brand, #423dff);
  border: 1px solid var(--brand, #423dff);
  color: #fff;
}

.price-custom__btn--ok:hover {
  background-color: var(--brand-hover, #0f46b8);
}

/* ==================== 分页（2026-11-05 B3b 统一到公共层） ====================
   商标页原用 trademark.css 的 .pagination-area，其余三页各写内联 .pagination；
   此处定义唯一一套，四品类同款（首尾页 + 当前页 ±4 + 省略号）。 */
.pagination-area {
  width: 100%;
  padding: 24px 0 40px 0;
  text-align: center;
  font-size: 14px;
}

.pagination-area a,
.pagination-area .current {
  display: inline-block;
  min-width: 34px;
  height: 34px;
  line-height: 34px;
  padding: 0 8px;
  margin: 0 4px;
  border: 1px solid var(--border, #e8eaee);
  border-radius: 4px;
  background-color: #fff;
  color: var(--text-secondary, #3c4048);
  text-decoration: none;
  vertical-align: middle;
}

.pagination-area a:hover {
  border-color: var(--brand, #423dff);
  color: var(--brand, #423dff);
}

.pagination-area .current {
  background-color: var(--brand, #423dff);
  border-color: var(--brand, #423dff);
  color: #fff;
  font-weight: 600;
}

.pagination-area .ellipsis {
  display: inline-block;
  height: 34px;
  line-height: 34px;
  margin: 0 4px;
  color: var(--text-tertiary, #8a9099);
  vertical-align: middle;
}

/* 统计文案（R7-15 批 5：partials/pager 的 info 位） */
.pagination-area__info {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--text-tertiary, #8a9099);
}

/* ==================== 回到顶部（R7-15 批 7：四品类列表底部挂载） ==================== */
.ip-top-btn {
  position: fixed;
  right: 28px;
  bottom: 48px;
  width: 44px;
  height: 44px;
  border: 1px solid #e5e7eb;
  border-radius: 50%;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M8 3.5 2.8 8.7l1.4 1.4L8 6.3l3.8 3.8 1.4-1.4z' fill='%235a5f6a'/%3E%3Crect x='7.2' y='6' width='1.6' height='6.5' rx='.8' fill='%235a5f6a'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  box-shadow: 0 4px 16px rgba(23, 26, 31, .10);
  cursor: pointer;
  z-index: 90;
  transition: border-color .18s ease, background-color .18s ease;
}

.ip-top-btn:hover {
  border-color: #423dff;
  background-color: #f6f5ff;
}

/* ==================== 分面：热门角标 + 折叠（R7-15 批 8） ==================== */
.ip-filter-chip__hot {
  display: inline-block;
  margin-left: 4px;
  padding: 0 4px;
  border-radius: 3px;
  font-size: 10px;
  line-height: 14px;
  font-weight: 600;
  color: #b45309;
  background: #fef3c7;
  vertical-align: 1px;
}

.ip-filter-chip.is-active .ip-filter-chip__hot {
  color: #fff;
  background: rgba(255, 255, 255, .22);
}

.ip-filter-fold {
  display: inline-block;
  padding: 5px 12px;
  margin: 0 4px;
  border: 1px dashed #c9c6ff;
  border-radius: 4px;
  background: transparent;
  font-size: 13px;
  color: #423dff;
  cursor: pointer;
  vertical-align: middle;
}

.ip-filter-fold:hover {
  background: #f6f5ff;
}


/* ==================== 响应式（R7-13：此前零断点，ip-filter-* 窄屏横向溢出） ==================== */
@media (max-width: 992px) {
  .ip-filter-row {
    flex-wrap: wrap;
  }

  .ip-filter-label {
    flex: 0 0 100%;
    width: 100%;
    padding: 10px 16px 0;
  }

  .ip-filter-options {
    flex: 1 1 100%;
    padding: 8px 12px 10px;
  }
}

@media (max-width: 768px) {
  .sort-bar {
    flex-wrap: wrap;
    row-gap: 8px;
    padding: 10px 12px;
  }

  .sort-bar__trade {
    margin-left: 0;
  }

  .ip-search {
    min-width: 0;
    flex: 1 1 100%;
  }
}

@media (max-width: 560px) {
  .price-custom {
    flex-wrap: wrap;
  }
}
