/* =========================================================
   内容采访部值班安排
   整合版样式表

   设计方向：
   1. 桌面浏览器专用
   2. 政务深蓝主题
   3. 保持现有页面视觉与功能
   4. 清除历史重复规则和末尾覆盖补丁
   ========================================================= */


/* =========================================================
   01. 全局设计变量
   ========================================================= */

:root {
  /* 主色 */
  --color-primary-950: #071d3a;
  --color-primary-900: #0a2850;
  --color-primary-800: #0c376e;
  --color-primary-700: #0f4c8a;
  --color-primary-600: #1764ad;
  --color-primary-500: #2378c5;
  --color-primary-300: #7fa9d4;
  --color-primary-200: #bcd7ef;
  --color-primary-100: #dcebf8;
  --color-primary-50: #eff6fc;

  /* 正文文字 */
  --color-text: #172033;
  --color-text-strong: #16283f;
  --color-text-secondary: #586579;
  --color-text-light: #778397;
  --color-text-placeholder: #929cab;

  /* 边框 */
  --color-border-dark: #9aa9bb;
  --color-border: #cbd4df;
  --color-border-light: #e4e9ef;
  --color-border-subtle: #eef1f6;

  /* 背景 */
  --color-background: #f3f6f9;
  --color-surface: #ffffff;
  --color-surface-alt: #f8fafc;
  --color-surface-muted: #f1f5f9;

  /* 排班状态 */
  --color-weekend: #fafbfd;
  --color-current-week: #f2f8ff;
  --color-current-week-hover: #e8f3ff;
  --color-today: #e3efff;
  --color-today-hover: #d8e9fd;
  --color-today-border: #bcd8f5;

  /* 节假日和调休 */
  --color-holiday-bg: #fffaf8;
  --color-holiday-hover: #fff4f0;
  --color-holiday-text: #973b2e;
  --color-workday-bg: #fffdf6;
  --color-workday-hover: #fff8e8;
  --color-workday-text: #80571a;

  /* 状态色 */
  --color-success: #16794c;
  --color-success-bg: #e7f6ee;
  --color-warning: #93610a;
  --color-warning-bg: #fff5d9;
  --color-danger: #b4232f;
  --color-danger-dark: #8d1722;
  --color-danger-bg: #fff0f1;

  /* 阴影 */
  --shadow-small:
    0 2px 8px rgba(17, 40, 70, 0.10);

  --shadow-card:
    0 1px 2px rgba(24, 59, 109, 0.05),
    0 10px 28px rgba(24, 59, 109, 0.09);

  --shadow-medium:
    0 12px 34px rgba(7, 29, 58, 0.18);

  --shadow-large:
    0 24px 70px rgba(7, 29, 58, 0.28);

  /* 页面尺寸 */
  --page-min-width: 1060px;
  --content-width: 1240px;
  --content-min-width: 1040px;
  --page-gutter: 20px;
  --topbar-height: 94px;
  --schedule-min-width: 1000px;

  /* 表格外侧空间 */
  --status-rail-width: 58px;
  --status-badge-width: 44px;
  --admin-action-offset: 10px;
  --admin-action-width: 48px;

  /* 圆角 */
  --radius-small: 5px;
  --radius-medium: 8px;
  --radius-large: 12px;
  --radius-card: 14px;
  --radius-round: 999px;

  /* 字体 */
  font-family:
    "Microsoft YaHei",
    "微软雅黑",
    "PingFang SC",
    "Noto Sans CJK SC",
    Arial,
    sans-serif;
}


/* =========================================================
   02. 基础重置与页面默认值
   ========================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: var(--page-min-width);
  min-height: 100%;
  scroll-behavior: smooth;
  background: var(--color-background);
}

body {
  min-width: var(--page-min-width);
  min-height: 100vh;
  margin: 0;
  color: var(--color-text);
  background: var(--color-background);
  font-size: 16px;
  line-height: 1.65;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button,
select,
input[type="date"],
input[type="file"] {
  cursor: pointer;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea {
  cursor: text;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

a {
  color: var(--color-primary-700);
}

table {
  font-variant-numeric: tabular-nums;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}


/* =========================================================
   03. 键盘焦点与通用交互
   ========================================================= */

.button:focus-visible,
.icon-button:focus-visible,
.text-button:focus-visible,
.password-toggle:focus-visible,
.admin-action:focus-visible,
.calendar-nav-button:focus-visible,
.calendar-select:focus-visible,
.form-control:focus-visible,
.file-input:focus-visible,
.full-schedule-details > summary:focus-visible {
  outline: 3px solid rgba(35, 120, 197, 0.28);
  outline-offset: 2px;
}


/* =========================================================
   04. 通用按钮
   ========================================================= */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 18px;
  color: inherit;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-small);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
  transition:
    color 0.15s ease,
    background-color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.08s ease;
}

.button:hover:not(:disabled) {
  box-shadow: 0 3px 9px rgba(12, 55, 110, 0.17);
}

.button:active:not(:disabled) {
  transform: translateY(1px);
}

.button--primary {
  color: #ffffff;
  background: var(--color-primary-700);
  border-color: var(--color-primary-700);
}

.button--primary:hover:not(:disabled) {
  color: #ffffff;
  background: var(--color-primary-800);
  border-color: var(--color-primary-800);
}

.button--secondary {
  color: var(--color-text);
  background: #ffffff;
  border-color: var(--color-border);
}

.button--secondary:hover:not(:disabled) {
  color: var(--color-primary-800);
  background: var(--color-primary-50);
  border-color: var(--color-primary-500);
}

.button--outline {
  color: var(--color-primary-800);
  background: #ffffff;
  border-color: var(--color-primary-200);
}

.button--outline:hover:not(:disabled) {
  color: #ffffff;
  background: var(--color-primary-700);
  border-color: var(--color-primary-700);
}

.button--danger {
  color: #ffffff;
  background: var(--color-danger);
  border-color: var(--color-danger);
}

.button--danger:hover:not(:disabled) {
  color: #ffffff;
  background: var(--color-danger-dark);
  border-color: var(--color-danger-dark);
}

.button--danger:disabled {
  color: #ffffff;
  background: #cb7f89;
  border-color: #cb7f89;
  opacity: 0.72;
}

.button--danger-outline {
  color: var(--color-danger);
  background: #ffffff;
  border-color: #d9959b;
}

.button--danger-outline:hover:not(:disabled) {
  color: #ffffff;
  background: var(--color-danger);
  border-color: var(--color-danger);
}

.button--large {
  min-height: 46px;
  padding: 11px 24px;
  font-size: 17px;
}

.button--small {
  min-height: 30px;
  padding: 5px 12px;
  font-size: 14px;
}

.button--full {
  width: 100%;
}


/* 普通文字按钮 */

.text-button {
  padding: 0;
  color: var(--color-primary-700);
  background: transparent;
  border: 0;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-button:hover {
  color: var(--color-primary-900);
}


/* 弹窗圆形关闭按钮 */

.icon-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0 0 2px;
  color: #55708f;
  background: transparent;
  border: 2px solid var(--color-primary-200);
  border-radius: 50%;
  font-size: 26px;
  font-weight: 400;
  line-height: 1;
  transition:
    color 0.15s ease,
    background-color 0.15s ease,
    border-color 0.15s ease;
}

.icon-button:hover {
  color: var(--color-primary-800);
  background: var(--color-primary-50);
  border-color: var(--color-primary-500);
}


/* =========================================================
   05. 通用表单控件
   ========================================================= */

.field-label {
  display: block;
  margin: 0 0 6px;
  color: #283b53;
  font-size: 16px;
  font-weight: 700;
}

.form-control {
  width: 100%;
  min-height: 42px;
  padding: 8px 11px;
  color: var(--color-text);
  background: #ffffff;
  border: 1px solid var(--color-border-dark);
  border-radius: var(--radius-small);
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background-color 0.15s ease;
}

.form-control:hover:not(:disabled) {
  border-color: #7187a0;
}

.form-control:focus {
  border-color: var(--color-primary-600);
  box-shadow: 0 0 0 3px rgba(35, 120, 197, 0.14);
}

.form-control::placeholder {
  color: var(--color-text-placeholder);
}

textarea.form-control {
  min-height: 96px;
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.form-group {
  min-width: 0;
}


/* 密码输入框 */

.password-field {
  position: relative;
  display: flex;
  align-items: stretch;
  width: 100%;
}

.password-field > input {
  width: 100%;
  padding-right: 72px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 7px;
  min-width: 52px;
  padding: 5px 8px;
  color: var(--color-primary-700);
  background: transparent;
  border: 0;
  border-radius: 4px;
  font-weight: 700;
  transform: translateY(-50%);
}

.password-toggle:hover {
  background: var(--color-primary-50);
}


/* 表单反馈消息 */

.form-message {
  margin: 13px 0 0;
  padding: 10px 12px;
  color: var(--color-text-secondary);
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
}

.form-message--error,
.form-message.is-error {
  color: var(--color-danger-dark);
  background: var(--color-danger-bg);
  border-color: #e5afb4;
}

.form-message--success,
.form-message.is-success {
  color: var(--color-success);
  background: var(--color-success-bg);
  border-color: #9ed2b7;
}

.form-message--warning,
.form-message.is-warning {
  color: var(--color-warning);
  background: var(--color-warning-bg);
  border-color: #e5cb82;
}

.help-text {
  margin: 9px 0 0;
  color: var(--color-text-secondary);
  font-size: 14px;
}


/* =========================================================
   06. 共享访问口令入口
   当前默认停用，但保留完整样式供以后启用
   ========================================================= */

.access-gate {
  position: fixed;
  z-index: 5000;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: var(--page-min-width);
  min-height: 680px;
  padding: 40px;
  overflow: auto;
  background:
    linear-gradient(
      135deg,
      rgba(7, 29, 58, 0.97),
      rgba(12, 55, 110, 0.96)
    );
}

.access-gate::before {
  position: fixed;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: 0.16;
  background-image:
    linear-gradient(
      rgba(255, 255, 255, 0.08) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.08) 1px,
      transparent 1px
    );
  background-size: 42px 42px;
}

.access-gate__panel {
  position: relative;
  z-index: 1;
  width: 460px;
  padding: 48px 52px 42px;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: var(--radius-large);
  box-shadow: var(--shadow-large);
  text-align: center;
}

.access-gate__panel::before {
  position: absolute;
  top: 0;
  right: 52px;
  left: 52px;
  height: 5px;
  content: "";
  background: var(--color-primary-700);
  border-radius: 0 0 4px 4px;
}

.access-gate__panel h1 {
  margin: 0;
  color: var(--color-primary-900);
  font-size: 27px;
  line-height: 1.35;
  letter-spacing: 1px;
}

.access-gate__description {
  margin: 18px 0 24px;
  color: var(--color-text-secondary);
  font-size: 15px;
}

.access-gate__notice {
  margin: 24px 0 0;
  color: var(--color-text-light);
  font-size: 13px;
}

.access-gate .password-field {
  margin-bottom: 16px;
}

.access-gate .password-field input {
  min-height: 46px;
  padding: 10px 75px 10px 13px;
  color: var(--color-text);
  background: #ffffff;
  border: 1px solid var(--color-border-dark);
  border-radius: var(--radius-small);
  outline: none;
}

.access-gate .password-field input:focus {
  border-color: var(--color-primary-600);
  box-shadow: 0 0 0 3px rgba(35, 120, 197, 0.15);
}


/* =========================================================
   07. 网站整体和顶部工具栏
   ========================================================= */

.site-shell {
  min-width: var(--page-min-width);
  min-height: 100vh;
}

.topbar {
  position: sticky;
  z-index: 1000;
  top: 0;
  min-width: var(--page-min-width);
  min-height: var(--topbar-height);
  color: #ffffff;
  background: var(--color-primary-900);
  border-bottom: 4px solid var(--color-primary-600);
  box-shadow: var(--shadow-small);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(
    var(--content-width),
    calc(100% - (var(--page-gutter) * 2))
  );
  min-width: var(--content-min-width);
  min-height: 90px;
  margin: 0 auto;
  gap: 30px;
}

.topbar__title-area {
  min-width: 360px;
}

.topbar__title-area h1 {
  margin: 0;
  color: #ffffff;
  font-size: 27px;
  line-height: 1.3;
  letter-spacing: 1px;
}

.last-updated {
  margin: 7px 0 0;
  color: #cadcf0;
  font-size: 15px;
}

.topbar__actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.topbar__actions .button {
  min-width: 86px;
  min-height: 38px;
  padding-right: 14px;
  padding-left: 14px;
}

.topbar .button--outline {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.55);
}

.topbar .button--outline:hover:not(:disabled) {
  color: var(--color-primary-900);
  background: #ffffff;
  border-color: #ffffff;
}

.topbar .button--primary {
  color: var(--color-primary-900);
  background: #ffffff;
  border-color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.topbar .button--primary:hover:not(:disabled) {
  color: #ffffff;
  background: var(--color-primary-600);
  border-color: #ffffff;
}


/* 页面主体 */

.main-content {
  width: min(
    var(--content-width),
    calc(100% - (var(--page-gutter) * 2))
  );
  min-width: var(--content-min-width);
  margin: 0 auto;
  padding: 24px 0 52px;
}


/* =========================================================
   08. 岗位说明
   ========================================================= */

.duty-explanation {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 47px;
  margin: 0 0 18px;
  padding: 10px 128px 10px 16px;
  color: #34445a;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-left: 5px solid var(--color-primary-600);
  border-radius: var(--radius-small);
  box-shadow: 0 1px 4px rgba(17, 40, 70, 0.05);
  font-size: 16px;
  gap: 12px;
}

.duty-explanation strong {
  flex: 0 0 auto;
  color: var(--color-primary-900);
}

.duty-explanation span {
  padding-right: 12px;
  border-right: 1px solid var(--color-border-light);
}

.duty-explanation span:last-of-type {
  padding-right: 0;
  border-right: 0;
}

.duty-explanation__exit {
  position: absolute;
  top: 50%;
  right: 17px;
  transform: translateY(-50%);
}


/* =========================================================
   09. 加载、错误和空数据状态
   ========================================================= */

.state-panel {
  min-height: 360px;
  padding: 78px 40px;
  color: var(--color-text-secondary);
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-medium);
  box-shadow: var(--shadow-small);
  text-align: center;
}

.state-panel h2 {
  margin: 16px 0 8px;
  color: var(--color-primary-900);
  font-size: 22px;
}

.state-panel p {
  max-width: 700px;
  margin: 0 auto 24px;
}

.state-panel--error {
  color: #71303a;
  background: #fffafa;
  border-color: #e5b5ba;
}

.state-panel--error h2 {
  color: var(--color-danger);
}

.loading-spinner {
  width: 43px;
  height: 43px;
  margin: 0 auto;
  border: 4px solid var(--color-primary-100);
  border-top-color: var(--color-primary-700);
  border-radius: 50%;
  animation: duty-spin 0.85s linear infinite;
}

@keyframes duty-spin {
  to {
    transform: rotate(360deg);
  }
}

.available-years {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 18px;
  gap: 10px;
}


/* =========================================================
   10. 两周排班总览卡片
   ========================================================= */

.week-overview {
  width: 100%;
  overflow: visible;
  background: #ffffff;
  border: 1px solid #e2e9f2;
  border-radius: 16px;
  box-shadow: var(--shadow-card);
}

.week-overview__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 126px;
  padding: 20px 26px;
  color: #ffffff;
  background:
    linear-gradient(
      135deg,
      #12335f,
      #22558f 55%,
      #2b6aab
    );
  border-radius: 15px 15px 0 0;
  gap: 24px;
}

.week-overview__eyebrow {
  margin: 0 0 4px;
  color: #cfe0f5;
  font-size: 13px;
  letter-spacing: 2px;
}

.week-overview__heading h2 {
  margin: 0;
  color: #ffffff;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.5px;
}

.week-overview__range {
  margin: 5px 0 0;
  color: #e4eef9;
  font-size: 15px;
}

.week-navigation {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

.week-overview__heading .button--outline {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.65);
}

.week-overview__heading .button--outline:hover:not(:disabled) {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
  border-color: #ffffff;
}

.week-overview__heading .button--primary {
  color: #173b6d;
  background: #ffffff;
  border-color: #ffffff;
}

.week-overview__heading .button--primary:hover:not(:disabled) {
  color: #173b6d;
  background: #e5effa;
  border-color: #ffffff;
}

.week-overview__heading .button:disabled {
  cursor: default;
  opacity: 0.5;
  box-shadow: none;
}


/* 两周总览表格容器 */

.week-table-wrapper {
  width: 100%;
  overflow: visible;
}

.week-table {
  width: 100%;
  min-width: var(--schedule-min-width);
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  color: var(--color-text);
}


/* 两周表格的七个业务列
   如果管理员登录，第八列操作列会在表格右侧悬浮显示 */

.week-table th:nth-child(1) {
  width: 12%;
}

.week-table th:nth-child(2) {
  width: 9%;
}

.week-table th:nth-child(3) {
  width: 16%;
}

.week-table th:nth-child(4) {
  width: 16%;
}

.week-table th:nth-child(5) {
  width: 14%;
}

.week-table th:nth-child(6) {
  width: 22%;
}

.week-table th:nth-child(7) {
  width: 11%;
}


/* 表头 */

.week-table th {
  height: 44px;
  padding: 10px;
  color: #33455c;
  background:
    linear-gradient(
      180deg,
      #f7fafd,
      #eef3f9
    );
  border: 0;
  border-bottom: 1px solid #c3d0e0;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.35;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}


/* 正文单元格 */

.week-table td {
  height: 48px;
  padding: 10px;
  color: var(--color-text);
  background: #ffffff;
  border: 0;
  border-bottom: 1px solid var(--color-border-subtle);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.45;
  text-align: center;
  vertical-align: middle;
  overflow-wrap: anywhere;
  transition: background-color 0.14s ease;
}

.week-table tbody tr:last-child td {
  border-bottom: 0;
}

.week-table tbody tr:hover td {
  background: #f4f9ff;
}

.week-table .cell-date {
  position: relative;
  color: #22364d;
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
}

.week-table .cell-weekday {
  color: #7a879a;
  font-size: 15px;
  font-weight: 400;
  white-space: nowrap;
}

.week-table .cell-person {
  color: var(--color-text-strong);
  font-weight: 400;
  letter-spacing: 0.1px;
}

.week-table .cell-note {
  padding-right: 8px;
  padding-left: 8px;
  color: var(--color-text-secondary);
  font-size: 15px;
  font-weight: 400;
  text-align: center;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.week-table .cell-empty {
  color: #c2cad6;
  font-weight: 400;
}


/* 两周之间的“下周”分隔行 */

.week-divider-row .week-divider-cell {
  height: 38px;
  padding: 0 18px;
  color: #e8f0f9;
  background:
    linear-gradient(
      90deg,
      #1a4070 0%,
      #275b95 50%,
      #1a4070 100%
    );
  border: 0;
  font-size: 15px;
  font-weight: 400;
  line-height: 38px;
  letter-spacing: 2.5px;
  text-align: center;
}

.week-divider-row:hover .week-divider-cell {
  background:
    linear-gradient(
      90deg,
      #1a4070 0%,
      #275b95 50%,
      #1a4070 100%
    );
}


/* =========================================================
   11. 两周排班的日期状态
   ========================================================= */


/* 普通周末 */

.week-table tr.is-weekend td {
  background: var(--color-weekend);
}

.week-table tr.is-weekend .cell-weekday {
  color: #9a7654;
  font-weight: 400;
}

.week-table tr.is-weekend:hover td {
  background: #f3f6fa;
}


/* 当前周 */

.week-table tr.is-current-week:not(.is-today) td {
  background: var(--color-current-week);
}

.week-table tr.is-current-week:not(.is-today):hover td {
  background: var(--color-current-week-hover);
}


/* 今天 */

.week-table tr.is-today {
  position: relative;
  scroll-margin-top: 140px;
}

.week-table tr.is-today td {
  background: var(--color-today);
  border-top: 1px solid var(--color-today-border);
  border-bottom: 1px solid var(--color-today-border);
  font-weight: 400;
}

.week-table tr.is-today td:first-child {
  box-shadow: inset 4px 0 0 #1769c2;
}

.week-table tr.is-today .cell-date {
  font-weight: 700;
}

.week-table tr.is-today:hover td {
  background: var(--color-today-hover);
}


/* 法定节假日 */

.week-table tr.is-holiday:not(.is-current-week):not(.is-today) td {
  background: var(--color-holiday-bg);
}

.week-table tr.is-holiday .cell-date,
.week-table tr.is-holiday .cell-weekday,
.week-table tr.is-holiday .cell-note {
  color: var(--color-holiday-text);
}

.week-table tr.is-holiday:not(.is-current-week):not(.is-today):hover td {
  background: var(--color-holiday-hover);
}


/* 调休上班日 */

.week-table tr.is-adjusted-workday:not(.is-current-week):not(.is-today) td {
  background: var(--color-workday-bg);
}

.week-table tr.is-adjusted-workday .cell-date,
.week-table tr.is-adjusted-workday .cell-weekday,
.week-table tr.is-adjusted-workday .cell-note {
  color: var(--color-workday-text);
}

.week-table
tr.is-adjusted-workday:not(.is-current-week):not(.is-today):hover
td {
  background: var(--color-workday-hover);
}


/* 当前周和今天的底色优先 */

.week-table tr.is-current-week:not(.is-today) td {
  background: var(--color-current-week);
}

.week-table tr.is-current-week:not(.is-today):hover td {
  background: var(--color-current-week-hover);
}

.week-table tr.is-today td {
  background: var(--color-today);
}

.week-table tr.is-today:hover td {
  background: var(--color-today-hover);
}


/* =========================================================
   12. 表格左侧状态标签
   ========================================================= */

.day-labels {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 1px 7px;
  border: 1px solid transparent;
  border-radius: var(--radius-round);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  white-space: nowrap;
}

.status-badge--today {
  color: #ffffff;
  background: var(--color-primary-700);
  border-color: var(--color-primary-700);
}

.status-badge--week {
  color: var(--color-primary-800);
  background: #ffffff;
  border-color: var(--color-primary-500);
}

.status-badge--holiday {
  color: var(--color-holiday-text);
  background: #fff0ec;
  border-color: #efc1b7;
}

.status-badge--workday {
  color: var(--color-workday-text);
  background: #fff5df;
  border-color: #e8ce94;
}


/* “本周”和“今天”显示在表格左侧，不占用日期列宽度 */

.week-table .cell-date .day-labels,
.schedule-table .cell-date .day-labels {
  position: absolute;
  z-index: 20;
  top: 50%;
  left: calc(var(--status-rail-width) * -1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 52px;
  margin: 0;
  gap: 3px;
  pointer-events: none;
  transform: translateY(-50%);
}

.week-table .cell-date .status-badge,
.schedule-table .cell-date .status-badge {
  width: var(--status-badge-width);
  min-width: var(--status-badge-width);
  min-height: 20px;
  padding: 1px 4px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
}

.week-table .cell-date .status-badge--week,
.schedule-table .cell-date .status-badge--week {
  color: var(--color-primary-800);
  background: #ffffff;
  border: 1px solid var(--color-primary-500);
  box-shadow: 0 1px 3px rgba(12, 55, 110, 0.10);
}

.week-table .cell-date .status-badge--today,
.schedule-table .cell-date .status-badge--today {
  color: #ffffff;
  background: var(--color-primary-700);
  border: 1px solid var(--color-primary-700);
  box-shadow: 0 1px 4px rgba(12, 55, 110, 0.18);
}


/* 今天恰好是周一时，同一位置纵向显示两个标签 */

.week-table tr.is-current-week-start.is-today td,
.schedule-table tr.is-current-week-start.is-today td {
  height: 52px;
}

.week-table
tr.is-current-week-start.is-today
.cell-date
.day-labels,
.schedule-table
tr.is-current-week-start.is-today
.cell-date
.day-labels {
  flex-direction: column;
  gap: 2px;
}

.week-table
tr.is-current-week-start.is-today
.cell-date
.status-badge,
.schedule-table
tr.is-current-week-start.is-today
.cell-date
.status-badge {
  min-height: 18px;
  padding-top: 1px;
  padding-bottom: 1px;
  font-size: 10px;
}


/* =========================================================
   13. 管理员操作列
   操作列不挤压七个业务列，按钮显示在表格右侧
   ========================================================= */


/* 全年排班通过 colgroup 创建操作列 */

.schedule-table col.col-action {
  width: 0;
}


/* 两周表格的第八列是操作列 */

.week-table th:nth-child(8) {
  width: 0;
}


/* 操作单元格和操作表头收缩为零宽 */

.schedule-table .cell-action,
.week-table .cell-action,
.schedule-table th.col-action,
.week-table th:nth-child(8) {
  position: relative;
  width: 0;
  min-width: 0;
  padding: 0;
  overflow: visible;
  white-space: nowrap;
  border: 0;
}


/* 编辑按钮显示在表格右边界外侧 */

.schedule-table .cell-action .day-edit-button,
.week-table .cell-action .day-edit-button {
  position: absolute;
  z-index: 20;
  top: 50%;
  left: var(--admin-action-offset);
  min-width: var(--admin-action-width);
  min-height: 28px;
  padding: 3px 8px;
  font-size: 14px;
  transform: translateY(-50%);
}


/* 操作表头文字同样显示在表格右侧 */

.schedule-table th.col-action,
.week-table th:nth-child(8) {
  color: transparent;
  background: transparent;
}

.schedule-table th.col-action::after,
.week-table th:nth-child(8)::after {
  position: absolute;
  top: 50%;
  left: var(--admin-action-offset);
  width: var(--admin-action-width);
  content: "操作";
  color: var(--color-text-secondary);
  font-size: 14px;
  font-weight: 400;
  text-align: center;
  transform: translateY(-50%);
}


/* =========================================================
   14. 完整排班折叠区域
   ========================================================= */

.full-schedule-details {
  width: 100%;
  margin-top: 20px;
}

.full-schedule-details > summary {
  width: fit-content;
  margin: 0 auto;
  padding: 11px 24px;
  color: #1b4478;
  background: #ffffff;
  border: 1px solid #cfdcec;
  border-radius: var(--radius-round);
  box-shadow: 0 2px 6px rgba(24, 59, 109, 0.07);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
  user-select: none;
  transition:
    color 0.15s ease,
    background-color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.full-schedule-details > summary:hover {
  color: var(--color-primary-800);
  background: #f4f9ff;
  border-color: #a8c4e2;
  box-shadow: 0 4px 14px rgba(24, 59, 109, 0.13);
  transform: translateY(-1px);
}

.full-schedule-details[open] > summary {
  margin-bottom: 20px;
}


/* =========================================================
   15. 全年排班月份区域
   ========================================================= */

.schedule-content {
  display: flex;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  flex-direction: column;
  gap: 24px;
}

.month-section {
  width: 100%;
  overflow: visible;
  scroll-margin-top: 112px;
  background: #ffffff;
  border: 1px solid #e2e9f2;
  border-radius: var(--radius-card);
  box-shadow:
    0 1px 2px rgba(24, 59, 109, 0.05),
    0 8px 24px rgba(24, 59, 109, 0.07);
}

.month-heading {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 11px 22px;
  color: #ffffff;
  background:
    linear-gradient(
      135deg,
      #16386a,
      #24589a
    );
  border-radius: 13px 13px 0 0;
  gap: 20px;
}

.month-heading__title {
  display: flex;
  align-items: center;
  gap: 0;
}

.month-heading h2,
.month-heading h3 {
  margin: 0;
  color: #ffffff;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 1px;
}

.month-heading__meta {
  color: #c6dcf2;
  font-size: 14px;
}


/* “本月”和“查询月份”放在月份卡片左侧 */

.month-heading .month-badge {
  position: absolute;
  z-index: 20;
  top: 50%;
  left: calc(var(--status-rail-width) * -1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  min-height: 21px;
  margin: 0;
  padding: 2px 5px;
  color: #ffffff;
  background: var(--color-primary-700);
  border: 1px solid var(--color-primary-700);
  border-radius: var(--radius-round);
  box-shadow: 0 1px 4px rgba(12, 55, 110, 0.16);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
  transform: translateY(-50%);
}

.month-heading .month-badge--query {
  left: -62px;
  width: 58px;
  color: #714300;
  background: #fff0c2;
  border-color: #dfbd66;
}


/* =========================================================
   16. 全年排班表
   ========================================================= */

.schedule-table-wrapper {
  width: 100%;
  overflow: visible;
}

.schedule-table {
  width: 100%;
  min-width: var(--schedule-min-width);
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  color: var(--color-text);
}


/* 七个业务列合计为 100% */

.schedule-table col.col-date {
  width: 12%;
}

.schedule-table col.col-weekday {
  width: 9%;
}

.schedule-table col.col-primary {
  width: 16%;
}

.schedule-table col.col-secondary {
  width: 16%;
}

.schedule-table col.col-producer {
  width: 14%;
}

.schedule-table col.col-holiday {
  width: 22%;
}

.schedule-table col.col-note {
  width: 11%;
}


/* 全年排班表头 */

.schedule-table th {
  height: 44px;
  padding: 10px;
  color: #33455c;
  background:
    linear-gradient(
      180deg,
      #f7fafd,
      #eef3f9
    );
  border: 0;
  border-bottom: 1px solid #c3d0e0;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.35;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}


/* 全年排班正文 */

.schedule-table td {
  height: 48px;
  padding: 10px;
  color: var(--color-text);
  background: #ffffff;
  border: 0;
  border-bottom: 1px solid var(--color-border-subtle);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.45;
  text-align: center;
  vertical-align: middle;
  overflow-wrap: anywhere;
  transition: background-color 0.14s ease;
}

.schedule-table tbody tr:last-child td {
  border-bottom: 0;
}

.schedule-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 13px;
}

.schedule-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 13px;
}

.schedule-table tbody tr:hover td {
  background: #f4f9ff;
}

.schedule-table .cell-date {
  position: relative;
  padding-right: 6px;
  padding-left: 6px;
  color: #22364d;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.schedule-table .cell-weekday {
  color: #7a879a;
  font-size: 15px;
  font-weight: 400;
  white-space: nowrap;
}

.schedule-table .cell-person {
  padding-right: 6px;
  padding-left: 6px;
  color: var(--color-text-strong);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0.1px;
}

.schedule-table .cell-note {
  padding-right: 8px;
  padding-left: 8px;
  color: var(--color-text-secondary);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.4;
  text-align: center;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.schedule-table .cell-empty,
.week-table .cell-empty {
  color: #c2cad6;
  font-weight: 400;
}


/* =========================================================
   17. 全年排班的日期状态
   ========================================================= */


/* 普通周末 */

.schedule-table tr.is-weekend td {
  background: var(--color-weekend);
}

.schedule-table tr.is-weekend .cell-weekday {
  color: #9a7654;
  font-weight: 400;
}

.schedule-table tr.is-weekend:hover td {
  background: #f3f6fa;
}


/* 本周 */

.schedule-table tr.is-current-week td {
  background: var(--color-current-week);
}

.schedule-table tr.is-current-week td:first-child {
  padding-left: 7px;
  border-left: 3px solid var(--color-primary-300);
}

.schedule-table tr.is-current-week-start td {
  border-top: 1px solid #a8c8e6;
}

.schedule-table tr.is-current-week-end td {
  border-bottom: 1px solid #a8c8e6;
}

.schedule-table tr.is-current-week:hover td {
  background: var(--color-current-week-hover);
}


/* 今天 */

.schedule-table tr.is-today {
  position: relative;
  scroll-margin-top: 140px;
}

.schedule-table tr.is-today td {
  background: var(--color-today);
  border-top: 1px solid var(--color-today-border);
  border-bottom: 1px solid var(--color-today-border);
  font-weight: 400;
}

.schedule-table tr.is-today td:first-child {
  border-left: 0;
  box-shadow: inset 4px 0 0 #1769c2;
}

.schedule-table tr.is-today .cell-date {
  font-weight: 700;
}

.schedule-table tr.is-today:hover td {
  background: var(--color-today-hover);
}


/* 法定节假日 */

.schedule-table tr.is-holiday:not(.is-current-week):not(.is-today) td {
  background: var(--color-holiday-bg);
}

.schedule-table tr.is-holiday .cell-date,
.schedule-table tr.is-holiday .cell-weekday,
.schedule-table tr.is-holiday .cell-note {
  color: var(--color-holiday-text);
}

.schedule-table tr.is-holiday .cell-date {
  font-weight: 700;
}

.schedule-table tr.is-holiday:not(.is-current-week):not(.is-today):hover td {
  background: var(--color-holiday-hover);
}


/* 调休上班日 */

.schedule-table
tr.is-adjusted-workday:not(.is-current-week):not(.is-today)
td {
  background: var(--color-workday-bg);
}

.schedule-table tr.is-adjusted-workday .cell-date,
.schedule-table tr.is-adjusted-workday .cell-weekday,
.schedule-table tr.is-adjusted-workday .cell-note {
  color: var(--color-workday-text);
}

.schedule-table tr.is-adjusted-workday .cell-date {
  font-weight: 700;
}

.schedule-table
tr.is-adjusted-workday:not(.is-current-week):not(.is-today):hover
td {
  background: var(--color-workday-hover);
}


/* 本周和今天的底色优先于节假日及调休底色 */

.schedule-table tr.is-current-week:not(.is-today) td {
  background: var(--color-current-week);
}

.schedule-table tr.is-current-week:not(.is-today):hover td {
  background: var(--color-current-week-hover);
}

.schedule-table tr.is-today td {
  background: var(--color-today);
}

.schedule-table tr.is-today:hover td {
  background: var(--color-today-hover);
}


/* =========================================================
   18. 日期查询定位后的短暂强调
   ========================================================= */

.schedule-table tr.is-query-target,
.week-table tr.is-query-target {
  scroll-margin-top: 150px;
  animation: duty-query-highlight 2.2s ease;
}

@keyframes duty-query-highlight {
  0%,
  32% {
    box-shadow:
      inset 0 0 0 3px #e59600,
      inset 0 0 28px rgba(255, 198, 65, 0.28);
  }

  100% {
    box-shadow: inset 0 0 0 0 transparent;
  }
}


/* =========================================================
   19. 通用对话框
   ========================================================= */

.dialog {
  width: min(calc(100vw - 80px), 760px);
  max-width: calc(100vw - 80px);
  max-height: calc(100vh - 70px);
  padding: 0;
  color: var(--color-text);
  background: #ffffff;
  border: 0;
  border-radius: var(--radius-medium);
  box-shadow: var(--shadow-large);
  overflow: hidden;
}

.dialog::backdrop {
  background: rgba(7, 20, 39, 0.58);
  backdrop-filter: blur(1px);
}

.dialog[open] {
  display: flex;
  flex-direction: column;
}

.dialog > form {
  display: flex;
  min-height: 0;
  max-height: calc(100vh - 70px);
  flex: 1 1 auto;
  flex-direction: column;
}

.dialog--small {
  width: 500px;
}

.dialog--medium {
  width: min(calc(100vw - 80px), 800px);
}

.dialog--large {
  width: min(calc(100vw - 60px), 1240px);
}


/* 弹窗标题栏 */

.dialog__header {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 72px;
  padding: 17px 20px 15px;
  background: var(--color-surface-muted);
  border-bottom: 1px solid var(--color-border);
  gap: 20px;
}

.dialog__header h2 {
  margin: 0;
  color: var(--color-primary-900);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.4;
}

.dialog__subtitle {
  margin: 3px 0 0;
  color: var(--color-text-secondary);
  font-size: 15px;
  line-height: 1.5;
}


/* 弹窗正文 */

.dialog__body {
  min-height: 0;
  padding: 22px;
  overflow: auto;
  background: #ffffff;
}

.dialog__body > .field-label:not(:first-child) {
  margin-top: 17px;
}

.dialog__body > p:first-child {
  margin-top: 0;
}

.dialog__body > p:last-child {
  margin-bottom: 0;
}


/* 弹窗底部操作区 */

.dialog__footer {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  min-height: 65px;
  padding: 13px 20px;
  background: var(--color-surface-alt);
  border-top: 1px solid var(--color-border);
  gap: 10px;
}


/* 通用确认窗口正文 */

#confirmMessage {
  margin: 0;
  color: var(--color-text);
  line-height: 1.75;
  white-space: pre-line;
}


/* =========================================================
   20. 自定义日期查询日历
   ========================================================= */

.dialog--calendar {
  width: 720px;
}

.calendar-dialog__body {
  padding: 20px 24px 18px;
}


/* 年月切换工具栏 */

.calendar-toolbar {
  display: grid;
  grid-template-columns: 112px 1fr 112px;
  align-items: center;
  margin-bottom: 16px;
  padding: 10px;
  background: #f5f8fb;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-medium);
  gap: 14px;
}

.calendar-selectors {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.calendar-select {
  min-width: 122px;
  height: 38px;
  padding: 6px 34px 6px 12px;
  color: var(--color-primary-900);
  background: #ffffff;
  border: 1px solid var(--color-border-dark);
  border-radius: var(--radius-small);
  outline: none;
  font-weight: 700;
  text-align: center;
}

.calendar-select:hover {
  border-color: var(--color-primary-500);
}

.calendar-select:focus {
  border-color: var(--color-primary-600);
  box-shadow: 0 0 0 3px rgba(35, 120, 197, 0.14);
}

.calendar-nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 6px 12px;
  color: var(--color-primary-800);
  background: #ffffff;
  border: 1px solid var(--color-primary-200);
  border-radius: var(--radius-small);
  font-weight: 700;
  gap: 8px;
  transition:
    color 0.15s ease,
    background-color 0.15s ease,
    border-color 0.15s ease;
}

.calendar-nav-button span {
  margin-top: -2px;
  font-size: 24px;
  font-weight: 400;
  line-height: 1;
}

.calendar-nav-button:hover:not(:disabled) {
  color: #ffffff;
  background: var(--color-primary-700);
  border-color: var(--color-primary-700);
}

.calendar-nav-button:disabled {
  color: #a1aab7;
  background: #f2f4f6;
  border-color: #d9dee5;
  cursor: not-allowed;
}


/* 日历主体 */

.custom-calendar {
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-medium);
  box-shadow: inset 0 1px 2px rgba(17, 40, 70, 0.04);
}

.custom-calendar__weekdays,
.custom-calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.custom-calendar__weekdays {
  margin-bottom: 6px;
  border-bottom: 1px solid var(--color-border-light);
}

.custom-calendar__weekdays span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  color: var(--color-text-secondary);
  font-size: 14px;
  font-weight: 700;
}

.custom-calendar__weekdays span.is-weekend {
  color: #b04a4a;
}

.custom-calendar__grid {
  outline: none;
  gap: 4px;
}

.custom-calendar__grid:focus-visible {
  outline: 3px solid rgba(35, 120, 197, 0.18);
  outline-offset: 4px;
  border-radius: 4px;
}


/* 单个日期按钮 */

.custom-calendar__day {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0;
  color: var(--color-text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  transition:
    color 0.12s ease,
    background-color 0.12s ease,
    border-color 0.12s ease,
    box-shadow 0.12s ease,
    transform 0.08s ease;
}

.custom-calendar__day:hover:not(:disabled) {
  color: var(--color-primary-900);
  background: var(--color-primary-50);
  border-color: var(--color-primary-200);
}

.custom-calendar__day:active:not(:disabled) {
  transform: translateY(1px);
}

.custom-calendar__day:focus-visible {
  outline: 3px solid rgba(35, 120, 197, 0.24);
  outline-offset: 1px;
}


/* 周末日期 */

.custom-calendar__day.is-weekend {
  color: #b04444;
}


/* 非当前月份日期 */

.custom-calendar__day.is-other-month {
  color: #aab1bb;
  font-weight: 500;
}

.custom-calendar__day.is-other-month.is-weekend {
  color: #c99b9b;
}


/* 今天使用蓝色描边和右下角圆点 */

.custom-calendar__day.is-today {
  color: var(--color-primary-800);
  border-color: var(--color-primary-600);
  box-shadow: inset 0 0 0 1px var(--color-primary-600);
  font-weight: 800;
}

.custom-calendar__day.is-today::after {
  position: absolute;
  right: 6px;
  bottom: 5px;
  width: 5px;
  height: 5px;
  content: "";
  background: var(--color-primary-600);
  border-radius: 50%;
}


/* 已选择日期 */

.custom-calendar__day.is-selected {
  color: #ffffff;
  background: var(--color-primary-700);
  border-color: var(--color-primary-700);
  box-shadow: 0 3px 8px rgba(12, 55, 110, 0.24);
  font-weight: 800;
}

.custom-calendar__day.is-selected:hover:not(:disabled) {
  color: #ffffff;
  background: var(--color-primary-800);
  border-color: var(--color-primary-800);
}

.custom-calendar__day.is-selected.is-today::after {
  background: #ffffff;
}


/* 没有已发布排班的日期 */

.custom-calendar__day:disabled {
  color: #c6ccd3;
  background: #f7f8f9;
  border-color: transparent;
  cursor: not-allowed;
  opacity: 0.65;
}


/* 日历底部当前选择状态 */

.calendar-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  margin-top: 14px;
  padding: 10px 13px;
  background: var(--color-primary-50);
  border: 1px solid var(--color-primary-100);
  border-radius: var(--radius-small);
  gap: 20px;
}

.calendar-status__label {
  display: block;
  margin-bottom: 1px;
  color: var(--color-text-secondary);
  font-size: 13px;
}

.calendar-status strong {
  color: var(--color-primary-900);
  font-size: 16px;
}

.calendar-keyboard-help {
  margin: 0;
  color: var(--color-text-light);
  font-size: 13px;
  text-align: right;
}

.calendar-dialog__footer {
  justify-content: space-between;
}

.calendar-dialog__footer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.calendar-today-button {
  min-width: 104px;
}


/* =========================================================
   21. 排班编辑表单
   ========================================================= */

.holiday-fieldset {
  margin: 20px 0;
  padding: 14px 16px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
}

.holiday-fieldset legend {
  padding: 0 8px;
  color: #283b53;
  font-size: 16px;
  font-weight: 700;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 7px 10px;
  color: var(--color-text);
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-small);
  cursor: pointer;
  transition:
    color 0.15s ease,
    background-color 0.15s ease,
    border-color 0.15s ease;
}

.checkbox-item:hover {
  color: var(--color-primary-900);
  background: var(--color-primary-50);
  border-color: var(--color-primary-200);
}

.checkbox-item:focus-within {
  border-color: var(--color-primary-500);
  box-shadow: 0 0 0 3px rgba(35, 120, 197, 0.12);
}

.checkbox-item input {
  width: 16px;
  height: 16px;
  margin: 0 8px 0 0;
  accent-color: var(--color-primary-700);
}


/* 支持 :has() 的浏览器显示更明确的选中反馈 */

@supports selector(.checkbox-item:has(input:checked)) {
  .checkbox-item:has(input:checked) {
    color: var(--color-primary-900);
    background: var(--color-primary-50);
    border-color: var(--color-primary-500);
  }
}


/* =========================================================
   22. 管理员中心
   ========================================================= */

.admin-center-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.admin-action {
  min-height: 116px;
  padding: 22px;
  color: var(--color-text);
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-medium);
  text-align: left;
  transition:
    color 0.15s ease,
    background-color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.08s ease;
}

.admin-action:hover {
  background: var(--color-primary-50);
  border-color: var(--color-primary-500);
  box-shadow: var(--shadow-small);
}

.admin-action:active {
  transform: translateY(1px);
}

.admin-action strong {
  display: block;
  margin-bottom: 7px;
  color: var(--color-primary-800);
  font-size: 18px;
}

.admin-action span {
  display: block;
  color: var(--color-text-secondary);
  line-height: 1.55;
}


/* =========================================================
   23. 人员管理
   ========================================================= */

.inline-form {
  display: grid;
  grid-template-columns: auto minmax(260px, 420px) auto;
  align-items: end;
  justify-content: start;
  margin-bottom: 18px;
  gap: 10px;
}

.inline-form .field-label {
  align-self: center;
  margin: 0 5px 0 0;
}


/* 管理表格外框 */

.table-wrapper {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
}

.management-table {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
  background: #ffffff;
}

.management-table th,
.management-table td {
  padding: 9px 11px;
  border-right: 1px solid var(--color-border-light);
  border-bottom: 1px solid var(--color-border-light);
  text-align: center;
  vertical-align: middle;
}

.management-table th {
  color: #2c4059;
  background: #edf3f8;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.management-table td {
  font-size: 16px;
}

.management-table td:last-child,
.management-table th:last-child {
  border-right: 0;
}

.management-table tbody tr:last-child td {
  border-bottom: 0;
}

.management-table tbody tr:hover td {
  background: #f3f8fc;
}


/* 人员管理行内输入框 */

.management-table .person-name-input,
.management-table .sort-order-input {
  min-height: 36px;
  padding: 5px 8px;
}

.management-table .person-name-input {
  min-width: 150px;
}

.management-table .sort-order-input {
  width: 80px;
  text-align: center;
}


/* 人员管理操作按钮 */

.management-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.management-actions .button--small {
  min-height: 32px;
  padding: 5px 11px;
}


/* 人员状态 */

.person-status {
  display: inline-flex;
  min-width: 58px;
  min-height: 25px;
  align-items: center;
  justify-content: center;
  padding: 2px 9px;
  border-radius: var(--radius-round);
  font-size: 13px;
  font-weight: 700;
}

.person-status--active {
  color: var(--color-success);
  background: var(--color-success-bg);
  border: 1px solid #a1d3b8;
}

.person-status--inactive {
  color: #6c7582;
  background: #eef0f3;
  border: 1px solid #cbd1d8;
}


/* =========================================================
   24. XLSX 文件选择控件
   ========================================================= */

.file-input {
  display: block;
  width: 100%;
  min-height: 54px;
  padding: 8px;
  color: var(--color-text);
  background: #ffffff;
  border: 1px dashed var(--color-border-dark);
  border-radius: var(--radius-small);
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.file-input:hover {
  background: var(--color-primary-50);
  border-color: var(--color-primary-600);
}

.file-input:focus {
  border-color: var(--color-primary-600);
  box-shadow: 0 0 0 3px rgba(35, 120, 197, 0.14);
  outline: none;
}

.file-input::file-selector-button {
  min-height: 36px;
  margin-right: 12px;
  padding: 6px 14px;
  color: var(--color-primary-800);
  background: var(--color-primary-50);
  border: 1px solid var(--color-primary-200);
  border-radius: var(--radius-small);
  font-weight: 700;
  cursor: pointer;
  transition:
    color 0.15s ease,
    background-color 0.15s ease,
    border-color 0.15s ease;
}

.file-input::file-selector-button:hover {
  color: #ffffff;
  background: var(--color-primary-700);
  border-color: var(--color-primary-700);
}


/* 兼容部分旧版 Chromium 浏览器 */

.file-input::-webkit-file-upload-button {
  min-height: 36px;
  margin-right: 12px;
  padding: 6px 14px;
  color: var(--color-primary-800);
  background: var(--color-primary-50);
  border: 1px solid var(--color-primary-200);
  border-radius: var(--radius-small);
  font-weight: 700;
  cursor: pointer;
}


/* =========================================================
   25. XLSX 导入与检查报告
   ========================================================= */

.import-step {
  padding: 17px;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
}

.import-step h3,
.import-report h3 {
  margin: 0 0 12px;
  color: var(--color-primary-900);
  font-size: 18px;
}

.import-report {
  margin-top: 22px;
}

.import-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
  gap: 10px;
}

.import-summary__item {
  min-height: 80px;
  padding: 12px;
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-small);
}

.import-summary__label {
  display: block;
  color: var(--color-text-secondary);
  font-size: 13px;
}

.import-summary__value {
  display: block;
  margin-top: 4px;
  color: var(--color-primary-900);
  font-size: 21px;
  font-weight: 800;
  overflow-wrap: anywhere;
}


/* 导入检查结果列表 */

.import-list {
  margin: 12px 0;
  padding: 13px 15px;
  border-radius: var(--radius-small);
}

.import-list h4 {
  margin: 0 0 7px;
  font-size: 15px;
}

.import-list ul {
  margin: 0;
  padding-left: 23px;
}

.import-list li + li {
  margin-top: 3px;
}

.import-list--error {
  color: var(--color-danger-dark);
  background: var(--color-danger-bg);
  border: 1px solid #e1a7ad;
}

.import-list--warning {
  color: var(--color-warning);
  background: var(--color-warning-bg);
  border: 1px solid #e1c576;
}

.import-list--success {
  color: var(--color-success);
  background: var(--color-success-bg);
  border: 1px solid #9ed0b5;
}


/* 导入预览表格 */

.import-preview-wrapper {
  max-height: 355px;
  margin-top: 18px;
}

.import-preview-wrapper .management-table {
  min-width: 1080px;
}

.import-preview-wrapper thead {
  position: sticky;
  z-index: 3;
  top: 0;
}

.import-preview-wrapper th {
  box-shadow: 0 1px 0 var(--color-border);
}


/* =========================================================
   26. 页面右下角提示
   ========================================================= */

.toast {
  position: fixed;
  z-index: 6000;
  right: 28px;
  bottom: 28px;
  min-width: 290px;
  max-width: 520px;
  padding: 14px 18px;
  color: #ffffff;
  background: var(--color-primary-900);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius-small);
  box-shadow: var(--shadow-medium);
  font-weight: 700;
  line-height: 1.55;
}

.toast.is-success {
  background: var(--color-success);
}

.toast.is-error {
  background: var(--color-danger-dark);
}

.toast.is-warning {
  color: #4a3000;
  background: #f3c45a;
}


/* =========================================================
   27. 较窄桌面窗口适配
   网站仍为桌面端专用，不转换为手机布局
   ========================================================= */

@media (max-width: 1365px) {
  :root {
    --page-gutter: 12px;
    --topbar-height: 90px;
    --status-rail-width: 54px;
    --status-badge-width: 42px;
  }

  .topbar__inner {
    min-height: 86px;
  }

  .topbar__title-area h1 {
    font-size: 25px;
  }

  .last-updated {
    margin-top: 5px;
    font-size: 14px;
  }

  .topbar__actions {
    gap: 8px;
  }

  .topbar__actions .button {
    min-width: 82px;
    padding-right: 12px;
    padding-left: 12px;
    font-size: 14px;
  }

  .main-content {
    padding-top: 20px;
  }

  .duty-explanation {
    min-height: 44px;
    margin-bottom: 16px;
    padding-top: 8px;
    padding-bottom: 8px;
    font-size: 14px;
  }

  .week-overview__heading {
    min-height: 118px;
    padding: 18px 22px;
  }

  .week-overview__heading h2 {
    font-size: 23px;
  }

  .week-overview__range {
    font-size: 14px;
  }

  .week-navigation .button {
    min-width: 76px;
    padding-right: 12px;
    padding-left: 12px;
    font-size: 14px;
  }

  .week-table th,
  .schedule-table th {
    height: 42px;
    padding: 8px 6px;
    font-size: 14px;
  }

  .week-table td,
  .schedule-table td {
    height: 45px;
    padding: 8px 6px;
    font-size: 15px;
  }

  .week-table .cell-date,
  .schedule-table .cell-date {
    font-size: 16px;
  }

  .week-table .cell-weekday,
  .schedule-table .cell-weekday,
  .week-table .cell-note,
  .schedule-table .cell-note {
    font-size: 13px;
  }

  .week-divider-row .week-divider-cell {
    height: 35px;
    font-size: 13px;
    line-height: 35px;
  }

  .month-heading {
    min-height: 49px;
    padding: 10px 19px;
  }

  .month-heading h2,
  .month-heading h3 {
    font-size: 19px;
  }

  .month-heading__meta {
    font-size: 13px;
  }

  .week-table .cell-date .day-labels,
  .schedule-table .cell-date .day-labels {
    left: calc(var(--status-rail-width) * -1);
    width: 48px;
  }

  .week-table .cell-date .status-badge,
  .schedule-table .cell-date .status-badge {
    min-height: 18px;
    font-size: 10px;
  }

  .month-heading .month-badge {
    left: calc(var(--status-rail-width) * -1);
    width: 48px;
    min-height: 20px;
    font-size: 10px;
  }

  .month-heading .month-badge--query {
    left: -58px;
    width: 54px;
  }

  .schedule-table .cell-action .day-edit-button,
  .week-table .cell-action .day-edit-button {
    min-width: 44px;
    min-height: 27px;
    padding: 3px 7px;
    font-size: 12px;
  }

  .schedule-table th.col-action::after,
  .week-table th:nth-child(8)::after {
    font-size: 12px;
  }

  .dialog__header h2 {
    font-size: 20px;
  }

  .dialog__subtitle {
    font-size: 14px;
  }

  .dialog__body {
    padding: 20px;
  }

  .button {
    font-size: 14px;
  }

  .form-control {
    min-height: 40px;
  }
}


/* =========================================================
   28. 低高度桌面窗口适配
   避免弹窗在高度较小的显示器中超出可视区域
   ========================================================= */

@media (max-height: 760px) {
  .dialog {
    max-height: calc(100vh - 30px);
  }

  .dialog > form {
    max-height: calc(100vh - 30px);
  }

  .dialog__header {
    min-height: 62px;
    padding-top: 12px;
    padding-bottom: 11px;
  }

  .dialog__body {
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .dialog__footer {
    min-height: 56px;
    padding-top: 9px;
    padding-bottom: 9px;
  }

  .calendar-dialog__body {
    padding-top: 14px;
    padding-bottom: 13px;
  }

  .calendar-toolbar {
    margin-bottom: 11px;
    padding-top: 7px;
    padding-bottom: 7px;
  }

  .custom-calendar {
    padding: 8px 10px;
  }

  .custom-calendar__weekdays span {
    height: 29px;
  }

  .custom-calendar__day {
    height: 39px;
  }

  .calendar-status {
    min-height: 50px;
    margin-top: 10px;
    padding-top: 7px;
    padding-bottom: 7px;
  }

  .holiday-fieldset {
    margin-top: 15px;
    margin-bottom: 15px;
    padding-top: 10px;
    padding-bottom: 12px;
  }

  .checkbox-item {
    min-height: 36px;
  }

  textarea.form-control {
    min-height: 82px;
  }
}


/* =========================================================
   29. 浏览器兼容与系统偏好
   ========================================================= */


/* 不支持 backdrop-filter 时仍保留正常遮罩 */

@supports not (backdrop-filter: blur(1px)) {
  .dialog::backdrop {
    background: rgba(7, 20, 39, 0.64);
  }
}


/* 用户选择“减少动态效果”时取消非必要动画 */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .loading-spinner {
    animation-duration: 1.4s !important;
    animation-iteration-count: infinite !important;
  }
}


/* =========================================================
   30. 2026-08 界面优化
   方向：编辑部值班簿。减少大色块和悬浮元素，强化排班阅读层级。
   ========================================================= */

:root {
  --color-background: #edf2f6;
  --color-text: #172535;
  --color-text-strong: #102b3f;
  --color-text-secondary: #536477;
  --color-border: #c8d3dd;
  --color-border-light: #dce4eb;
  --color-border-subtle: #e8edf2;
  --color-current-week: #f1f7fb;
  --color-current-week-hover: #e9f3f9;
  --color-today: #dfeefa;
  --color-today-hover: #d5e8f6;
  --color-today-border: #a9cde5;
  --radius-card: 8px;
  --topbar-height: 76px;
}

body {
  line-height: 1.55;
}

.button {
  min-height: 36px;
  padding: 7px 15px;
  border-radius: 4px;
  font-size: 15px;
  letter-spacing: 0;
  box-shadow: none;
}

.button:hover:not(:disabled) {
  box-shadow: 0 2px 7px rgba(12, 55, 110, 0.13);
}

.topbar {
  min-height: var(--topbar-height);
  background: #0b3158;
  border-bottom: 3px solid #2786b8;
  box-shadow: 0 2px 10px rgba(18, 42, 66, 0.12);
}

.topbar__inner {
  min-height: 73px;
}

.topbar__title-area h1 {
  font-size: 24px;
  letter-spacing: 0;
}

.last-updated {
  margin-top: 3px;
  color: #bcd0e1;
  font-size: 13px;
}

.topbar__actions {
  gap: 8px;
}

.topbar__actions .button {
  min-width: 84px;
  min-height: 36px;
}

.topbar .button--outline {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.42);
}

.topbar .button--primary {
  color: #0b3158;
  box-shadow: none;
}

.main-content {
  padding-top: 17px;
  padding-bottom: 42px;
}

.duty-explanation {
  min-height: 42px;
  margin-bottom: 13px;
  padding-top: 7px;
  padding-bottom: 7px;
  color: #46596b;
  background: #f9fbfc;
  border-color: #cbd7e1;
  border-left: 4px solid #2786b8;
  border-radius: 4px;
  box-shadow: none;
  font-size: 14px;
  gap: 10px;
}

.duty-explanation strong {
  color: #163b5b;
}

.duty-explanation span {
  padding-right: 10px;
}

.week-overview {
  overflow: visible;
  border-color: #c7d5e0;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 8px 24px rgba(24, 53, 79, 0.08);
}

.week-overview__heading {
  min-height: 92px;
  padding: 14px 20px;
  background: #17527d;
  border-radius: 7px 7px 0 0;
  gap: 20px;
}

.week-overview__eyebrow {
  margin-bottom: 2px;
  color: #bcd9ea;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}

.week-overview__heading h2 {
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: 0;
}

.week-overview__range {
  margin-top: 3px;
  color: #e0edf5;
  font-size: 13px;
}

.week-navigation {
  gap: 7px;
}

.week-navigation .button {
  min-width: 78px;
  min-height: 34px;
  padding: 6px 12px;
  font-size: 14px;
}

.week-overview__heading .button--outline {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.48);
}

.week-overview__heading .button--primary {
  color: #164c72;
  background: #e8f2f8;
  border-color: #e8f2f8;
}

.week-table th,
.schedule-table th {
  height: 36px;
  padding: 7px 8px;
  color: #405267;
  background: #f2f6f9;
  border-bottom-color: #c5d2dc;
  font-size: 13px;
  font-weight: 600;
}

.week-table td,
.schedule-table td {
  height: 37px;
  padding: 6px 8px;
  font-size: 14px;
  line-height: 1.35;
}

.week-table .cell-date,
.schedule-table .cell-date {
  font-size: 15px;
}

.week-table .cell-weekday,
.schedule-table .cell-weekday,
.week-table .cell-note,
.schedule-table .cell-note {
  font-size: 13px;
}

.week-table th:nth-child(3),
.week-table th:nth-child(4) {
  width: 18%;
}

.week-table th:nth-child(5) {
  width: 15%;
}

.week-table th:nth-child(6) {
  width: 15%;
}

.week-table th:nth-child(7) {
  width: 13%;
}

.schedule-table col.col-primary,
.schedule-table col.col-secondary {
  width: 18%;
}

.schedule-table col.col-producer,
.schedule-table col.col-holiday {
  width: 15%;
}

.schedule-table col.col-note {
  width: 13%;
}

.week-divider-row .week-divider-cell {
  position: relative;
  height: 31px;
  padding: 0 18px;
  color: #2f5875;
  background: #e6f0f6;
  border-top: 1px solid #c3d8e5;
  border-bottom: 1px solid #c3d8e5;
  font-size: 13px;
  font-weight: 400;
  line-height: 29px;
  letter-spacing: 0;
}

.week-divider-row:hover .week-divider-cell {
  background: #e6f0f6;
}

.week-divider-label {
  margin-right: 9px;
  color: #164f77;
  font-weight: 700;
}

.week-divider-range {
  color: #617789;
  font-variant-numeric: tabular-nums;
}

.week-table tr.is-today td:first-child,
.schedule-table tr.is-today td:first-child {
  box-shadow: inset 4px 0 0 #1e7fb2;
}

.week-table .cell-date .day-labels,
.schedule-table .cell-date .day-labels {
  position: static;
  display: inline-flex;
  width: auto;
  margin-left: 6px;
  vertical-align: 1px;
  transform: none;
}

.week-table .cell-date .day-labels:empty,
.schedule-table .cell-date .day-labels:empty {
  display: none;
  margin: 0;
}

.week-table .cell-date .status-badge,
.schedule-table .cell-date .status-badge {
  width: auto;
  min-width: 0;
  min-height: 18px;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  line-height: 1.4;
}

.week-table .cell-date .status-badge--today,
.schedule-table .cell-date .status-badge--today {
  color: #15547a;
  background: #ffffff;
  border-color: #75acd0;
  box-shadow: none;
}

.week-table tr.is-current-week-start.is-today td,
.schedule-table tr.is-current-week-start.is-today td {
  height: 37px;
}

.full-schedule-details {
  width: 100%;
  margin-top: 0;
}

.full-schedule-details > summary {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 10px 20px;
  color: #245574;
  background: #f8fafc;
  border: 1px solid #c7d5e0;
  border-top: 0;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 24px rgba(24, 53, 79, 0.08);
  font-size: 13px;
  text-align: center;
}

.full-schedule-details > summary {
  list-style: none;
}

.full-schedule-details > summary::-webkit-details-marker {
  display: none;
}

.full-schedule-details > summary::before {
  display: inline-block;
  margin-right: 7px;
  color: #3385af;
  content: "▾";
  font-size: 11px;
  transform: rotate(-90deg);
  transition: transform 0.15s ease;
}

.full-schedule-details[open] > summary::before {
  transform: rotate(0deg);
}

.full-schedule-details > summary:hover {
  color: #123f5e;
  background: #eef5f9;
  border-color: #b5cad8;
  box-shadow: 0 8px 24px rgba(24, 53, 79, 0.08);
  transform: none;
}

.full-schedule-details__open {
  display: none;
}

.full-schedule-details[open] > summary {
  margin-top: 14px;
  margin-bottom: 16px;
  border-top: 1px solid #c7d5e0;
  border-radius: 8px;
}

.full-schedule-details[open] .full-schedule-details__closed {
  display: none;
}

.full-schedule-details[open] .full-schedule-details__open {
  display: inline;
}

.schedule-content {
  gap: 18px;
}

.month-section {
  border-color: #cbd7e1;
  border-radius: 8px;
  box-shadow: 0 5px 18px rgba(24, 53, 79, 0.06);
}

.month-heading {
  min-height: 46px;
  padding: 9px 18px;
  color: #173b56;
  background: #e8f0f5;
  border-bottom: 1px solid #c8d6e0;
  border-radius: 7px 7px 0 0;
}

.month-heading h2,
.month-heading h3 {
  color: #173b56;
  font-size: 18px;
  letter-spacing: 0;
}

.month-heading__meta {
  color: #657787;
  font-size: 12px;
}

.month-heading__title {
  gap: 9px;
}

.month-heading .month-badge,
.month-heading .month-badge--query {
  position: static;
  width: auto;
  min-height: 19px;
  padding: 1px 6px;
  color: #15547a;
  background: #ffffff;
  border-color: #83aec9;
  border-radius: 3px;
  box-shadow: none;
  transform: none;
}

.month-heading .month-badge--query {
  color: #7a520d;
  background: #fff8e8;
  border-color: #d8bd7f;
}

.dialog {
  border: 1px solid #aebdca;
  border-radius: 7px;
  box-shadow: 0 22px 60px rgba(11, 35, 57, 0.25);
}

.dialog::backdrop {
  background: rgba(10, 28, 44, 0.52);
  backdrop-filter: blur(2px);
}

.dialog__header {
  min-height: 66px;
  padding: 14px 18px 13px;
  background: #f1f5f8;
  border-bottom-color: #c8d4de;
}

.dialog__header h2 {
  color: #163b57;
  font-size: 20px;
  letter-spacing: 0;
}

.dialog__subtitle {
  font-size: 13px;
}

.dialog__footer {
  min-height: 59px;
  padding: 10px 18px;
  background: #f5f7f9;
}

.icon-button {
  width: 34px;
  height: 34px;
  border-width: 1px;
  border-radius: 4px;
  font-size: 23px;
}

.state-panel {
  border-radius: 8px;
  box-shadow: 0 5px 18px rgba(24, 53, 79, 0.06);
}

@media (max-width: 1365px) {
  :root {
    --topbar-height: 72px;
  }

  .topbar__inner {
    min-height: 69px;
  }

  .topbar__title-area h1 {
    font-size: 22px;
  }

  .main-content {
    padding-top: 14px;
  }

  .duty-explanation {
    min-height: 39px;
    margin-bottom: 11px;
    padding-top: 6px;
    padding-bottom: 6px;
    font-size: 13px;
  }

  .week-overview__heading {
    min-height: 84px;
    padding: 12px 18px;
  }

  .week-overview__heading h2 {
    font-size: 20px;
  }

  .week-table th,
  .schedule-table th {
    height: 34px;
    padding: 6px;
    font-size: 12px;
  }

  .week-table td,
  .schedule-table td {
    height: 35px;
    padding: 5px 6px;
    font-size: 14px;
  }

  .week-table .cell-date,
  .schedule-table .cell-date {
    font-size: 14px;
  }

  .week-table .cell-weekday,
  .schedule-table .cell-weekday,
  .week-table .cell-note,
  .schedule-table .cell-note {
    font-size: 12px;
  }

  .week-divider-row .week-divider-cell {
    height: 29px;
    font-size: 12px;
    line-height: 27px;
  }

  .week-table tr.is-current-week-start.is-today td,
  .schedule-table tr.is-current-week-start.is-today td {
    height: 35px;
  }
}

@media (max-height: 760px) {
  .dialog__header {
    min-height: 62px;
    padding-top: 12px;
    padding-bottom: 11px;
  }

  .dialog__footer {
    min-height: 56px;
    padding-top: 9px;
    padding-bottom: 9px;
  }
}


/* =========================================================
   31. 打印样式
   ========================================================= */

@media print {
  @page {
    size: A4 landscape;
    margin: 10mm;
  }

  :root {
    --page-min-width: 0;
    --content-min-width: 0;
    --content-width: 100%;
    --schedule-min-width: 0;
  }

  html,
  body {
    min-width: 0;
    min-height: 0;
    color: #000000;
    background: #ffffff;
    font-size: 9pt;
  }

  body {
    margin: 0;
  }

  .site-shell,
  .main-content {
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
  }


  /* 打印时不显示网页操作组件 */

  .topbar,
  .duty-explanation,
  .state-panel,
  .week-navigation,
  .full-schedule-details > summary,
  .day-labels,
  .month-badge,
  .cell-action,
  .col-action,
  .day-edit-button,
  .admin-action,
  .toast,
  dialog,
  .button {
    display: none !important;
  }


  /* 打印时完整排班内容正常显示 */

  .full-schedule-details,
  .full-schedule-details[open] {
    display: block !important;
    width: 100%;
    margin: 0;
  }

  .full-schedule-details > .schedule-content,
  .schedule-content {
    display: block !important;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
  }


  /* 首页两周总览 */

  .week-overview {
    width: 100%;
    margin: 0 0 8mm;
    overflow: visible;
    border: 1px solid #7c8794;
    border-radius: 0;
    box-shadow: none;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .week-overview__heading {
    min-height: 0;
    padding: 7px 10px;
    color: #000000;
    background: #e8edf3 !important;
    border-bottom: 1px solid #7c8794;
    border-radius: 0;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .week-overview__eyebrow {
    display: none;
  }

  .week-overview__heading h2 {
    color: #000000;
    font-size: 13pt;
  }

  .week-overview__range {
    margin-top: 2px;
    color: #333333;
    font-size: 8.5pt;
  }

  .week-table-wrapper,
  .schedule-table-wrapper {
    width: 100%;
    overflow: visible;
  }

  .week-table,
  .schedule-table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    border-collapse: collapse;
    color: #000000;
  }

  .week-table th,
  .schedule-table th {
    height: auto;
    padding: 4px 3px;
    color: #000000;
    background: #edf1f5 !important;
    border: 1px solid #8d969f;
    font-size: 7.5pt;
    font-weight: 700;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .week-table td,
  .schedule-table td {
    height: auto;
    padding: 3px;
    color: #000000;
    background: #ffffff !important;
    border: 1px solid #adb4bc;
    font-size: 7.5pt;
    line-height: 1.3;
  }

  .week-table .cell-date,
  .schedule-table .cell-date {
    color: #000000;
    font-size: 8pt;
    font-weight: 700;
  }

  .week-table .cell-weekday,
  .schedule-table .cell-weekday,
  .week-table .cell-note,
  .schedule-table .cell-note {
    color: #333333;
    font-size: 7pt;
  }

  .week-table .cell-person,
  .schedule-table .cell-person {
    color: #000000;
  }

  .week-divider-row .week-divider-cell {
    height: auto;
    padding: 4px;
    color: #000000;
    background: #dfe6ee !important;
    border: 1px solid #8d969f;
    font-size: 7.5pt;
    line-height: 1.3;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }


  /* 所有排班状态在黑白打印下保持清楚 */

  .week-table tr.is-today td,
  .schedule-table tr.is-today td {
    background: #dbe9f7 !important;
    font-weight: 700;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .week-table tr.is-current-week:not(.is-today) td,
  .schedule-table tr.is-current-week:not(.is-today) td {
    background: #eef4fa !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .week-table tr.is-holiday:not(.is-current-week):not(.is-today) td,
  .schedule-table tr.is-holiday:not(.is-current-week):not(.is-today) td {
    background: #f7eeee !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .week-table
  tr.is-adjusted-workday:not(.is-current-week):not(.is-today)
  td,
  .schedule-table
  tr.is-adjusted-workday:not(.is-current-week):not(.is-today)
  td {
    background: #f7f1df !important;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .week-table tr.is-today td:first-child,
  .schedule-table tr.is-today td:first-child {
    border-left: 3px solid #000000;
    box-shadow: none;
  }

  .schedule-table tr.is-current-week td:first-child {
    border-left: 2px solid #555555;
  }


  /* 月份卡片 */

  .month-section {
    display: block;
    width: 100%;
    margin: 0 0 7mm;
    overflow: visible;
    border: 1px solid #7c8794;
    border-radius: 0;
    box-shadow: none;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .month-heading {
    min-height: 0;
    padding: 6px 9px;
    color: #000000;
    background: #dfe7f0 !important;
    border-bottom: 1px solid #7c8794;
    border-radius: 0;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  .month-heading h2,
  .month-heading h3 {
    color: #000000;
    font-size: 11pt;
  }

  .month-heading__meta {
    color: #333333;
    font-size: 7.5pt;
  }


  /* 查询定位动画不参与打印 */

  .schedule-table tr.is-query-target,
  .week-table tr.is-query-target {
    animation: none;
    box-shadow: none;
  }
}


/* =========================================================
   快速首屏：两周排班日期骨架
   ========================================================= */
.week-overview[aria-busy="true"] .week-navigation .button {
  pointer-events: none;
}

.is-loading-row .cell-date,
.is-loading-row .cell-weekday {
  color: #60758a;
}

.cell-loading {
  display: inline-block;
  width: min(64%, 4.5rem);
  height: 0.45rem;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    #dfe8f0 20%,
    #eef3f7 50%,
    #dfe8f0 80%
  );
  background-size: 220% 100%;
  animation: duty-loading-sweep 1.35s ease-in-out infinite;
}

.full-schedule-details.is-loading > summary {
  cursor: wait;
  pointer-events: none;
}

@keyframes duty-loading-sweep {
  from {
    background-position: 100% 0;
  }

  to {
    background-position: -100% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cell-loading {
    animation: none;
  }
}

/* =========================================================
   整合版样式表结束
   ========================================================= */
