/* ============================================================
   滚轮选择器 - 共用样式（修正版）
   ============================================================ */

.picker-mask {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: picker-fade-in 0.2s ease;
    overflow: hidden;
}

@keyframes picker-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes picker-slide-up {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.picker-panel {
    width: 100%;
    max-width: 480px;
    height: 70vh;           /* 固定高度，与 city-picker 策略一致 */
    max-height: 85vh;       /* 兜底，防止极端情况超出视口 */
    background: linear-gradient(180deg, #2A0838 0%, #1A0828 100%);
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    border: 1px solid rgba(255, 143, 177, 0.3);
    border-bottom: none;
    color: #F0E0F0;
    animation: picker-slide-up 0.25s ease;
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -8px 32px rgba(255, 80, 143, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;         /* 关键：flex 子项允许收缩到 0，否则 min-height: auto 会撑爆 */
}

.picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 143, 177, 0.2);
}
.picker-title {
    font-size: 16px;
    font-weight: 600;
    color: #FFB8D0;
}
.picker-cancel,
.picker-confirm {
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    -webkit-user-select: none;
}
.picker-cancel {
    color: #B0A0C0;
    background: rgba(255, 255, 255, 0.05);
}
.picker-cancel:active { background: rgba(255, 255, 255, 0.1); }
.picker-confirm {
    color: #fff;
    background: linear-gradient(135deg, #FF8FB1 0%, #9070D0 100%);
    box-shadow: 0 2px 8px rgba(255, 80, 143, 0.4);
}
.picker-confirm:active {
    transform: scale(0.96);
    background: linear-gradient(135deg, #E0508F 0%, #6A40A0 100%);
}

/* 农历/公历切换 */
.picker-calendar-tabs {
    display: flex;
    gap: 8px;
    padding: 10px 16px 0;
}
.picker-calendar-tab {
    flex: 1;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 143, 177, 0.2);
    border-radius: 16px;
    color: #B0A0C0;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    -webkit-user-select: none;
}
.picker-calendar-tab.active {
    background: linear-gradient(135deg, #FF8FB1 0%, #9070D0 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(255, 80, 143, 0.4);
}
.picker-lunar-info {
    padding: 8px 16px;
    font-size: 12px;
    color: #9070B0;
    text-align: center;
    min-height: 18px;
}

/* 滚轮主体：高度固定，每列等宽 */
.picker-body {
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    height: 200px;          /* 5 行 × 40px = 200px */
    min-height: 200px;
    max-height: 240px;      /* 防止撑爆 panel */
    position: relative;
    padding: 0 8px;
    overflow: hidden;
    flex-shrink: 0;
    flex-grow: 0;
}

/* 单列：作为视口，隐藏溢出 */
.picker-col {
    flex: 1;
    height: 100%;
    position: relative;
    overflow: hidden;
    -webkit-user-select: none;
    user-select: none;
}

/* 日期+时辰一体：五列更紧凑 */
.picker-body--datetime {
    padding: 0 2px;
}
.picker-body--datetime .picker-item {
    font-size: 13px;
}
.picker-body--datetime .picker-col[data-key="year"] {
    flex: 1.15;
}
.picker-body--datetime .picker-col[data-key="hour"],
.picker-body--datetime .picker-col[data-key="minute"] {
    flex: 0.95;
}

/* 中间选中框：固定不动 */
.picker-col-label {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 40px;
    margin-top: -20px;
    border-top: 1px solid rgba(255, 143, 177, 0.3);
    border-bottom: 1px solid rgba(255, 143, 177, 0.3);
    background: rgba(255, 143, 177, 0.06);
    pointer-events: none;
    z-index: 2;
}

/* 渐变蒙层：让顶部底部淡出 */
.picker-col-mask {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(180deg,
            #1A0828 0%,
            rgba(26, 8, 40, 0.6) 20%,
            rgba(26, 8, 40, 0) 40%,
            rgba(26, 8, 40, 0) 60%,
            rgba(26, 8, 40, 0.6) 80%,
            #1A0828 100%);
    pointer-events: none;
    z-index: 3;
}

/* scroller 内部容器：原生滚动容器，label/mask 在外层 picker-col 上固定不动 */
.picker-col-scroller {
    position: relative;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: y mandatory;
    touch-action: pan-y;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.picker-col-scroller::-webkit-scrollbar {
    display: none;
}

/* 单项 */
.picker-item {
    height: 40px;
    line-height: 40px;
    text-align: center;
    font-size: 15px;
    color: rgba(255, 184, 208, 0.4);
    cursor: pointer;
    scroll-snap-align: center;
}
.picker-item.active {
    font-size: 18px;
    font-weight: 600;
    color: #FFB8D0;
}
.picker-item.disabled {
    color: rgba(144, 112, 176, 0.3);
}
.picker-blank {
    pointer-events: none;
    scroll-snap-align: none;
}

/* 底部说明 */
.picker-footer {
    padding: 12px 16px 16px;
    text-align: center;
    font-size: 12px;
    color: #9070B0;
}
