/* --- 基础重置 --- */
* {
  box-sizing: border-box;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
    sans-serif;
  margin: 0;
  background: #f5f5f5;
}

/* --- 触发按钮演示 --- */
.btn-demo {
  display: block;
  width: 80%;
  max-width: 300px;
  margin: 100px auto 0;
  padding: 14px 0;
  background: #1890ff;
  color: #fff;
  text-align: center;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
}
.result-text {
  text-align: center;
  margin-top: 20px;
  color: #666;
}

/* ========================================================== */
/* --- 核心：底部抽屉选择器样式 --- */
/* ========================================================== */

/* 1. 遮罩层与容器 */
#pickerOverlay {
  display: none; /* 默认隐藏 */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99999;
}

/* 2. 半透明黑色背景 */
.picker-mask {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  /* 渐入动画 */
  opacity: 0;
  transition: opacity 0.3s ease;
}
/* 打开时的状态 */
#pickerOverlay.active .picker-mask {
  opacity: 1;
}

/* 3. 底部内容抽屉 */
.picker-wrapper {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #ffffff;
  border-radius: 16px 16px 0 0; /* 顶部圆角 */
  max-height: 55vh; /* 限制最大高度，防止超出屏幕 */

  /* 底部弹出动画的核心 */
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);

  display: flex;
  flex-direction: column;
}
/* 打开时的状态 */
#pickerOverlay.active .picker-wrapper {
  transform: translateY(0);
}

/* 4. 头部栏 */
.picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  border-bottom: 1px solid #f0f0f0;
  background: #fff;
  border-radius: 8px 8px 0 0;
  flex-shrink: 0; /* 防止头部被压缩 */
}
.picker-header .btn-clear {
  color: #1890ff;
  cursor: pointer;
  font-size: 15px;
}
.picker-header .title {
  color: #333;
  font-size: 16px;
  font-weight: 500;
}
.picker-header .btn-confirm {
  color: #1890ff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
}
.picker-header span:active {
  opacity: 0.7;
}

/* 5. 列表滚动区 */
.picker-list-box {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* iOS 平滑滚动 */
  padding-bottom: env(safe-area-inset-bottom); /* 适配刘海屏底部 */
}

/* 6. 列表项 */
.picker-item {
  padding: 7px 20px;
  color: #333;
  font-size: 15px;
  cursor: pointer;
}
.picker-item:last-child {
  border-bottom: none;
}
.picker-item:active {
  background: #f5f8ff;
}

/* 选中高亮样式 (匹配图片) */
.picker-item.active {
  color: #1890ff;
  background: #f0f7ff;
}