/* 月度模块独立样式；不依赖 Tailwind 编译，不修改全站主题与导航。 */
.xm-root, .xm-tabs, .xm-overlay {
  --xm-bg: #ffffff; --xm-soft: #f6f8fc; --xm-line: #dce4ef; --xm-ink: #172b48;
  --xm-muted: #5f7088; --xm-blue: #245acc; --xm-purple: #7847bb;
  --xm-amber: #995300; --xm-green: #117763; --xm-red: #ab3548;
  color: var(--xm-ink); font-family: inherit; font-size: 14px; line-height: 1.55;
}
.dark .xm-root, .dark .xm-tabs, .dark .xm-overlay {
  --xm-bg: #172237; --xm-soft: #1d2c43; --xm-line: #364860; --xm-ink: #edf3ff;
  --xm-muted: #b6c6dc; --xm-blue: #91b8ff; --xm-purple: #ceacff;
  --xm-amber: #ffd090; --xm-green: #82d8be; --xm-red: #ffabb9;
}
.xm-root { min-width: 0; max-width: 100%; padding: 24px; border: 1px solid var(--xm-line); border-radius: 20px; background: var(--xm-soft); }
.xm-root *, .xm-tabs *, .xm-overlay * { box-sizing: border-box; }
.xm-root h1, .xm-root h2, .xm-root h3, .xm-root p, .xm-overlay h2, .xm-overlay h3, .xm-overlay p { margin: 0; }
.xm-tabs { display: flex; gap: 6px; width: fit-content; padding: 5px; margin-bottom: 22px; border: 1px solid var(--xm-line); border-radius: 12px; background: var(--xm-bg); }
.xm-tabs button { border: 0; padding: 9px 23px; border-radius: 8px; background: transparent; color: var(--xm-muted); font: inherit; font-weight: 650; cursor: pointer; }
.xm-tabs button[aria-selected="true"] { background: #245acc; color: #fff; box-shadow: 0 3px 8px #245acc26; }
.xm-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.xm-eyebrow { color: var(--xm-blue); font-size: 11px; font-weight: 750; letter-spacing: .12em; margin-bottom: 6px !important; }
.xm-root h1 { font-size: clamp(22px, 2.4vw, 30px); line-height: 1.3; font-weight: 750; letter-spacing: -.035em; }
.xm-subtitle { color: var(--xm-muted); margin-top: 8px !important; font-size: 13px; }
.xm-scope { white-space: nowrap; border: 1px solid #b7d9cd; background: #eaf7f1; color: #146d57; padding: 7px 12px; border-radius: 999px; font-size: 12px; font-weight: 650; }
.xm-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 18px; background: var(--xm-bg); border: 1px solid var(--xm-line); border-radius: 14px; margin-bottom: 18px; }
.xm-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; color: var(--xm-muted); font-size: 12px; font-weight: 650; }
.xm-input { width: 100%; max-width: 230px; min-width: 125px; height: 38px; padding: 7px 10px; border: 1px solid var(--xm-line); border-radius: 7px; background: var(--xm-bg); color: var(--xm-ink); font: inherit; font-size: 13px; font-weight: 450; color-scheme: light; }
.dark .xm-input { color-scheme: dark; }
.xm-input[type="search"] { width: 155px; }
.xm-month-control { display: flex; gap: 5px; align-items: center; }
.xm-month-control .xm-input { width: 145px; }
.xm-month-control .xm-button { padding: 5px 11px; font-size: 20px; }
.xm-actions { display: flex; gap: 8px; margin-left: auto; }
.xm-button { display: inline-flex; justify-content: center; align-items: center; gap: 5px; min-height: 38px; padding: 7px 13px; border: 1px solid var(--xm-line); border-radius: 8px; background: var(--xm-bg); color: var(--xm-ink); font: inherit; font-size: 13px; font-weight: 650; white-space: nowrap; cursor: pointer; }
.xm-button:hover:not(:disabled) { border-color: var(--xm-blue); color: var(--xm-blue); }
.xm-primary { background: #245acc; color: #fff; border-color: #245acc; }
.xm-primary:hover:not(:disabled) { background: #194bac; color: #fff; }
.xm-button:disabled, .xm-input:disabled { opacity: .5; cursor: not-allowed; }
.xm-button:focus-visible, .xm-tabs button:focus-visible, .xm-input:focus-visible, .xm-day:focus-visible, .xm-matrix-scroll:focus-visible { outline: 3px solid #71a2ff; outline-offset: 2px; }
.xm-cards { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.xm-card { padding: 17px 14px 14px; border: 1px solid var(--xm-line); border-radius: 12px; background: var(--xm-bg); box-shadow: 0 2px 3px #14254103; }
.xm-card > p { font-size: 12px; font-weight: 650; color: var(--xm-muted); }
.xm-card > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; margin: 7px 0 5px; font-variant-numeric: tabular-nums; }
.xm-card strong { font-size: clamp(22px, 2.2vw, 30px); line-height: 1.2; font-weight: 750; letter-spacing: -.035em; }
.xm-card > div > span, .xm-card small { font-size: 11px; color: var(--xm-muted); }
.xm-card-weekday_overtime_hours strong { color: var(--xm-blue); }
.xm-card-weekend_overtime_hours strong { color: var(--xm-purple); }
.xm-card-total_hours { border-top: 3px solid #245acc; padding-top: 15px; }
.xm-warning, .xm-error { padding: 12px 15px; border-radius: 10px; margin-bottom: 16px; font-size: 13px; }
.xm-warning { color: #865000; border: 1px solid #efd49e; background: #fff8e9; }
.xm-error { color: #a02e3c; border: 1px solid #edc2c8; background: #fff2f3; }
.dark .xm-warning { background: #3b3020; color: #ffda9e; border-color: #6b552c; }
.dark .xm-error { background: #3c2730; color: #ffb7c2; border-color: #70424c; }
.xm-feedback { color: var(--xm-green); margin: 0 0 14px !important; font-size: 13px; }
.xm-table-panel { border: 1px solid var(--xm-line); border-radius: 14px; overflow: hidden; background: var(--xm-bg); }
.xm-table-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: center; padding: 18px; border-bottom: 1px solid var(--xm-line); }
.xm-table-heading h2 { font-size: 16px; font-weight: 750; }
.xm-table-heading p { margin-top: 3px; color: var(--xm-muted); font-size: 12px; }
.xm-legend { display: flex; flex-wrap: wrap; gap: 7px 13px; color: var(--xm-muted); font-size: 11px; }
.xm-regular { color: var(--xm-green); }
.xm-weekday { color: var(--xm-blue); }
.xm-weekend { color: var(--xm-purple); }
.xm-warning-text { color: var(--xm-amber); }
.xm-rejected { color: var(--xm-red); }
.xm-muted { color: var(--xm-muted); }
.xm-matrix-scroll { --xm-name-width: 120px; --xm-project-width: 150px; --xm-sum-width: 105px; overflow: auto; max-height: min(65vh, 720px); width: 100%; scrollbar-color: #a9bbd3 var(--xm-soft); scrollbar-width: auto; overscroll-behavior: contain; }
.xm-matrix { width: max-content; min-width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 12px; }
.xm-matrix th, .xm-matrix td { padding: 0; min-width: 112px; width: 112px; max-width: 112px; border-bottom: 1px solid var(--xm-line); border-right: 1px solid var(--xm-line); background: var(--xm-bg); vertical-align: middle; }
.xm-matrix thead th { position: sticky; top: 0; z-index: 3; padding: 11px 8px; background: var(--xm-soft); text-align: center; height: 61px; font-weight: 750; }
.xm-matrix small { display: block; margin-top: 4px; font-size: 11px; color: var(--xm-muted); font-weight: 400; }
.xm-matrix .xm-calendar-weekend { color: var(--xm-purple); }
.xm-matrix .xm-name, .xm-matrix .xm-project, .xm-matrix .xm-sum { position: sticky; z-index: 2; padding: 11px 12px; text-align: left; overflow-wrap: anywhere; background: var(--xm-bg); }
.xm-matrix .xm-name { left: 0; width: var(--xm-name-width); min-width: var(--xm-name-width); max-width: var(--xm-name-width); }
.xm-matrix .xm-project { left: var(--xm-name-width); width: var(--xm-project-width); min-width: var(--xm-project-width); max-width: var(--xm-project-width); }
.xm-matrix .xm-sum { left: calc(var(--xm-name-width) + var(--xm-project-width)); width: var(--xm-sum-width); min-width: var(--xm-sum-width); max-width: var(--xm-sum-width); box-shadow: 4px 0 7px -5px #182c5080; }
.xm-matrix thead .xm-name, .xm-matrix thead .xm-project, .xm-matrix thead .xm-sum { z-index: 5; background: var(--xm-soft); }
.xm-matrix tbody tr:hover > .xm-name, .xm-matrix tbody tr:hover > .xm-project, .xm-matrix tbody tr:hover > .xm-sum { background: var(--xm-soft); }
.xm-matrix tbody tr:last-child > * { border-bottom: 0; }
.xm-day { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; width: 100%; min-height: 76px; padding: 10px 8px; border: 0; background: transparent; color: var(--xm-ink); text-align: left; font: inherit; font-size: 11px; line-height: 1.6; cursor: pointer; }
.xm-day:hover { box-shadow: inset 0 0 0 2px #85a8e1; background: var(--xm-soft); }
.xm-restday { background: #f8f5fc; }
.dark .xm-restday { background: #26263c; }
.xm-pagination, .xm-pagination > div { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.xm-pagination { justify-content: space-between; border-top: 1px solid var(--xm-line); padding: 13px 18px; color: var(--xm-muted); font-size: 12px; }
.xm-pagination .xm-field { flex-direction: row; align-items: center; }
.xm-pagination .xm-input { min-width: 80px; width: 90px; }
.xm-state { display: flex; flex-direction: column; align-items: center; gap: 12px; justify-content: center; min-height: 235px; padding: 30px 20px; text-align: center; color: var(--xm-muted); }
.xm-state.xm-error { margin: 18px; color: var(--xm-red); }
.xm-footnote { margin-top: 12px !important; color: var(--xm-muted); font-size: 11px; line-height: 1.8; }
.xm-overlay { position: fixed; inset: 0; z-index: 150; background: #14233873; display: flex; justify-content: flex-end; overscroll-behavior: contain; }
.xm-dialog { width: min(620px, 100%); height: 100%; display: flex; flex-direction: column; background: var(--xm-bg); box-shadow: -15px 0 60px #13254c29; }
.xm-dialog-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 24px; gap: 20px; border-bottom: 1px solid var(--xm-line); }
.xm-dialog-header h2 { font-size: 20px; font-weight: 750; }
.xm-dialog-body { overflow: auto; padding: 24px; overscroll-behavior: contain; }
.xm-dialog-body h3 { margin: 22px 0 12px; font-size: 15px; font-weight: 750; }
.xm-detail-summary { padding: 16px; border-radius: 12px; border: 1px solid var(--xm-line); background: var(--xm-soft); font-size: 12px; line-height: 1.9; }
.xm-record { margin-bottom: 10px; padding: 14px; border: 1px solid var(--xm-line); border-radius: 10px; font-size: 13px; }
.xm-record p { margin-top: 6px; }
.xm-note { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--xm-soft); border-radius: 7px; padding: 10px; }
.xm-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 1280px) { .xm-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .xm-root { padding: 14px; border-radius: 12px; }
  .xm-header { align-items: flex-start; flex-direction: column; gap: 12px; }
  .xm-toolbar { padding: 12px; gap: 12px 8px; }
  .xm-actions { width: 100%; margin-left: 0; }
  .xm-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .xm-matrix-scroll { --xm-name-width: 82px; --xm-project-width: 112px; --xm-sum-width: 88px; }
  .xm-matrix .xm-name, .xm-matrix .xm-project, .xm-matrix .xm-sum { padding: 8px; }
  .xm-matrix .xm-project, .xm-matrix .xm-sum { position: static; box-shadow: none; }
  .xm-matrix thead .xm-project, .xm-matrix thead .xm-sum { position: sticky; left: auto; z-index: 3; }
  .xm-table-heading { padding: 14px; }
  .xm-pagination { padding: 12px; }
}
