/* =============================================
   牵手婚恋 — 筛选会员页面样式
   （此文件在 profile-staff.css 之后加载，统一筛选面板控件样式）
   ============================================= */

.filter-panel,
.filter-panel * {
  box-sizing: border-box;
}

/* ========== 筛选面板（卡片式） ========== */
.filter-panel {
  margin: 12px 12px 4px;
  padding: 12px 14px calc(10px + var(--browser-bottom-ui, 0px));
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.05);
}

/* ========== 顶部紧凑搜索栏 ========== */
.filter-search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  margin-bottom: 6px;
}

.filter-search-label {
  width: 84px;
  flex-shrink: 0;
  font-size: 13px;
  line-height: 1.3;
  color: #333;
  font-weight: 500;
  white-space: nowrap;
}

.filter-search-bar i {
  color: #9ca3af;
  font-size: 14px;
}

.filter-search-bar .filter-search-input {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  color: #333;
  background: #fff;
  outline: none;
}

.paired-exclude-wrap .filter-search-input {
  height: 32px;
}

.filter-search-bar .filter-search-input:focus {
  border-color: var(--color-primary);
}

.filter-search-bar .filter-search-input::placeholder {
  color: #9ca3af;
}

/* ========== 筛选行 ========== */
.filter-row {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 6px 0;
}

.filter-label {
  width: 84px;
  flex-shrink: 0;
  font-size: 13px;
  line-height: 1.3;
  color: #333;
  font-weight: 500;
}

/* ========== 按钮组（分段式等宽） ========== */
.filter-btn-group {
  display: flex;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.filter-opt {
  flex: 1;
  min-width: 0;
  height: 36px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fafafa;
  font-size: 14px;
  color: #555;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.filter-opt.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  font-weight: 500;
}

.filter-opt:active {
  transform: scale(0.97);
}

/* ========== 下拉选择（统一高度/边框/箭头） ========== */
.filter-select {
  height: 36px;
  padding: 0 10px;
  padding-right: 28px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  color: #333;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M2 3.5L5 6.5L8 3.5' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.filter-select:focus {
  border-color: var(--color-primary);
  outline: none;
}

.filter-select-full {
  flex: 1;
  min-width: 0;
  max-width: 300px;
}

.city-select {
  flex: 1;
  min-width: 0;
  width: 0;
}

.filter-city-row {
  display: flex;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

/* ========== 省/市/区三级联动：自定义紧凑下拉 ==========
   原生 select 仅作为值容器（JS 置 display:none），视觉替换为
   触发器 + 紧凑弹窗，保证桌面/iOS/Android 各端弹窗字号、间距一致紧凑 */
.filter-city-row .filter-select {
  height: 30px;
  font-size: 12px;
  padding: 0 8px;
  padding-right: 22px;
  background-position: right 6px center;
}

.filter-city-row {
  gap: 4px;
}

.region-select-wrap {
  flex: 1;
  min-width: 0;
  position: relative;
}

.region-trigger {
  height: 30px;
  padding: 0 8px;
  padding-right: 22px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.2;
  color: #333;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M2 3.5L5 6.5L8 3.5' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 6px center;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-tap-highlight-color: transparent;
}

.region-select-wrap.disabled .region-trigger {
  color: #b0b3b8;
  background-color: #fafafa;
  cursor: not-allowed;
}

.region-popup {
  display: none;
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  width: 100%;
  z-index: 1300;
  max-height: 190px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.region-opt {
  padding: 5px 8px;
  font-size: 12px;
  line-height: 1.2;
  color: #333;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.region-opt.selected {
  color: var(--color-primary);
  font-weight: 600;
}

.region-opt:active {
  background: #f3f4f6;
}

/* ========== 范围选择（年龄、身高） ========== */
.filter-range-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.filter-range-row .filter-select,
.range-input {
  flex: 1;
  min-width: 0;
  height: 36px;
}

.range-input {
  padding: 0 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
  color: #333;
  background: #fff;
  -webkit-appearance: none;
}

.range-input:focus {
  border-color: var(--color-primary);
  outline: none;
}

.range-sep {
  color: #bbb;
  font-size: 14px;
}

.range-unit {
  color: #999;
  font-size: 13px;
}

/* ========== 文本输入（内部筛选的"排除已配对"等） ========== */
.filter-search-input {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  color: #333;
  background: #fff;
  outline: none;
}

.filter-search-input:focus {
  border-color: var(--color-primary);
}

.filter-search-input::placeholder {
  color: #9ca3af;
}

/* ========== 内部筛选展开/收起 ========== */
.advanced-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 0 2px;
  margin-top: 4px;
  color: var(--color-primary);
  font-size: 14px;
  cursor: pointer;
  border-top: 1px dashed #e8e8e8;
  -webkit-tap-highlight-color: transparent;
}

.advanced-toggle i {
  font-size: 12px;
  transition: transform 0.3s;
}

.advanced-toggle.open #staffToggleIcon {
  transform: rotate(180deg);
}

/* 排除已配对选中标签（与整体控件风格统一） */
.paired-chip {
  height: 36px;
  border-color: #e5e7eb;
  border-radius: 8px;
}

/* ========== 操作按钮 ========== */
.filter-actions {
  display: flex;
  gap: 12px;
  padding: 14px 0 2px;
}

.btn-reset,
.btn-search {
  flex: 1;
  height: 42px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.btn-reset {
  background: #f3f4f6;
  color: #666;
}

.btn-reset:active {
  background: #e5e7eb;
}

.btn-search {
  background: var(--color-primary);
  color: #fff;
}

.btn-search:active {
  opacity: 0.9;
}

/* ========== 工作性质多选（复用 utils.js 组件，尺寸对齐筛选面板控件） ========== */
#filterEmpTypeTrigger {
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 10px !important;
  border: 1px solid #e5e7eb !important;
  border-radius: 8px !important;
  font-size: 14px !important;
  color: #333 !important;
  background: #fff !important;
  box-sizing: border-box !important;
}

#filterEmpTypeTrigger .hd-arrow {
  margin-left: 6px;
}

#filterEmpTypePanel {
  width: min(380px, calc(100vw - 16px)) !important;
  z-index: 1100;
  text-align: left;
}

#filterEmpTypePanel .emp-item {
  font-size: 13px;
}

/* ========== 结果统计栏 ========== */
.result-bar {
  padding: 12px 16px;
  background: #fafafa;
  font-size: 14px;
  color: #666;
  border-bottom: 1px solid #f0f0f0;
}

.result-bar strong {
  color: var(--color-primary);
}

/* ========== 会员列表（复用首页样式） ========== */
.member-list {
  padding: 0 16px;
}

/* 空结果提示 — 固定居中，避免被导航栏遮挡 */
#emptyTip {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 9997;
  text-align: center;
  padding: 40px 20px;
  font-size: 15px;
  color: #999;
  pointer-events: none;
}

/* 已到底提示 — 复用 main.css 的 .load-end-tip 样式，通过 .show 类控制显隐 */

/* ========== 移动端：输入框高度收紧 ========== */
@media (max-width: 767px) {
  .filter-opt {
    height: 32px;
  }

  .filter-select {
    height: 32px;
  }

  .filter-range-row .filter-select,
  .range-input {
    height: 32px;
  }

  .filter-search-input {
    height: 32px;
  }

  .filter-search-bar .filter-search-input,
  .paired-exclude-wrap .filter-search-input {
    height: 28px;
  }

  .filter-city-row .filter-select {
    height: 28px;
  }
}

/* ========== 桌面端布局优化（「筛选会员」入口，新标签页打开） ========== */
@media (min-width: 1024px) {
  .filter-panel {
    max-width: 980px;
    margin: 24px auto;
    padding: 24px 30px 20px;
  }

  /* 条件双列排布，减少纵向长度 */
  .quick-filter,
  .advanced-filter {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 36px;
  }

  .filter-row {
    padding: 8px 0;
  }

  .filter-label {
    width: 96px;
    font-size: 14px;
  }

  /* 双列下无需 300px 宽度上限 */
  .filter-select-full {
    max-width: none;
  }

  /* 搜索栏与操作按钮限宽 */
  .filter-search-bar {
    max-width: 560px;
  }

  .filter-actions {
    max-width: 420px;
    margin-left: auto;
  }

  /* 结果区域限宽居中 */
  .result-bar,
  .member-list,
  #filter-end-tip {
    max-width: 980px;
    margin-left: auto;
    margin-right: auto;
  }

  .member-list {
    padding: 16px 0;
  }
}
