/* 工厂工作台日期范围选择器 */
#dateRangeMask { background: rgba(15, 23, 42, .08); }
#dateRangeMask.show { display: block; }
#dateRangeMask .date-range-modal {
  --range-bg: #fff; --range-text: #263244; --range-border: #e4e9f0;
  --range-muted: #8993a3; --range-blue: #1677ff; --range-soft: #e8f1ff;
  position: fixed; width: min(900px, calc(100vw - 24px)); max-height: calc(100vh - 24px);
  overflow: auto; padding: 0; border: 1px solid var(--range-border); border-radius: 10px;
  color: var(--range-text); background: var(--range-bg); box-shadow: 0 14px 45px rgba(25, 45, 75, .18);
}
html[data-theme="dark"] #dateRangeMask .date-range-modal {
  --range-bg: #152237; --range-text: #e5edf9; --range-border: #2b3b52;
  --range-muted: #8fa0b4; --range-soft: #223e67;
}
#dateRangeMask .range-heading { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--range-border); }
#dateRangeMask .range-heading h3 { margin: 0; font-size: 14px; }
#dateRangeMask button { cursor: pointer; color: var(--range-text); background: transparent; border-color: var(--range-border); box-shadow: none; }
#dateRangeMask button:focus-visible, #dateRangeMask input:focus-visible { outline: 2px solid var(--range-blue); outline-offset: 2px; }
#dateRangeMask .range-close { width: 28px; height: 28px; padding: 0; border: 0; font-size: 22px; }
#dateRangeMask .range-body { display: grid; grid-template-columns: 115px minmax(0, 1fr); }
#dateRangeMask .range-shortcuts { display: flex; flex-direction: column; gap: 5px; padding: 14px 10px; border-right: 1px solid var(--range-border); }
#dateRangeMask .range-shortcuts button { padding: 9px 8px; text-align: left; border: 0; color: var(--range-blue); font-size: 13px; }
#dateRangeMask .range-shortcuts button:hover { background: var(--range-soft); }
#dateRangeMask .range-main { min-width: 0; }
#dateRangeMask .range-inputs { display: grid; grid-template-columns: 1fr 20px 1fr; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--range-border); align-items: center; }
#dateRangeMask .range-endpoint { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
#dateRangeMask .range-endpoint > span { width: 100%; color: var(--range-muted); font-size: 11px; }
#dateRangeMask .range-inputs input { flex: 1; min-width: 0; width: 100px; height: 36px; padding: 6px 8px; border-color: var(--range-border); border-radius: 6px; background: var(--range-bg); color: var(--range-text); font: inherit; font-size: 13px; color-scheme: light; }
html[data-theme="dark"] #dateRangeMask .range-inputs input { color-scheme: dark; }
#dateRangeMask .range-inputs input[type="time"] { flex: .8; width: 95px; }
#dateRangeMask.is-date-only input[type="time"] { display: none; }
#dateRangeMask .range-arrow { color: var(--range-muted); text-align: center; padding-top: 16px; }
#dateRangeMask .range-calendars { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
#dateRangeMask .range-calendar { padding: 12px 14px 16px; min-width: 0; }
#dateRangeMask .range-calendar + .range-calendar { border-left: 1px solid var(--range-border); }
#dateRangeMask .range-month-heading { display: flex; align-items: center; justify-content: space-between; gap: 5px; height: 34px; margin-bottom: 12px; }
#dateRangeMask .range-month-heading strong { font-size: 15px; font-weight: 600; }
#dateRangeMask .range-month-nav { display: flex; gap: 2px; width: 56px; }
#dateRangeMask .range-month-nav button { padding: 0; width: 27px; height: 27px; border: 0; font-size: 20px; color: var(--range-muted); }
#dateRangeMask .range-month-nav button:hover { background: var(--range-soft); color: var(--range-blue); }
#dateRangeMask .range-week, #dateRangeMask .range-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center; }
#dateRangeMask .range-week { color: var(--range-muted); font-size: 12px; margin-bottom: 6px; }
#dateRangeMask .range-week span { padding: 7px 0; }
#dateRangeMask .range-days { row-gap: 5px; }
#dateRangeMask .range-day { height: 34px; padding: 0; border: 0; border-radius: 0; font-size: 13px; position: relative; }
#dateRangeMask .range-day.is-outside { color: var(--range-muted); opacity: .58; }
#dateRangeMask .range-day.is-today::after { content: ''; width: 4px; height: 4px; border-radius: 50%; position: absolute; bottom: 3px; left: calc(50% - 2px); background: var(--range-blue); }
#dateRangeMask .range-day.is-in-range { background: var(--range-soft); opacity: 1; }
#dateRangeMask .range-day.is-start, #dateRangeMask .range-day.is-end { background: var(--range-blue); color: #fff; border-radius: 6px; opacity: 1; }
#dateRangeMask .range-day.is-start::after, #dateRangeMask .range-day.is-end::after { background: #fff; }
#dateRangeMask .range-day:hover { box-shadow: inset 0 0 0 1px var(--range-blue); border-radius: 6px; }
#dateRangeMask .range-footer { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--range-border); }
#dateRangeMask .range-feedback { margin-right: auto; font-size: 12px; color: var(--range-muted); }
#dateRangeMask .range-feedback.is-error { color: #dc3545; }
#dateRangeMask .range-footer button { padding: 7px 16px; font-size: 13px; }
#dateRangeMask #dateRangeApply { background: var(--range-blue); color: #fff; border-color: var(--range-blue); }
#dateRangeMask #dateRangeApply:disabled { opacity: .45; cursor: default; }
.factory-date-filter-wrap .date-filter-btn > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) {
  #dateRangeMask .range-body { grid-template-columns: 1fr; }
  #dateRangeMask .range-shortcuts { flex-direction: row; flex-wrap: wrap; gap: 0; padding: 6px 8px; border-right: 0; border-bottom: 1px solid var(--range-border); }
  #dateRangeMask .range-shortcuts button { padding: 7px 8px; }
  #dateRangeMask .range-inputs { padding: 10px; gap: 4px; }
  #dateRangeMask .range-endpoint { flex-direction: column; align-items: stretch; }
  #dateRangeMask .range-inputs input { flex: none; width: 100%; }
  #dateRangeMask .range-inputs input[type="time"] { flex: none; width: 100%; }
  #dateRangeMask .range-calendar { padding: 10px 6px; }
  #dateRangeMask .range-month-heading strong { font-size: 12px; }
  #dateRangeMask .range-month-nav { width: 35px; gap: 0; }
  #dateRangeMask .range-month-nav button { width: 17px; font-size: 18px; }
  #dateRangeMask .range-month-heading { gap: 1px; }
  #dateRangeMask .range-day { height: 30px; font-size: 12px; }
  #dateRangeMask .range-footer { padding: 10px; }
  #dateRangeMask .range-feedback { max-width: 55%; }
}
