/* 排盘时间弹窗 — 对齐 setup 灰白黑风格，紧凑适配手机 */
.btp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 360;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 10px;
  box-sizing: border-box;
}
.btp-overlay.btp-active {
  display: flex;
}
.btp-modal {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(300px, 100%);
  max-height: min(88vh, 560px);
  overflow: hidden;
  padding: 10px 10px 12px;
  color: #111;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  box-sizing: border-box;
  font-family: "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
}
.btp-header {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 8px;
  min-height: 28px;
  flex-shrink: 0;
}
.btp-close {
  position: absolute;
  right: -2px;
  top: 50%;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 0;
  border-radius: 50%;
  background: #f1f1f1;
  line-height: 0;
}
.btp-close img {
  width: 10px;
  height: 10px;
  display: block;
  opacity: 0.65;
}
.btp-tabs {
  display: inline-flex;
  align-items: center;
  gap: 0;
  color: #888;
  font-size: 12px;
  border-radius: 999px;
  background: #f1f1f1;
  padding: 2px;
}
.btp-tab {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 48px;
  padding: 5px 11px;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
  border-radius: 999px;
}
.btp-tab.btp-selected {
  color: #111;
  font-weight: 700;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.btp-today {
  position: absolute;
  left: -2px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  justify-content: center;
  align-items: center;
  width: 26px;
  height: 26px;
  color: #555;
  font-size: 11px;
  border-radius: 50%;
  background: #f1f1f1;
  border: 0;
  cursor: pointer;
  user-select: none;
  padding: 0;
}
.btp-search {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  width: 100%;
  position: relative;
  flex-shrink: 0;
}
.btp-search input {
  height: 30px;
  padding: 4px 58px 4px 10px;
  font-size: 12px;
  border-radius: 999px;
  width: 100%;
  border: 1px solid #e0e0e0;
  background: #fff;
  outline: none;
  font-family: inherit;
  color: #222;
  box-sizing: border-box;
}
.btp-search input:focus {
  border-color: #bbb;
}
.btp-search input::placeholder {
  color: #aaa;
  font-size: 11px;
}
.btp-go {
  position: absolute;
  right: 2px;
  z-index: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 48px;
  height: 24px;
  color: #fff;
  border-radius: 999px;
  background: #111;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  border: 0;
  transition: background 0.18s, opacity 0.18s;
  font-family: inherit;
  pointer-events: auto;
  opacity: 0.45;
}
.btp-go.btp-on {
  background: #111;
  opacity: 1;
}
.btp-picker-area {
  display: flex;
  flex-direction: column;
  flex: 0 1 auto;
  min-height: 0;
  position: relative;
}
.btp-labels {
  display: flex;
  justify-content: space-around;
  align-items: center;
  height: 26px;
  font-size: 12px;
  color: #888;
  border-top: 1px solid #f0f0f0;
  flex-shrink: 0;
}
/* 仅公历/农历滚轮收成 3 行；四柱面板单独自适应高度 */
.btp-panel {
  overflow: hidden;
  position: relative;
}
#btpSolar,
#btpLunar {
  height: 96px;
}
#btpSizhu {
  height: auto;
  min-height: 138px;
  overflow: visible;
}
.btp-panel.btp-off {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px !important;
  min-height: 0 !important;
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}
.btp-van-picker {
  position: relative;
  background: #fff;
  user-select: none;
}
.btp-columns {
  position: relative;
  display: flex;
  height: 160px;
}
.btp-columns::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 4px;
  right: 4px;
  transform: translateY(-50%);
  pointer-events: none;
  height: 32px;
  border-radius: 6px;
  background: #f5f5f5;
  z-index: 0;
}
.btp-col {
  flex: 1 1 0%;
  overflow: hidden;
  font-size: 12px;
  position: relative;
  z-index: 1;
  touch-action: none;
  min-width: 0;
}
.btp-col-wrap {
  transition-timing-function: cubic-bezier(0.23, 1, 0.68, 1);
  will-change: transform;
  width: 100%;
}
.btp-col-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
  color: #999;
  height: 32px;
  font-size: 12px;
  font-weight: 400;
  list-style: none;
  width: 100%;
}
.btp-col-item.btp-selected {
  font-size: 14px !important;
  font-weight: 500;
  color: #111;
}
.btp-ellipsis {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.btp-mask {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: linear-gradient(#fff, rgba(255, 255, 255, 0.72)),
    linear-gradient(0deg, #fff, rgba(255, 255, 255, 0.72));
  background-repeat: no-repeat;
  background-position: center top, center bottom;
  background-size: 100% 32px;
  pointer-events: none;
}
.btp-frame {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  z-index: 2;
  transform: translateY(-50%);
  height: 32px;
  pointer-events: none;
}
.btp-sizhu-body {
  padding: 10px 4px 2px;
}
.btp-sizhu-grid {
  display: flex;
  justify-content: space-around;
  margin-bottom: 6px;
}
.btp-sizhu-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.btp-sizhu-col .btp-label {
  font-size: 11px;
  color: #888;
}
.btp-gz-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.btp-ball {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  text-align: center;
  border: 0;
  border-radius: 50%;
  background: #c0c0c0;
  cursor: pointer;
  user-select: none;
  transition: background 0.18s;
  box-sizing: border-box;
  padding: 0;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.btp-ball.btp-on {
  background: #111;
}
.btp-ball:active {
  opacity: 0.9;
}
.btp-sizhu-tip {
  font-size: 11px;
  text-align: center;
  margin: 2px 0 0;
  color: #999;
}
.btp-match-wrap {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.28);
  border-radius: inherit;
  align-items: center;
  justify-content: center;
  padding: 10px;
  box-sizing: border-box;
}
.btp-match-wrap.btp-on {
  display: flex;
}
.btp-match-panel {
  width: 100%;
  max-height: 100%;
  background: #fff;
  border-radius: 12px;
  padding: 10px 8px 8px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}
.btp-match-title {
  font-size: 14px;
  color: #111;
  text-align: center;
  font-weight: 700;
}
.btp-match-sub {
  font-size: 11px;
  color: #888;
  text-align: center;
  line-height: 1.4;
}
.btp-match-list {
  overflow: auto;
  max-height: 180px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  -webkit-overflow-scrolling: touch;
}
.btp-match-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  background: #fafafa;
  padding: 7px 9px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.btp-match-item:hover,
.btp-match-item:active {
  border-color: #bbb;
  background: #f5f5f5;
}
.btp-match-date {
  font-size: 12px;
  color: #111;
  font-weight: 500;
}
.btp-match-gz {
  font-size: 11px;
  color: #666;
  letter-spacing: 0.04em;
}
.btp-match-empty {
  text-align: center;
  color: #999;
  font-size: 12px;
  padding: 18px 8px;
  line-height: 1.5;
}
.btp-match-cancel {
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: #f1f1f1;
  color: #555;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.btp-pop-wrap {
  position: absolute;
  top: 78px;
  left: 8px;
  right: 8px;
  display: none;
  z-index: 10;
}
.btp-pop-wrap.btp-on {
  display: block;
}
.btp-pop-row {
  display: flex;
  flex-direction: column;
  color: #999;
  font-size: 16px;
  max-width: 100%;
  margin: 0 auto;
  padding: 10px 8px 12px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  position: relative;
  box-sizing: border-box;
  gap: 2px;
}
.btp-pop-tip {
  width: 100%;
  font-size: 11px;
  color: #999;
  text-align: center;
  line-height: 1.4;
  margin-bottom: 2px;
}
.btp-pop-sec-label {
  width: 100%;
  font-size: 11px;
  color: #888;
  padding: 2px 4px 0;
}
.btp-pop-sec {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
}
.btp-pop-cell {
  width: 20%;
  padding: 6px 0;
  text-align: center;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
  box-sizing: border-box;
}
.btp-pop-cell:hover,
.btp-pop-cell.btp-on {
  color: #111;
  font-weight: 600;
}
.btp-pillars-live {
  text-align: center;
  font-size: 11px;
  font-weight: 400;
  color: #666;
  letter-spacing: 0.04em;
  padding: 6px 6px 4px;
  min-height: 16px;
  line-height: 1.3;
  flex-shrink: 0;
}
.btp-confirm {
  width: 100%;
  height: 38px;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #111;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  border-radius: 999px;
  font-family: inherit;
  cursor: pointer;
  user-select: none;
  border: 0;
  transition: opacity 0.18s;
  flex-shrink: 0;
}
.btp-confirm:hover {
  opacity: 0.9;
}

/* 八字/紫微时间行：整行表单项 */
.setup-section.btp-birth-time-section {
  display: block;
  width: auto;
}
.btp-birth-time-section .btp-trigger {
  width: 100%;
}

/* 页面触发条：左标签右日期，与 setup-label / 表单行一致 */
.btp-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  min-height: 36px;
  padding: 4px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #222;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
}
.btp-trigger:hover,
.btp-trigger:active {
  border: 0;
  box-shadow: none;
  background: transparent;
}
.btp-trigger-label {
  flex-shrink: 0;
  color: #888;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}
.btp-trigger-right {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.btp-trigger-body {
  display: none;
}
.btp-trigger-main {
  min-width: 0;
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 0.01em;
  color: #222;
  line-height: 1.4;
  text-align: right;
}
.btp-trigger-pillars {
  display: none !important;
}
.btp-trigger-mode {
  flex-shrink: 0;
  color: #aaa;
  font-size: 11px;
  font-weight: 400;
}
.btp-trigger-arrow {
  flex-shrink: 0;
  color: #ccc;
  font-size: 15px;
  font-weight: 300;
  line-height: 1;
  margin-left: 2px;
}

@media (max-width: 480px) {
  .btp-modal {
    width: min(300px, 90vw);
    max-height: 86vh;
  }
}

@media (max-height: 640px) {
  .btp-modal {
    max-height: 90vh;
    padding: 8px 8px 10px;
  }
  .btp-match-list {
    max-height: 140px;
  }
  .btp-search {
    margin-bottom: 6px;
  }
  .btp-pillars-live {
    padding: 4px 4px 2px;
  }
}
