/* ========== 核心组件样式开始 ========== */

/* 1. 遮罩层 */
#filter-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
#filter-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* 2. 底部抽屉容器 */
#filter-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  max-height: 85vh; /* 限制最高高度 */
  background-color: #ffffff;
  border-radius: 8px 8px 0 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}
#filter-drawer.active {
  transform: translateY(0);
}

/* 3. 头部 */
.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  flex-shrink: 0;
  position: relative;
}
.drawer-header h3 {
  font-size: 15px;
  color: #282828;
  font-weight: 400;
  flex: 1;
  text-align: center;
}
.drawer-header .popup_close {
  position: absolute;
  width: 12px;
  height: 12px;
  top: 20px;
  right: 15px;
}

/* 4. 主体滚动区 */
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 0px 16px 20px;
}

/* 分组标题 */
.filter-group {
  margin-bottom: 24px;
}
.filter-group:last-child {
  margin-bottom: 0;
}
.group-title {
  font-size: 14px;
  font-weight: 600;
  color: #282828;
  margin-bottom: 12px;
}

/* 选项网格布局 */
.options-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px; /* 缩小间距以适应4列 */
}
/* 偏好区域如果需要4列，可以单独覆盖，这里保持3列通用 */

/* 选项按钮 */
.option-item {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 36px;
  background-color: #f5f7fa;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 13px;
  color: #282828;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}
.option-item:active {
  transform: scale(0.96);
}

/* 选项选中状态 */
.option-item.active {
  background-color: #e6f7ff;
  border-color: #00a0fa;
  color: #00a0fa;
}

/* 5. 底部按钮操作区 */
.drawer-footer {
  display: flex;
  padding: 16px 20px;
  flex-shrink: 0;
  gap: 12px;
}
.drawer-footer button {
  flex: 1;
  height: 44px;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  border: none;
}
.btn-reset {
  background-color: #fff;
  border: 1px solid #d9d9d9 !important;
  color: #666;
}
.btn-confirmadd {
  background-color: #00a0fa;
  color: #fff;
}
