/* =========================================================================
  自定义日期时间选择器 — 由 Shadow DOM 提供原生 CSS 隔离
  左右布局：左侧日历 + 右侧时分列表
  无需 !important，无需 all: initial，Shadow DOM 自动阻止外部 CSS 污染
  ========================================================================= */

.dt-picker {
    --primary-blue: #3b7cff;
    --primary-blue-dark: #2563eb;
    --weekend-color: #fa8c16;
    --text-muted-light: #bfbfbf;

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 0.85rem;
    color: #333;
    line-height: normal;
    box-sizing: border-box;

    background: #fff;
    border-radius: 6px;
    border: 1px solid #e8e8e8;
    width: 100%;
    overflow: hidden;
}

.dt-picker *,
.dt-picker *::before,
.dt-picker *::after {
    box-sizing: border-box;
}

/* ---------- 头部年月选择 ---------- */
.dt-picker .dt-header {
    padding: 8px 10px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
    line-height: normal;
    background: transparent;
}

.dt-picker .header-center {
    display: flex;
    align-items: center;
    gap: 4px;
}

.dt-picker .dt-header select {
    border: none;
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
    background: transparent;
    background-image: none;
    cursor: pointer;
    outline: none;
    padding: 0 12px 0 0;
    width: auto;
    min-width: 0;
    height: auto;
    display: inline-block;
    appearance: auto;
    -webkit-appearance: auto;
    -moz-appearance: auto;
    line-height: normal;
    margin: 0;
    box-shadow: none;
}

/* ---------- 翻页按钮 ---------- */
.dt-picker .btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #666;
    padding: 4px 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
    line-height: 1;
    min-width: 0;
    min-height: 0;
    margin: 0;
    box-shadow: none;
    text-transform: none;
    letter-spacing: normal;
    word-spacing: normal;
    font-size: 1rem;
}
.dt-picker .btn-icon:hover {
    background-color: #f0f0f0;
    color: var(--primary-blue);
}
.dt-picker .btn-icon svg {
    width: 14px;
    height: 14px;
    display: block;
    fill: currentColor;
}

/* ---------- 主体布局 ---------- */
.dt-picker .dt-body {
    display: flex;
    min-height: 240px;
}

/* ---------- 左侧日历 ---------- */
.dt-picker .calendar-section {
    flex: 1.5;
    padding: 5px;
    border-right: 1px solid #f0f0f0;
}

.dt-picker .calendar-table {
    width: 100%;
    text-align: center;
    border-collapse: separate;
    border-spacing: 0;
    margin: 0;
    background: transparent;
}
.dt-picker .calendar-table th {
    color: #8c8c8c;
    font-weight: normal;
    font-size: 0.75rem;
    padding: 4px 0;
    border: none;
    background: transparent;
    text-align: center;
    line-height: normal;
}
.dt-picker .calendar-table th.weekend {
    color: var(--weekend-color);
}
.dt-picker .calendar-table td {
    padding: 2px;
    border: none;
    cursor: pointer;
    position: relative;
    height: 34px;
    vertical-align: middle;
    text-align: center;
    background: transparent;
    line-height: normal;
}
.dt-picker .calendar-table td:hover:not(.disabled) {
    background-color: #f5f5f5;
    border-radius: 4px;
}

.dt-picker .date-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
}
.dt-picker .date-main {
    font-size: 0.95rem;
    color: #333;
    line-height: 1.1;
}
.dt-picker .date-sub {
    font-size: 0.65rem;
    color: #8c8c8c;
    margin-top: 1px;
}

/* ---------- 节假日徽标（同左侧日历规则） ---------- */
.dt-picker .calendar-table td .day-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.55rem;
    font-weight: 700;
    line-height: 1;
}
.dt-picker .calendar-table td .day-rest-badge {
    color: #22c55e;
}
.dt-picker .calendar-table td .day-work-badge {
    color: #ef4444;
}
.dt-picker .today-highlight .day-rest-badge,
.dt-picker .today-highlight .day-work-badge {
    color: #fff;
}

/* ---------- 底部"已约N人"（6个月后 之后显示，点击查看已约患者） ---------- */
.dt-picker .quick-actions .booked-info {
    color: #8c8c8c;
    cursor: default;
    border-left: 1px solid #e0e0e0;
    padding-left: 10px;
}
.dt-picker .quick-actions .booked-info.has-booked {
    color: #fa541c;
    font-weight: 700;
    cursor: pointer;
}
.dt-picker .quick-actions .booked-info.has-booked:hover {
    text-decoration: underline;
}

/* ---------- 日历状态 ---------- */
.dt-picker .other-month .date-main {
    color: var(--text-muted-light);
}
.dt-picker .other-month .date-sub {
    color: #d9d9d9;
}
.dt-picker .weekend .date-main {
    color: var(--weekend-color);
}
.dt-picker .weekend.other-month .date-main {
    color: #ffd591;
}

.dt-picker .disabled {
    cursor: not-allowed !important;
}
.dt-picker .disabled .date-main,
.dt-picker .disabled .date-sub {
    color: #e8e8e8 !important;
}
.dt-picker .disabled:hover {
    background-color: transparent !important;
}

.dt-picker .selected .date-cell {
    background-color: var(--primary-blue);
    border-radius: 4px;
    color: #fff;
}
.dt-picker .selected .date-main,
.dt-picker .selected .date-sub {
    color: #fff;
}

.dt-picker .festival .date-sub {
    color: var(--primary-blue);
}

.dt-picker .today-highlight .date-cell {
    border: 1px solid var(--primary-blue);
    border-radius: 4px;
}

/* ---------- 右侧时间 ---------- */
.dt-picker .time-section {
    flex: 1;
    display: flex;
    padding: 5px;
    background: #fff;
}
.dt-picker .time-col {
    flex: 1;
    overflow-y: auto;
    height: 210px;
    text-align: center;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.dt-picker .time-col::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.dt-picker .time-item {
    padding: 4px 0;
    cursor: pointer;
    color: #333;
    font-size: 0.85rem;
    border-radius: 4px;
    margin: 1px 5px;
    line-height: normal;
    background: transparent;
}
.dt-picker .time-item:hover {
    background-color: #f5f5f5;
}
.dt-picker .time-item.active {
    background-color: #d0e8ff;
    color: var(--primary-blue);
    font-weight: 600;
    border-left: 3px solid var(--primary-blue);
}

.dt-picker .time-item.disabled {
    display: none !important;
}

/* ---------- 底部栏 ---------- */
.dt-picker .dt-footer {
    padding: 8px 15px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
}

.dt-picker .quick-actions span {
    color: var(--primary-blue);
    cursor: pointer;
    margin-right: 10px;
    font-size: 0.85rem;
    line-height: normal;
    background: transparent;
    border: none;
    padding: 0;
    text-decoration: none;
}
.dt-picker .quick-actions span:hover {
    text-decoration: underline;
}

.dt-picker .btn-confirm {
    background-color: var(--primary-blue);
    color: #fff;
    border: none;
    padding: 4px 16px;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    line-height: normal;
    display: inline-block;
    min-width: 0;
    min-height: 0;
    margin: 0;
    box-shadow: none;
    text-transform: none;
    letter-spacing: normal;
    word-spacing: normal;
    font-weight: normal;
}
.dt-picker .btn-confirm:hover {
    background-color: var(--primary-blue-dark);
    color: #fff;
}
