/* ========== 日期时间范围选择器公共组件（日期+时分秒）：DatetimeRangePicker，dtrp- 前缀 ========== */
/* 由 index.html 全局加载，类名专属前缀不污染其他页面；与 DateRangePicker（drp-）独立实现、互不依赖 */

/* 组件根容器：作为浮层定位锚点 */
.dtrp-root {
    position: relative;
}

/* 触发框 */
.dtrp-field {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 8px 12px;
    border: 1px solid #d5dce6;
    border-radius: 4px;
    background: #fff;
    font-size: 13px;
    color: var(--text-primary, #333);
    cursor: pointer;
    user-select: none;
    box-sizing: border-box;
}

.dtrp-field:hover {
    border-color: var(--primary-color, #007bff);
}

.dtrp-field > i {
    display: inline-block;
    color: #98a2b3;
    font-size: 13px;
}

.dtrp-field > i.fa-caret-down {
    transition: transform .2s;
}

.dtrp-field.dtrp-open > i.fa-caret-down {
    transform: rotate(180deg);
}

.dtrp-field-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 面板展开/收起 0.3s 过渡（与方案8一致：class 驱动 opacity/translateY transition） */

.dtrp-pop {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 990; /* 悬浮于页面内容之上，不占据文档流 */
}

.dtrp-panel {
    position: relative;
    width: 600px;
    max-width: calc(100vw - 40px);
    margin: 0;
    padding: 16px 18px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(30, 41, 59, .06);
    box-sizing: border-box;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity .3s, transform .3s;
}

.dtrp-pop-in .dtrp-panel {
    opacity: 1;
    transform: translateY(0);
}

/* 月份导航头 */
.dtrp-head {
    display: flex;
    margin-bottom: 10px;
}

.dtrp-head-half {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.dtrp-head-title {
    flex: 1;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #333);
}

.dtrp-nav {
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    background: #fff;
    color: #6b7686;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    user-select: none;
}

.dtrp-nav:hover {
    color: var(--primary-color, #007bff);
    border-color: var(--primary-color, #007bff);
}

/* 双月日历 */
.dtrp-grids {
    display: flex;
}

.dtrp-grid-half {
    flex: 1;
    min-width: 0;
    padding: 0 6px;
}

.dtrp-grid-half + .dtrp-grid-half {
    border-left: 1px solid #f0f2f5;
}

.dtrp-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 2px;
}

.dtrp-week span {
    text-align: center;
    font-size: 11px;
    color: #a0a8b5;
    padding: 4px 0;
}

.dtrp-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px 0;
}

.dtrp-day {
    position: relative;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12.5px;
    color: var(--text-primary, #333);
    border-radius: 4px;
    cursor: pointer;
    user-select: none;
}

.dtrp-day:hover {
    background: #eaf2ff;
}

.dtrp-day.dtrp-muted {
    color: #c3cad4;
}

.dtrp-day.dtrp-today::after {
    content: '';
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--primary-color, #007bff);
}

.dtrp-day.dtrp-mid {
    background: var(--primary-light, rgba(0, 123, 255, 0.08));
    border-radius: 0;
    color: var(--primary-color, #007bff);
}

.dtrp-day.dtrp-sel {
    background: var(--primary-color, #007bff);
    color: #fff;
    font-weight: 600;
}

.dtrp-day.dtrp-sel.dtrp-today::after {
    background: #fff;
}

/* 底栏：日期 + 可点击时间 */
.dtrp-footer {
    display: flex;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eef1f5;
}

.dtrp-rangeview {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-primary, #333);
    min-width: 0;
}

.dtrp-rangeview i {
    color: #98a2b3;
    font-size: 13px;
}

.dtrp-date {
    font-variant-numeric: tabular-nums;
}

.dtrp-time {
    padding: 2px 2px;
    border-radius: 4px;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}

.dtrp-time:hover {
    background: #eaf2ff;
    color: var(--primary-color, #007bff);
}

.dtrp-time.dtrp-active {
    background: var(--primary-color, #007bff);
    color: #fff;
}

.dtrp-sep {
    color: #98a2b3;
    margin: 0 2px;
}

.dtrp-btn-cancel {
    flex-shrink: 0;
    margin-left: auto;
    padding: 6px 18px;
    border: 1px solid #d8dee9;
    border-radius: 4px;
    background: #fff;
    color: #64748b;
    font-size: 13px;
    cursor: pointer;
    transition: border-color .12s, color .12s;
}

.dtrp-btn-cancel:hover {
    border-color: var(--primary-color, #007bff);
    color: var(--primary-color, #007bff);
}

.dtrp-btn-ok {
    flex-shrink: 0;
    margin-left: 12px;
    padding: 6px 18px;
    border: 1px solid var(--primary-color, #007bff);
    border-radius: 4px;
    background: var(--primary-color, #007bff);
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}

.dtrp-btn-ok:hover {
    background: var(--primary-dark, #0056b3);
    border-color: var(--primary-dark, #0056b3);
}

/* 时分秒滚轮弹窗：位置由 JS 动态锚定到所点击的时间显示区上方 */
.dtrp-timepanel {
    position: absolute;
    z-index: 30;
    width: 160px;
    height: 200px;
    box-sizing: border-box;
    padding: 8px 4px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(30, 41, 59, .18);
}

.dtrp-timepanel-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    border-top: 1px solid #e2e8f0;
    gap: 8px;
    margin-top: 0;
}

/* 时间滚轮弹窗内的取消/确定为文字按钮（限定容器，避免覆盖底栏空心取消按钮） */
.dtrp-timepanel-actions .dtrp-btn-cancel,
.dtrp-timepanel-actions .dtrp-btn-timeok {
    border: none;
    background: none;
    font-size: 13px;
    cursor: pointer;
    padding: 2px 4px;
}

.dtrp-timepanel-actions .dtrp-btn-cancel {
    color: #8a94a6;
}

.dtrp-timepanel-actions .dtrp-btn-cancel:hover {
    color: #5a6572;
}

.dtrp-btn-timeok {
    color: var(--primary-color, #007bff);
    font-weight: 600;
}

.dtrp-btn-timeok:hover {
    color: var(--primary-dark, #0056b3);
}

/* 时/分/秒 三列滚轮（160x200 弹窗内） */
.dtrp-wheel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 8px;
    background: #fff;
    user-select: none;
}

.dtrp-col {
    width: 30px;
    height: 164px;
    overflow: hidden;
    touch-action: none;
    cursor: grab;
}

.dtrp-col:active {
    cursor: grabbing;
}

.dtrp-list {
    transition: transform .12s ease-out;
}

.dtrp-item {
    height: 34px;
    line-height: 34px;
    text-align: center;
    font-size: 13px;
    color: #b6bfcc;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
}

.dtrp-item:hover {
    background: rgba(0, 123, 255, .04);
    border-radius: 4px;
    color: var(--primary-color, #007bff);
}

.dtrp-item.dtrp-near {
    color: #5a6572;
}

.dtrp-item.dtrp-cur {
    color: var(--text-primary, #333);
    font-size: 13px;
    font-weight: 600;
}

.dtrp-colon {
    font-size: 13px;
    font-weight: 600;
    color: #98a2b3;
    padding-bottom: 4px;
}

.dtrp-highlight {
    position: absolute;
    left: 8px;
    right: 8px;
    top: 50%;
    height: 32px;
    transform: translateY(-50%);
    border: 1px solid #e8edf4;
    background: rgba(0, 123, 255, .04);
    border-radius: 4px;
    pointer-events: none;
}
