/* 人力资源管理 / 周报：PC 页面、弹窗与企微 H5 共用样式，类名统一 hrw- 前缀 */
.hrw-page,
.hrw-mobile,
.hrw-dialog {
  --hrw-ink: #1f2937;
  --hrw-ink-2: #344054;
  --hrw-muted: #667085;
  --hrw-faint: #98a2b3;
  --hrw-line: #e4e7ec;
  --hrw-line-2: #f0f2f5;
  --hrw-bg: #f5f6fa;
  --hrw-accent: #7c3aed;
  --hrw-accent-2: #6d28d9;
  --hrw-accent-soft: #f4efff;
  --hrw-warn: #b54708;
  --hrw-warn-soft: #fffaeb;
  --hrw-danger: #d92d20;
  --hrw-danger-soft: #fef3f2;
  --hrw-ok: #067647;
  --hrw-ok-soft: #ecfdf3;
  --hrw-info: #175cd3;
  --hrw-info-soft: #eff8ff;
  --hrw-radius: 10px;
  --hrw-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  color: var(--hrw-ink);
  font-size: 14px;
}

.hrw-page [hidden],
.hrw-mobile [hidden],
.hrw-dialog [hidden] {
  display: none !important;
}

/* 抵消平台全局 input{width:100%} / label{display:grid}，周报内控件按需定宽 */
.hrw-page input[type="checkbox"],
.hrw-page input[type="radio"],
.hrw-dialog input[type="checkbox"],
.hrw-dialog input[type="radio"],
.hrw-mobile input[type="checkbox"],
.hrw-mobile input[type="radio"] {
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
  flex: 0 0 auto;
  accent-color: var(--hrw-accent);
}

.hrw-page input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.hrw-page select,
.hrw-page textarea,
.hrw-dialog input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
.hrw-dialog select,
.hrw-dialog textarea {
  box-sizing: border-box;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
  color: var(--hrw-ink);
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.hrw-page textarea,
.hrw-dialog textarea {
  height: auto;
  min-height: 76px;
  padding: 8px 10px;
  line-height: 1.6;
}

.hrw-page input:focus,
.hrw-page select:focus,
.hrw-page textarea:focus,
.hrw-dialog input:focus,
.hrw-dialog select:focus,
.hrw-dialog textarea:focus {
  outline: none;
  border-color: #b692f6;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.hrw-page input[readonly],
.hrw-dialog input[readonly] {
  background: var(--hrw-line-2);
  color: var(--hrw-muted);
}

.hrw-page button,
.hrw-dialog button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  white-space: nowrap;
}

.hrw-page button:disabled,
.hrw-dialog button:disabled,
.hrw-mobile button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hrw-page button.ghost,
.hrw-dialog button.ghost {
  background: #fff;
  color: var(--hrw-ink-2);
  border: 1px solid #d0d5dd;
}

.hrw-page button.ghost:hover,
.hrw-dialog button.ghost:hover {
  background: #f9fafb;
  filter: none;
}

.hrw-page button.ghost.danger,
.hrw-dialog button.ghost.danger {
  color: var(--hrw-danger);
  border-color: #fda29b;
}

.hrw-dialog button.danger-solid {
  background: var(--hrw-danger);
}

button.hrw-link {
  height: auto;
  padding: 2px 6px;
  border: 0;
  background: transparent;
  color: var(--hrw-accent);
  font-size: 13px;
}

button.hrw-link:hover {
  background: var(--hrw-accent-soft);
  filter: none;
}

button.hrw-link.danger {
  color: var(--hrw-danger);
}

button.hrw-link.danger:hover {
  background: var(--hrw-danger-soft);
}

button.hrw-link.muted {
  color: var(--hrw-muted);
}

/* ---------- 通用文字 ---------- */
.hrw-loading,
.hrw-empty {
  padding: 32px 12px;
  color: var(--hrw-faint);
  text-align: center;
  line-height: 1.8;
}

.hrw-empty-lg {
  padding: 72px 12px;
  background: #fff;
  border: 1px dashed var(--hrw-line);
  border-radius: var(--hrw-radius);
  color: var(--hrw-muted);
}

.hrw-empty-icon {
  font-size: 36px;
  line-height: 1.2;
  margin-bottom: 8px;
}

.hrw-sub {
  color: var(--hrw-muted);
  font-size: 12px;
  font-weight: 400;
}

.hrw-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.hrw-notice {
  margin: 0 0 12px;
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid #fedf89;
  background: var(--hrw-warn-soft);
  color: var(--hrw-warn);
  font-size: 13px;
}

.hrw-notice.info {
  border-color: #b2ddff;
  background: var(--hrw-info-soft);
  color: var(--hrw-info);
}

.hrw-alert {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--hrw-danger-soft);
  color: var(--hrw-danger);
  font-size: 13px;
}

.hrw-ok {
  margin-top: 10px;
  color: var(--hrw-ok);
  font-weight: 500;
}

.hrw-errors {
  margin: 10px 0 0;
  padding: 10px 12px 10px 28px;
  border-radius: 8px;
  background: var(--hrw-danger-soft);
  color: var(--hrw-danger);
  font-size: 13px;
  line-height: 1.8;
  max-height: 220px;
  overflow: auto;
}

/* ---------- 顶部页签 ---------- */
.hrw-topline {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--hrw-line);
}

.hrw-tabs {
  display: flex;
  gap: 4px;
}

.hrw-page .hrw-tabs button {
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--hrw-muted);
  font-size: 14px;
  margin-bottom: -1px;
}

.hrw-page .hrw-tabs button:hover {
  color: var(--hrw-accent);
  filter: none;
}

.hrw-page .hrw-tabs button.active {
  color: var(--hrw-accent);
  border-bottom-color: var(--hrw-accent);
  font-weight: 600;
}

.hrw-cycle-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--hrw-accent-soft);
  color: var(--hrw-accent-2);
  font-size: 12px;
}

.hrw-cycle-chip span {
  color: var(--hrw-muted);
}

.hrw-subtabs {
  display: inline-flex;
  gap: 2px;
  margin-bottom: 14px;
  padding: 3px;
  border-radius: 10px;
  background: #eceef3;
}

.hrw-page .hrw-subtabs button {
  height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--hrw-muted);
}

.hrw-page .hrw-subtabs button:hover {
  color: var(--hrw-ink);
  filter: none;
}

.hrw-page .hrw-subtabs button.active {
  background: #fff;
  color: var(--hrw-accent);
  font-weight: 600;
  box-shadow: var(--hrw-shadow);
}

/* ---------- 卡片 ---------- */
.hrw-panel {
  margin-bottom: 14px;
  background: #fff;
  border: 1px solid var(--hrw-line);
  border-radius: var(--hrw-radius);
  box-shadow: var(--hrw-shadow);
  min-width: 0;
}

.hrw-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--hrw-line-2);
}

.hrw-panel-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--hrw-ink);
}

.hrw-panel-head h3 small {
  display: inline-block;
  min-width: 18px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 9px;
  background: var(--hrw-line-2);
  color: var(--hrw-muted);
  font-size: 12px;
  font-weight: 500;
  text-align: center;
}

.hrw-panel-head p {
  margin: 3px 0 0;
  color: var(--hrw-muted);
  font-size: 12px;
}

.hrw-filter-head {
  flex-wrap: wrap;
}

.hrw-filter-head > .hrw-toolbar {
  margin-bottom: 0;
}

.hrw-panel-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.hrw-panel-body {
  padding: 14px 18px 16px;
}

.hrw-panel-body > .hrw-table-wrap:last-child {
  margin-bottom: 0;
}

/* ---------- 工具栏 / 统计 ---------- */
.hrw-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.hrw-toolbar.compact input {
  flex: 1;
  min-width: 0;
}

.hrw-page .hrw-w-sm { width: 120px; }
.hrw-page .hrw-w-md { width: 180px; }
.hrw-page .hrw-w-lg { width: 240px; }

.hrw-spacer {
  flex: 1;
}

.hrw-year-bar {
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--hrw-line);
  border-radius: var(--hrw-radius);
  box-shadow: var(--hrw-shadow);
  margin-bottom: 14px;
}

.hrw-year-bar strong {
  min-width: 72px;
  text-align: center;
  font-size: 16px;
}

.hrw-page .hrw-year-bar button.ghost[data-year-step] {
  width: 32px;
  padding: 0;
  font-size: 18px;
}

.hrw-stats,
.hrw-import-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.hrw-stats > div,
.hrw-import-summary > div {
  padding: 10px 14px;
  border-radius: 8px;
  background: #f9fafb;
  border: 1px solid var(--hrw-line-2);
}

.hrw-stats span,
.hrw-import-summary span {
  display: block;
  color: var(--hrw-muted);
  font-size: 12px;
}

.hrw-stats strong,
.hrw-import-summary strong {
  font-size: 20px;
  font-weight: 600;
}

.hrw-stats .s-done strong,
.hrw-import-summary .good strong { color: var(--hrw-ok); }
.hrw-stats .s-delayed strong { color: var(--hrw-warn); }
.hrw-stats .s-terminated strong,
.hrw-import-summary .bad strong { color: var(--hrw-danger); }
.hrw-stats .s-planned strong { color: var(--hrw-info); }

/* ---------- 表格 ---------- */
.hrw-table-wrap {
  overflow: auto;
  max-height: 600px;
  border: 1px solid var(--hrw-line);
  border-radius: 8px;
  margin-bottom: 12px;
}

.hrw-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.hrw-table th,
.hrw-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--hrw-line-2);
  text-align: left;
  vertical-align: middle;
  color: var(--hrw-ink-2);
}

.hrw-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f9fafb;
  color: var(--hrw-muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.hrw-table tbody tr:last-child td {
  border-bottom: 0;
}

.hrw-table tbody tr:hover td {
  background: #fafaff;
}

.hrw-table td strong {
  color: var(--hrw-ink);
  font-weight: 500;
}

.hrw-table-empty {
  padding: 36px 12px !important;
  color: var(--hrw-faint) !important;
  text-align: center !important;
}

.hrw-ops {
  white-space: nowrap;
}

.hrw-cell-title {
  min-width: 220px;
}

.hrw-cell-reason {
  max-width: 280px;
  color: var(--hrw-muted) !important;
}

.hrw-cell-reason .hrw-sub {
  display: block;
}

.hrw-message {
  max-width: 420px;
  word-break: break-all;
  color: var(--hrw-muted) !important;
}

.hrw-row-hl td {
  background: #fffcf5;
}

.hrw-row-muted td {
  color: var(--hrw-faint) !important;
  background: #fafafa;
}

.hrw-table .hrw-col-check,
.hrw-table th:has(> input[type="checkbox"]) {
  width: 36px;
  padding-right: 0;
}

.hrw-table input[type="checkbox"] {
  vertical-align: middle;
  cursor: pointer;
  accent-color: var(--hrw-accent);
}

/* ---------- 标签 / 状态点 ---------- */
.hrw-tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  margin-left: 4px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  background: #f2f4f7;
  color: #475467;
  white-space: nowrap;
  vertical-align: middle;
}

.hrw-table td > .hrw-tag:first-child,
.hrw-history-item > .hrw-tag {
  margin-left: 0;
}

.hrw-tag-submitted,
.hrw-tag-draft,
.hrw-tag-planned {
  background: var(--hrw-info-soft);
  color: var(--hrw-info);
}

.hrw-tag-approved,
.hrw-tag-auto_approved,
.hrw-tag-done,
.hrw-tag-confirmed,
.hrw-tag-sent,
.hrw-tag-success,
.hrw-tag-normal {
  background: var(--hrw-ok-soft);
  color: var(--hrw-ok);
}

.hrw-tag-rejected,
.hrw-tag-terminated,
.hrw-tag-failed {
  background: var(--hrw-danger-soft);
  color: var(--hrw-danger);
}

.hrw-tag-delayed,
.hrw-tag-warn,
.hrw-tag-default,
.hrw-tag-running,
.hrw-tag-short_holiday,
.hrw-tag-pre_holiday {
  background: var(--hrw-warn-soft);
  color: var(--hrw-warn);
}

.hrw-tag-leader,
.hrw-tag-info {
  background: var(--hrw-accent-soft);
  color: var(--hrw-accent-2);
}

.hrw-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--hrw-muted);
}

.hrw-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--hrw-faint);
}

.hrw-dot.on {
  color: var(--hrw-ok);
}

.hrw-dot.on::before {
  background: #12b76a;
}

/* ---------- 日历 ---------- */
.hrw-daybar {
  display: inline-flex;
  gap: 3px;
}

.hrw-daybar span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: #f2f4f7;
  color: var(--hrw-faint);
  font-size: 11px;
}

.hrw-daybar span.on {
  background: var(--hrw-accent);
  color: #fff;
}

.hrw-day-picker {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.hrw-day-picker label {
  display: block;
  margin: 0;
  cursor: pointer;
}

.hrw-day-picker input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.hrw-day-picker label span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 0;
  border: 1px solid var(--hrw-line);
  border-radius: 8px;
  background: #fff;
  color: var(--hrw-muted);
  font-size: 12px;
  transition: all 0.15s;
}

.hrw-day-picker label span b {
  color: var(--hrw-ink-2);
  font-size: 13px;
  font-weight: 500;
}

.hrw-day-picker input:checked + span {
  border-color: var(--hrw-accent);
  background: var(--hrw-accent-soft);
  color: var(--hrw-accent-2);
}

.hrw-day-picker input:checked + span b {
  color: var(--hrw-accent-2);
}

/* ---------- 弹窗 ---------- */
.hrw-dialog {
  max-height: calc(100vh - 48px);
  padding: 0;
  border: 0;
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(16, 24, 40, 0.24);
  overflow: hidden;
}

.hrw-dialog::backdrop {
  background: rgba(16, 24, 40, 0.45);
  backdrop-filter: blur(2px);
}

.hrw-dialog-form {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 48px);
}

.hrw-dialog-form > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--hrw-line-2);
}

.hrw-dialog-form > header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.hrw-dialog button.hrw-dialog-x {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--hrw-faint);
  font-size: 22px;
}

.hrw-dialog button.hrw-dialog-x:hover {
  background: var(--hrw-line-2);
  color: var(--hrw-ink);
  filter: none;
}

.hrw-dialog-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 18px 20px;
}

.hrw-dialog-form > footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  border-top: 1px solid var(--hrw-line-2);
  background: #fcfcfd;
}

.hrw-dialog .hrw-footer-left {
  margin-right: auto;
}

.hrw-dialog-sub {
  margin: 16px 0 8px;
  font-size: 14px;
}

.hrw-confirm-text {
  margin: 0;
  color: var(--hrw-ink-2);
  line-height: 1.7;
}

.hrw-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.hrw-form-grid.one {
  grid-template-columns: minmax(0, 1fr);
}

.hrw-form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hrw-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  margin: 0;
  color: var(--hrw-ink-2);
  font-size: 13px;
}

.hrw-field.full {
  grid-column: 1 / -1;
}

.hrw-field > span {
  font-weight: 500;
}

.hrw-field > span em {
  margin-left: 2px;
  color: var(--hrw-danger);
  font-style: normal;
}

.hrw-field > input,
.hrw-field > select,
.hrw-field > textarea {
  width: 100%;
}

.hrw-field > small {
  color: var(--hrw-faint);
  font-size: 12px;
}

.hrw-field-check {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  align-self: end;
  gap: 8px;
  min-height: 36px;
  cursor: pointer;
}

.hrw-field-check > small {
  flex-basis: 100%;
  padding-left: 24px;
  margin-top: -6px;
}

.hrw-steps {
  margin: 0 0 14px;
  padding: 12px 14px 12px 32px;
  border-radius: 8px;
  background: #f9fafb;
  color: var(--hrw-muted);
  font-size: 13px;
  line-height: 1.9;
}

.hrw-upload {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 84px;
  margin: 0 0 14px;
  border: 1.5px dashed #c4b5fd;
  border-radius: 10px;
  background: #fbf9ff;
  color: var(--hrw-accent-2);
  cursor: pointer;
  transition: background 0.15s;
}

.hrw-upload:hover {
  background: var(--hrw-accent-soft);
}

.hrw-upload input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

/* ---------- 两栏布局 ---------- */
.hrw-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}

.hrw-two-col.side-left {
  grid-template-columns: 300px minmax(0, 1fr);
}

.hrw-main {
  min-width: 0;
}

.hrw-main > .hrw-editor,
.hrw-main > .hrw-approval,
.hrw-main > .hrw-digest {
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--hrw-line);
  border-radius: var(--hrw-radius);
  box-shadow: var(--hrw-shadow);
}

.hrw-side {
  position: sticky;
  top: 0;
  min-width: 0;
}

.hrw-side .hrw-panel-body {
  padding: 8px;
}

.hrw-side .hrw-toolbar.compact {
  margin: 4px 4px 8px;
}

.hrw-history {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 460px;
  overflow: auto;
}

.hrw-page button.hrw-history-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 4px 8px;
  width: 100%;
  height: auto;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--hrw-ink);
  text-align: left;
  white-space: normal;
}

.hrw-page button.hrw-history-item:hover {
  background: #f9fafb;
  filter: none;
}

.hrw-page button.hrw-history-item.active {
  background: var(--hrw-accent-soft);
}

.hrw-history-item strong {
  font-weight: 500;
}

.hrw-history-item .hrw-sub {
  flex-basis: 100%;
}

.hrw-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.9;
}

.hrw-list li .hrw-sub,
.hrw-list li .hrw-meta {
  display: block;
}

/* ---------- 填报 / 审批表单（hr-weekly-form.js 渲染） ---------- */
.hrw-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  padding-bottom: 12px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--hrw-line-2);
}

.hrw-banner strong {
  font-size: 16px;
}

.hrw-banner > div:first-child span {
  margin-left: 10px;
  color: var(--hrw-muted);
  font-size: 13px;
}

.hrw-banner > .hrw-sub,
.hrw-banner > .hrw-alert {
  flex-basis: 100%;
}

.hrw-section {
  margin-top: 14px;
}

.hrw-section h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
  padding-left: 10px;
  border-left: 3px solid var(--hrw-accent);
  font-size: 15px;
  line-height: 1.2;
}

.hrw-section h3 small {
  color: var(--hrw-muted);
  font-weight: 400;
  font-size: 12px;
}

.hrw-item {
  margin-bottom: 10px;
  padding: 12px 14px;
  border: 1px solid var(--hrw-line);
  border-radius: 10px;
  background: #fff;
  transition: border-color 0.15s;
}

.hrw-item:hover {
  border-color: #d6bbfb;
}

.hrw-correction {
  background: #fcfaff;
}

.hrw-item-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.hrw-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin: 6px 0;
  color: var(--hrw-muted);
  font-size: 12px;
}

.hrw-meta span {
  padding: 1px 8px;
  border-radius: 4px;
  background: #f2f4f7;
}

.hrw-segs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 4px;
}

.hrw-seg {
  display: inline-block !important;
  margin: 0;
}

.hrw-seg input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.hrw-seg span {
  display: inline-block;
  padding: 5px 16px;
  border: 1px solid #d0d5dd;
  border-radius: 999px;
  background: #fff;
  color: var(--hrw-ink-2);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
}

.hrw-seg input:checked + span {
  border-color: var(--hrw-accent);
  background: var(--hrw-accent);
  color: #fff;
}

.hrw-seg input[value="delayed"]:checked + span {
  border-color: #f79009;
  background: #f79009;
}

.hrw-seg input[value="terminated"]:checked + span,
.hrw-seg input[value="reject"]:checked + span {
  border-color: var(--hrw-danger);
  background: var(--hrw-danger);
}

.hrw-seg input:disabled + span {
  cursor: default;
  opacity: 0.7;
}

.hrw-extra {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f9fafb;
}

.hrw-item label:not(.hrw-check):not(.hrw-seg):not(.hrw-field) {
  display: block;
  margin-top: 6px;
  color: var(--hrw-muted);
  font-size: 12px;
}

.hrw-item input:not([type="checkbox"]):not([type="radio"]),
.hrw-item select,
.hrw-item textarea,
.hrw-section > textarea,
.hrw-section label textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
}

.hrw-mobile .hrw-item input:not([type="checkbox"]):not([type="radio"]),
.hrw-mobile .hrw-item select,
.hrw-mobile .hrw-item textarea,
.hrw-mobile .hrw-section textarea {
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  color: var(--hrw-ink);
}

.hrw-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 12px;
}

.hrw-grid .hrw-wide {
  grid-column: span 2;
}

.hrw-grid .hrw-full {
  grid-column: 1 / -1;
}

/* 上半段：任务名称占剩余宽度，状态 / 新期限 / 负责人介入按内容宽度同排 */
.hrw-grid.hrw-grid-upper {
  grid-template-columns: minmax(200px, 1fr) repeat(3, auto);
  column-gap: 16px;
}

/* 下半段第二行：完成时限 / 优先级 / 协同部门 / 是否需要会议室 同排，协同部门占剩余宽度 */
.hrw-grid.hrw-grid-lower {
  grid-template-columns: auto auto minmax(160px, 1fr) auto;
  column-gap: 16px;
}

.hrw-grid-upper .hrw-date input,
.hrw-grid-lower .hrw-date input {
  width: 160px;
}

@media (max-width: 1100px) {
  .hrw-grid.hrw-grid-upper,
  .hrw-grid.hrw-grid-lower {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

.hrw-grid [hidden] {
  display: none !important;
}

/* 表单栅格内的文本框与单选组统一：标题同一基线、控件同为 36px 高 */
.hrw-item .hrw-grid > label,
.hrw-item .hrw-grid > .hrw-fld {
  display: flex !important;
  flex-direction: column;
  align-items: stretch;
  gap: 0 !important;
  min-width: 0;
  margin-top: 0 !important;
  padding: 0;
}

/* 标题与控件之间统一 6px，文本框与单选组顶部对齐 */
.hrw-item .hrw-grid > label > input,
.hrw-item .hrw-grid > label > select,
.hrw-item .hrw-grid > label > textarea,
.hrw-item .hrw-grid > .hrw-fld > .hrw-segs.sm {
  margin: 6px 0 0 !important;
}

/* 按状态条件显示：必须压过上面的 flex */
.hrw-item .hrw-grid > label[hidden],
.hrw-item .hrw-grid > .hrw-fld[hidden] {
  display: none !important;
}

.hrw-cap {
  display: block;
  margin: 10px 0 0;
  color: var(--hrw-muted);
  font-size: 12px;
  line-height: 18px;
}

.hrw-req {
  color: var(--hrw-danger);
  font-style: normal;
}

/* 单选组：与输入框等高的分段控件 */
.hrw-segs.sm {
  display: flex;
  flex-wrap: nowrap;
  gap: 0;
  box-sizing: border-box;
  align-self: flex-start;
  width: max-content;
  max-width: 100%;
  height: 36px;
  margin: 6px 0 0;
  padding: 3px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #f9fafb;
}

.hrw-segs.sm .hrw-seg {
  position: relative;
  display: flex !important;
  flex: none;
  margin: 0;
}

.hrw-segs.sm .hrw-seg span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 13px;
  white-space: nowrap;
}

.hrw-segs.sm .hrw-seg input:checked + span {
  background: var(--hrw-accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.12);
}

.hrw-segs.sm .hrw-seg input[value="delayed"]:checked + span {
  background: #f79009;
}

.hrw-segs.sm .hrw-seg input[value="terminated"]:checked + span {
  background: var(--hrw-danger);
}

.hrw-segs.sm .hrw-seg input:not(:checked):not(:disabled) + span:hover {
  background: #fff;
  color: var(--hrw-accent);
}

.hrw-segs.sm .hrw-seg input:focus-visible + span {
  outline: 2px solid #b692f6;
  outline-offset: 1px;
}

.hrw-hint {
  display: block;
  margin-top: 3px;
  color: #98a2b3;
  font-size: 12px;
}

.hrw-item-head .hrw-item-remove {
  margin-left: auto;
}

.hrw-item-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.hrw-main-fields input:disabled {
  background: #f9fafb;
  color: var(--hrw-ink-2);
}

.hrw-focus {
  padding: 10px 12px;
  border-radius: 8px;
  background: #f9fafb;
  white-space: pre-wrap;
}

.hrw-section .hrw-add + .hrw-carry:not(:empty) {
  margin-top: 10px;
}

.hrw-checks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
  margin-top: 10px;
}

.hrw-check {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--hrw-ink-2);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}

.hrw-checks .hrw-link.danger {
  margin-left: auto;
}

.hrw-carry {
  color: var(--hrw-accent-2);
  font-size: 13px;
}

.hrw-carry:not(:empty) {
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--hrw-accent-soft);
}

.hrw-page button.hrw-add,
.hrw-mobile button.hrw-add {
  width: 100%;
  height: 40px;
  border: 1.5px dashed #c4b5fd;
  background: #fbf9ff;
  color: var(--hrw-accent);
}

.hrw-page button.hrw-add:hover {
  background: var(--hrw-accent-soft);
  filter: none;
}

.hrw-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.hrw-actions > .hrw-sub {
  margin-right: auto;
}

.hrw-actions.sticky {
  position: sticky;
  bottom: 0;
  z-index: 3;
  padding: 12px 16px;
  border: 1px solid var(--hrw-line);
  border-radius: var(--hrw-radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -4px 16px rgba(16, 24, 40, 0.06);
  backdrop-filter: blur(4px);
}

/* ---------- 报告 ---------- */
.hrw-md {
  margin-top: 12px;
  padding: 16px 18px;
  border-radius: 8px;
  background: #fafbfc;
  line-height: 1.8;
  font-size: 14px;
}

.hrw-md h3 {
  margin: 14px 0 4px;
  font-size: 15px;
}

.hrw-md h3:first-child {
  margin-top: 0;
}

.hrw-md-li {
  padding-left: 10px;
}

.hrw-md-gap {
  height: 8px;
}

.hrw-digest label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
  color: var(--hrw-ink-2);
  font-size: 13px;
}

@media (max-width: 1200px) {
  .hrw-form-grid.three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .hrw-two-col,
  .hrw-two-col.side-left {
    grid-template-columns: minmax(0, 1fr);
  }

  .hrw-side {
    position: static;
  }

  .hrw-topline {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ---------- 企微 H5 ---------- */
body.hrw-mobile {
  margin: 0;
  min-height: 100vh;
  background: var(--hrw-bg);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
}

.hrw-mobile button {
  border: 0;
  background: var(--hrw-accent);
  color: #fff;
  height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  font: inherit;
  font-weight: 500;
}

.hrw-mobile button:active {
  opacity: 0.85;
}

.hrw-mobile button.ghost {
  background: #fff;
  color: var(--hrw-ink-2);
  border: 1px solid #d0d5dd;
}

.hrw-mobile button.ghost.danger {
  color: var(--hrw-danger);
  border-color: #fda29b;
}

.hrw-mobile button.danger-solid {
  background: var(--hrw-danger);
}

.hrw-mobile button.hrw-link {
  height: auto;
  padding: 4px 8px;
  background: transparent;
  color: var(--hrw-accent);
}

.hrw-mobile button.hrw-add {
  height: 44px;
}

/* 顶栏 */
.hrw-m-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 52px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--hrw-line);
  backdrop-filter: blur(8px);
}

.hrw-m-header strong {
  font-size: 17px;
  font-weight: 600;
}

.hrw-m-header #hrwUser {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  color: var(--hrw-muted);
  font-size: 13px;
}

.hrw-m-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #9b6bff, #6d28d9);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
}

.hrw-mobile button.hrw-m-back {
  height: 32px;
  margin-left: -8px;
  padding: 0 8px;
  background: transparent;
  color: var(--hrw-accent);
  font-size: 15px;
}

/* 主体 */
.hrw-m-main {
  padding: 12px;
}

.hrw-m-main > .hrw-editor,
.hrw-m-main > .hrw-approval,
.hrw-m-main > .hrw-digest,
.hrw-m-main > .hrw-banner,
.hrw-m-block {
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--hrw-shadow);
}

.hrw-mobile .hrw-banner {
  border-bottom: 0;
  padding-bottom: 0;
}

.hrw-mobile .hrw-banner > div:first-child span {
  display: block;
  margin: 2px 0 0;
}

.hrw-mobile .hrw-section h3 {
  font-size: 15px;
}

.hrw-mobile .hrw-item {
  padding: 12px;
  border-radius: 12px;
}

.hrw-mobile .hrw-seg span {
  padding: 7px 18px;
  font-size: 14px;
}

.hrw-mobile .hrw-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 10px;
}

.hrw-mobile .hrw-grid .hrw-fld,
.hrw-mobile .hrw-grid > label {
  grid-column: 1 / -1;
}

.hrw-mobile .hrw-grid.hrw-grid-upper,
.hrw-mobile .hrw-grid.hrw-grid-lower {
  grid-template-columns: minmax(0, 1fr);
}

.hrw-mobile .hrw-grid-upper .hrw-date input,
.hrw-mobile .hrw-grid-lower .hrw-date input {
  width: 100%;
}

.hrw-mobile .hrw-cap {
  font-size: 13px;
}

.hrw-mobile .hrw-segs.sm {
  height: 42px;
  border-radius: 10px;
}

.hrw-mobile .hrw-segs.sm .hrw-seg span {
  min-width: 60px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 14px;
}

.hrw-mobile .hrw-item label:not(.hrw-check):not(.hrw-seg) {
  font-size: 13px;
}

.hrw-mobile .hrw-item input:not([type="checkbox"]):not([type="radio"]),
.hrw-mobile .hrw-item select,
.hrw-mobile .hrw-item textarea,
.hrw-mobile .hrw-section textarea,
.hrw-mobile .hrw-digest textarea,
.hrw-sheet textarea,
.hrw-sheet input {
  box-sizing: border-box;
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  background: #fff;
  color: var(--hrw-ink);
  font: inherit;
  font-size: 15px;
  -webkit-appearance: none;
  appearance: none;
}

.hrw-mobile textarea {
  min-height: 84px;
  line-height: 1.6;
  resize: vertical;
}

.hrw-mobile input:focus,
.hrw-mobile select:focus,
.hrw-mobile textarea:focus,
.hrw-sheet textarea:focus {
  outline: none;
  border-color: #b692f6;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.hrw-mobile .hrw-check {
  font-size: 14px;
}

.hrw-mobile .hrw-actions.sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(60px + env(safe-area-inset-bottom));
  margin: 0;
  padding: 10px 12px;
  border-radius: 0;
  border: 0;
  border-top: 1px solid var(--hrw-line);
}

.hrw-mobile .hrw-actions.sticky button {
  flex: 1;
}

.hrw-mobile .hrw-actions.sticky button.ghost {
  flex: 0 0 34%;
}

.hrw-mobile .hrw-actions.sticky .hrw-sub {
  display: none;
}

.hrw-mobile .hrw-m-main:has(.hrw-actions.sticky) {
  padding-bottom: 76px;
}

.hrw-m-deadline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #7c3aed, #9b6bff);
  color: #fff;
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.25);
}

.hrw-m-deadline span {
  opacity: 0.85;
  font-size: 13px;
}

.hrw-m-deadline strong {
  font-size: 16px;
}

.hrw-m-deadline.late {
  background: linear-gradient(135deg, #f04438, #f97066);
  box-shadow: 0 6px 16px rgba(240, 68, 56, 0.25);
}

/* 列表卡片 */
.hrw-m-group {
  margin-bottom: 18px;
}

.hrw-m-group h4 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 4px 10px;
  color: var(--hrw-muted);
  font-size: 13px;
  font-weight: 500;
}

.hrw-m-group h4 small {
  padding: 0 7px;
  border-radius: 9px;
  background: var(--hrw-accent-soft);
  color: var(--hrw-accent-2);
  font-size: 12px;
}

.hrw-m-group > .hrw-item {
  box-shadow: var(--hrw-shadow);
}

.hrw-mobile button.hrw-m-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  width: 100%;
  height: auto;
  margin-bottom: 10px;
  padding: 14px 36px 14px 16px;
  text-align: left;
  background: #fff;
  color: var(--hrw-ink);
  border: 0;
  border-radius: 14px;
  box-shadow: var(--hrw-shadow);
  font-weight: 400;
}

.hrw-m-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.hrw-m-card-head strong {
  font-size: 16px;
  font-weight: 600;
}

.hrw-m-arrow {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--hrw-faint);
  font-size: 22px;
  font-style: normal;
}

.hrw-m-counts {
  display: flex;
  gap: 14px;
  margin-top: 4px;
  color: var(--hrw-muted);
  font-size: 12px;
}

.hrw-m-counts b {
  color: var(--hrw-ink);
  font-size: 14px;
}

.hrw-m-progress {
  height: 6px;
  margin-top: 8px;
  border-radius: 3px;
  background: #eef0f4;
  overflow: hidden;
}

.hrw-m-progress i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #12b76a, #32d583);
}

/* 空状态 / 骨架屏 */
.hrw-m-empty {
  padding: 72px 24px 24px;
  text-align: center;
  color: var(--hrw-muted);
}

.hrw-m-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--hrw-shadow);
  font-size: 32px;
}

.hrw-m-empty p {
  margin: 0 0 6px;
  color: var(--hrw-ink);
  font-size: 16px;
  font-weight: 500;
}

.hrw-m-empty span {
  font-size: 13px;
}

.hrw-m-center {
  text-align: center;
}

.hrw-m-skeleton i {
  display: block;
  height: 76px;
  margin-bottom: 10px;
  border-radius: 14px;
  background: linear-gradient(90deg, #eceef2 25%, #f6f7f9 50%, #eceef2 75%);
  background-size: 200% 100%;
  animation: hrw-shimmer 1.2s infinite;
}

@keyframes hrw-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* 底部导航 */
.hrw-m-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  display: flex;
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid var(--hrw-line);
  backdrop-filter: blur(8px);
}

.hrw-mobile .hrw-m-tabbar button {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 60px;
  padding: 0;
  background: transparent;
  color: var(--hrw-faint);
  border-radius: 0;
  font-size: 11px;
  font-weight: 400;
}

.hrw-m-tabbar i {
  position: relative;
  display: block;
  width: 24px;
  height: 24px;
}

.hrw-m-tabbar svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hrw-m-tabbar i b {
  position: absolute;
  top: -4px;
  left: 16px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #f04438;
  color: #fff;
  font-size: 10px;
  font-style: normal;
  line-height: 16px;
  text-align: center;
  box-sizing: border-box;
}

.hrw-mobile .hrw-m-tabbar button.active {
  color: var(--hrw-accent);
  font-weight: 600;
}

/* 底部弹出面板 */
.hrw-sheet {
  position: fixed;
  inset: auto 0 0 0;
  width: 100%;
  max-width: 100%;
  max-height: 80vh;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 18px 18px 0 0;
  background: #fff;
  box-shadow: 0 -8px 32px rgba(16, 24, 40, 0.18);
  animation: hrw-sheet-up 0.22s ease-out;
}

.hrw-sheet::backdrop {
  background: rgba(16, 24, 40, 0.45);
}

@keyframes hrw-sheet-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.hrw-sheet form {
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
}

.hrw-sheet-handle {
  width: 36px;
  height: 4px;
  margin: 0 auto 12px;
  border-radius: 2px;
  background: #d0d5dd;
}

.hrw-sheet h3 {
  margin: 0 0 12px;
  font-size: 17px;
  text-align: center;
}

.hrw-sheet-body {
  margin-bottom: 16px;
}

.hrw-sheet-text {
  margin: 0;
  color: var(--hrw-ink-2);
  font-size: 15px;
  line-height: 1.7;
  text-align: center;
}

.hrw-sheet-text .warn {
  color: var(--hrw-danger);
  font-weight: 500;
}

.hrw-sheet-actions {
  display: flex;
  gap: 10px;
}

.hrw-sheet-actions button {
  flex: 1;
}

.hrw-m-toast {
  position: fixed;
  inset: auto;
  margin: 0;
  border: 0;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  z-index: 2147483647;
  max-width: 76vw;
  padding: 12px 20px;
  border-radius: 12px;
  background: rgba(16, 24, 40, 0.88);
  color: #fff;
  font-size: 15px;
  text-align: center;
}

/* 周报台账分页 */
.hrw-page .hrw-pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.hrw-page .hrw-pager select { width: auto; min-width: 96px; height: 32px; padding: 0 8px; }
.hrw-page .hrw-pager button { height: 32px; padding: 0 12px; }

/* 往期补填提示 */
.hrw-page .hrw-notice .hrw-link { margin: 0 2px; font-weight: 600; text-decoration: underline; }
.hrw-notice.warn { border-color: #fedf89; background: #fffaeb; color: #b54708; }

/* 筛选框清空按钮 */
.hrw-page .hrw-clearable { position: relative; display: inline-flex; align-items: center; }
.hrw-page .hrw-toolbar.compact .hrw-clearable { flex: 1; min-width: 0; }
.hrw-page .hrw-clearable > input { width: 100%; padding-right: 30px; }
.hrw-page .hrw-clear-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; min-height: 0; padding: 0; border: 0; border-radius: 50%;
  background: #d0d5dd; color: #fff; font-size: 14px; line-height: 20px; text-align: center; cursor: pointer; box-shadow: none;
}
.hrw-page .hrw-clear-btn:hover { background: #98a2b3; }
.hrw-page .hrw-clear-btn[hidden] { display: none; }

/* 铺满可视区域的列表面板（人员名单 / 差异待确认）：表格区域自适应高度并内部滚动，分页条固定在底部 */
.hrw-panel.hrw-panel-fill { display: flex; flex-direction: column; margin-bottom: 0; }
.hrw-panel-fill > .hrw-panel-head { flex: none; }
.hrw-panel-fill > .hrw-panel-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.hrw-panel-fill > .hrw-panel-body > .hrw-toolbar { flex: none; }
.hrw-panel-fill > .hrw-panel-body > .hrw-table-wrap { flex: 1; min-height: 0; max-height: none; margin-bottom: 0; }
.hrw-page .hrw-panel-fill .hrw-pager { flex: none; }
