/* ---------- 通用滚轮选择器（picker.js） ---------- */

.wp-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--fg);
  font-family: inherit;
  font-size: 16px;
  text-align: left;
  cursor: pointer;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.wp-field:hover { border-color: #C9D8D1; }
.wp-field:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(4, 120, 87, .16);
}
.wp-field__text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wp-field__text.is-empty { color: #98A1B0; }
.wp-field > svg {
  flex: none;
  width: 16px;
  height: 16px;
  color: #98A1B0;
  transform: rotate(90deg);
}

.wp {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.wp[hidden] { display: none; }

.wp__mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .38);
  opacity: 0;
  transition: opacity .22s var(--ease);
}

.wp__sheet {
  position: relative;
  width: 100%;
  max-width: 400px;
  margin: 0 8px 8px;
  padding: 8px 16px calc(14px + env(safe-area-inset-bottom));
  border-radius: 18px;
  background: #FFFFFF;
  box-shadow: 0 -10px 44px rgba(15, 23, 42, .22);
  transform: translateY(18px);
  opacity: 0;
  transition: transform .26s var(--ease), opacity .2s var(--ease);
}

.wp.is-open .wp__mask { opacity: 1; }
.wp.is-open .wp__sheet { transform: none; opacity: 1; }

.wp__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0 8px;
}
.wp__title { font-size: 14px; font-weight: 600; letter-spacing: .02em; }
.wp__btn {
  border: 0;
  background: none;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--muted-fg);
  cursor: pointer;
}
.wp__btn:hover { background: var(--muted); }
.wp__btn--ok { color: var(--accent); font-weight: 600; }

.wp__wheel {
  position: relative;
  height: 200px;
  overflow: hidden;
}
.wp__wheel::before,
.wp__wheel::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 54px;
  z-index: 2;
  pointer-events: none;
}
.wp__wheel::before { top: 0; background: linear-gradient(#FFFFFF, rgba(255, 255, 255, 0)); }
.wp__wheel::after { bottom: 0; background: linear-gradient(rgba(255, 255, 255, 0), #FFFFFF); }

.wp__band {
  position: absolute;
  left: 0;
  right: 0;
  top: 80px;
  height: 40px;
  border-radius: 10px;
  background: #F2F9F5;
  pointer-events: none;
}

.wp__cols {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: stretch;
  height: 200px;
}
.wp__col {
  flex: 1 1 0;
  min-width: 0;
}
.wp__cols.is-single .wp__col {
  flex: 0 1 320px;
  margin: 0 auto;
}
.wp__colon {
  position: relative;
  z-index: 2;
  align-self: center;
  padding: 0 1px;
  font-family: var(--mono);
  font-size: 19px;
  font-weight: 700;
  color: #0B2B22;
}

.wp__list {
  position: relative;
  z-index: 1;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
}
.wp__list::-webkit-scrollbar { display: none; }
.wp__list:focus { outline: none; }

.wp__item {
  height: 40px;
  line-height: 40px;
  scroll-snap-align: center;
  text-align: center;
  font-family: var(--mono);
  font-size: 15px;
  color: #98A1B0;
  transition: color .15s var(--ease), font-size .15s var(--ease);
  user-select: none;
}
/* 首尾留出 (200 - 40) / 2，让第一项和最后一项也能滚到中间的选中带 */
.wp__item:first-child { margin-top: 80px; }
.wp__item:last-child { margin-bottom: 80px; }

.wp__item.is-active {
  color: var(--fg);
  font-size: 18px;
  font-weight: 600;
}

/* 时间模式：滚盘上方的直接输入行 */
.wp__direct {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 6px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--muted);
}
.wp__direct[hidden] { display: none; }
.wp__direct-label {
  flex: none;
  font-size: 13px;
  color: var(--muted-fg);
  white-space: nowrap;
}
.wp__direct-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #FFFFFF;
  color: var(--fg);
  font-family: var(--mono);
  font-size: 17px;
  letter-spacing: .06em;
  text-align: center;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.wp__direct-input::placeholder { color: #B6BEC9; letter-spacing: .02em; }
.wp__direct-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(4, 120, 87, .16);
}
.wp__direct-unit {
  flex: none;
  font-size: 12px;
  color: var(--muted-fg);
  white-space: nowrap;
}

.wp__hint {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted-fg);
  text-align: center;
}
.wp__hint[hidden] { display: none; }

html.wp-lock { overflow: hidden; }

@media (min-width: 640px) {
  .wp { align-items: center; }
  .wp__sheet {
    max-width: 380px;
    margin: 0;
    padding-bottom: 14px;
    border-radius: 18px;
    transform: translateY(10px) scale(.98);
  }
  .wp.is-open .wp__sheet { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .wp__mask,
  .wp__sheet,
  .wp__item { transition: none; }
}
