* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f6f7f9;
  color: #18202f;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.site-record {
  padding: 18px 16px 24px;
  color: #6c7688;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.site-record a {
  color: inherit;
  text-decoration: none;
}

.site-record a:hover,
.site-record a:focus-visible {
  color: #2864d8;
  text-decoration: underline;
}

button,
input,
select {
  font: inherit;
}

.hidden {
  display: none !important;
}

.login {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  max-width: 920px;
  min-height: 100vh;
  margin: 0 auto;
  align-items: center;
  padding: 32px;
}

.login h1,
header h1 {
  margin: 6px 0 0;
}

.eyebrow {
  margin: 0;
  color: #2864d8;
  font-size: 13px;
  font-weight: 700;
}

.muted {
  color: #6c7688;
}

.notice {
  border-radius: 8px;
  padding: 12px 14px;
  margin: 14px 0;
  font-weight: 700;
}

.notice.ok {
  border: 1px solid #bde5cd;
  background: #edf9f1;
  color: #17633a;
}

.notice.warning {
  border: 1px solid #ffd08a;
  background: #fff8e8;
  color: #6f4a00;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.stat-grid > div {
  border: 1px solid #e4e7ee;
  border-radius: 8px;
  background: #f8fafc;
  padding: 14px;
}

.stat-grid strong {
  display: block;
  font-size: 24px;
  overflow-wrap: anywhere;
}

.stat-grid span {
  color: #6c7688;
}

.stat-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(140px, 220px));
}

.empty {
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 18px;
  color: #6c7688;
  background: #f8fafc;
}

form,
.panel {
  background: #fff;
  border: 1px solid #e4e7ee;
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 14px 36px rgba(18, 31, 56, 0.08);
}

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 16px;
  border-color: #fecaca;
  background: #fff7f7;
}

.danger-zone h2,
.danger-zone p {
  margin: 0;
}

.danger-zone p {
  margin-top: 5px;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: #3a4353;
}

label.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

label.check.selected {
  border-radius: 6px;
  background: #e8f0ff;
  color: #1d4ed8;
}

input,
select {
  width: 100%;
  border: 1px solid #d5dae4;
  border-radius: 6px;
  padding: 10px 12px;
  background: #fff;
}

input[type="checkbox"] {
  width: auto;
}

button,
.mobile-link {
  border: 0;
  border-radius: 6px;
  background: #2864d8;
  color: #fff;
  padding: 10px 14px;
  text-decoration: none;
  cursor: pointer;
}

.header-actions {
  display: grid;
  grid-template-columns: minmax(220px, 320px) auto;
  gap: 10px;
  align-items: end;
}

.header-actions label {
  display: grid;
  gap: 6px;
  color: #657186;
  font-size: 13px;
  font-weight: 700;
}

button.secondary,
.secondary {
  background: #e8edf6;
  color: #22304a;
}

button.danger {
  background: #f3dede;
  color: #8d1e1e;
}

button.small {
  padding: 7px 10px;
  font-size: 14px;
}

a.as-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  text-decoration: none;
}

a.as-button.small {
  padding: 7px 10px;
  font-size: 14px;
}

a.as-button.secondary {
  background: #e8edf6;
  color: #22304a;
}

button.icon-button {
  min-width: 32px;
  padding: 7px 8px;
  font-weight: 800;
}

button:disabled,
.mobile-link:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
  align-items: start;
}

aside {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 100vh;
  max-height: 100vh;
  overflow: auto;
  background: #172033;
  color: #fff;
  padding: 22px;
}

aside h2 {
  font-size: 18px;
  margin: 0 0 24px;
}

aside button {
  width: 100%;
  margin-bottom: 8px;
  text-align: left;
  background: transparent;
  color: #c9d2e3;
}

aside button.active {
  background: #2864d8;
  color: #fff;
}

.content {
  min-width: 0;
  padding: 0 24px 24px;
}

header {
  position: sticky;
  top: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 -24px 20px;
  padding: 18px 24px;
  border-bottom: 1px solid #e4e7ee;
  background: rgba(246, 247, 249, 0.96);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 24px rgba(18, 31, 56, 0.06);
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.task-stat-row {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
}

.task-stat-row .stat {
  min-height: 74px;
}

.stat {
  background: #fff;
  border: 1px solid #e4e7ee;
  border-radius: 8px;
  padding: 18px;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #e4e7ee;
  border-radius: 6px;
  overflow: hidden;
}

th,
td {
  border-bottom: 1px solid #edf0f5;
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f2f5fa;
  color: #4b5568;
  font-weight: 700;
  white-space: nowrap;
}

.active-row {
  background: #f3f7ff;
}

.department-name {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 220px;
}

.tree-spacer {
  display: inline-block;
  width: 32px;
  flex: 0 0 32px;
}

.mini-chip {
  display: inline-block;
  border: 1px solid #dce3ee;
  border-radius: 999px;
  background: #f3f6fb;
  color: #354258;
  padding: 3px 7px;
  margin: 0 5px 5px 0;
  font-size: 12px;
  font-weight: 700;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

.compact-actions {
  margin: 0;
  justify-content: flex-end;
}

.department-sticky-tools {
  position: sticky;
  top: var(--department-tools-top, 92px);
  z-index: 20;
  margin: 0 -2px 0;
  padding: 14px 2px 12px;
  border-bottom: 1px solid #e4e7ee;
  background: rgba(246, 247, 249, 0.96);
  backdrop-filter: blur(10px);
}

.department-table-shell {
  padding-bottom: 8px;
}

.department-grid {
  min-width: 1040px;
  border: 1px solid #e4e7ee;
  border-radius: 8px;
  background: #fff;
}

.department-grid-head,
.department-grid-row {
  display: grid;
  grid-template-columns: 52px minmax(220px, 1.6fr) minmax(130px, 1fr) 74px 100px 132px 78px minmax(110px, 1fr) 188px;
}

.department-grid-head {
  position: sticky;
  top: var(--department-table-head-top, 156px);
  z-index: 24;
  background: #f2f5fa;
  color: #4b5568;
  font-weight: 700;
  box-shadow: 0 1px 0 #dfe5ee, 0 8px 18px rgba(18, 31, 56, 0.08);
}

.department-grid-head > div,
.department-grid-row > div {
  min-width: 0;
  border-bottom: 1px solid #edf0f5;
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

.department-grid-row > div {
  background: #fff;
}

.department-grid-row:last-child > div {
  border-bottom: 0;
}

.department-row-actions {
  display: flex;
  width: 188px;
  min-width: 188px;
  flex-wrap: nowrap !important;
  gap: 5px;
  align-items: center;
  white-space: nowrap;
  overflow: visible;
}

.department-row-actions button.small {
  padding: 6px 7px;
  font-size: 13px;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) minmax(160px, 220px);
  gap: 10px;
  margin: 0 0 14px;
}

.task-filter-toolbar {
  grid-template-columns: repeat(3, minmax(150px, 180px)) minmax(220px, 1fr);
  align-items: center;
  overflow-x: auto;
}

.task-filter-toolbar input,
.task-filter-toolbar select {
  min-width: 0;
  width: 100%;
}

#users .toolbar {
  grid-template-columns: minmax(420px, 1fr);
  width: 100%;
}

#users .toolbar input {
  min-width: 0;
  width: 100%;
}

.dropdown-check {
  position: relative;
}

.dropdown-check summary {
  display: block;
  min-height: 40px;
  border: 1px solid #d5dae4;
  border-radius: 6px;
  background: #fff;
  padding: 10px 34px 10px 12px;
  color: #172033;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropdown-check summary::-webkit-details-marker {
  display: none;
}

.dropdown-check summary::after {
  content: "⌄";
  position: absolute;
  right: 12px;
  top: 10px;
  color: #657186;
}

.dropdown-check[open] summary {
  border-color: #2f6df6;
  box-shadow: 0 0 0 3px rgba(47, 109, 246, 0.12);
}

.dropdown-check-panel {
  margin-top: 8px;
  max-height: 220px;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #fff;
  padding: 10px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0;
  color: #657186;
  font-size: 14px;
}

.pagination-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.pagination-info label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: #334155;
  font-weight: 700;
}

.pagination-info select {
  min-width: 92px;
  padding: 7px 9px;
}

.pagination-buttons {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.form-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.48);
}

.form-modal-card {
  width: min(960px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.22);
}

.form-modal-card-wide {
  width: min(1120px, 100%);
}

.import-mode-card {
  width: min(720px, 100%);
}

.form-modal-card .inline-form {
  margin: 0;
  border: 0;
  background: #fff;
}

.form-modal-card .modal-actions {
  position: sticky;
  bottom: 0;
  margin: 16px -16px -16px;
  padding: 12px 16px;
  border-top: 1px solid #e2e8f0;
  background: #fff;
}

.import-mode-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.import-mode-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin: 0;
  padding: 12px;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #f8fafc;
  cursor: pointer;
}

.import-mode-option input {
  width: auto;
  margin-top: 3px;
}

.import-mode-option strong,
.import-mode-option small {
  display: block;
}

.import-mode-option small {
  margin-top: 4px;
  color: #64748b;
  line-height: 1.45;
}

@media (max-width: 720px) {
  .form-modal {
    align-items: flex-start;
    padding: 12px;
  }

  .form-modal-card {
    max-height: calc(100vh - 24px);
  }
}

.page-gap {
  color: #8a94a8;
  padding: 0 4px;
}

.empty.compact {
  padding: 12px 14px;
  margin: 10px 0;
}

.inline-form {
  margin: 12px 0 18px;
  border-color: #9fb8e8;
  border-left: 5px solid #2864d8;
  background: #f8fbff;
  box-shadow: 0 10px 24px rgba(40, 100, 216, 0.1);
}

.inline-form h2 {
  margin: -4px 0 16px;
  font-size: 18px;
  color: #163b82;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.field {
  display: grid;
  gap: 8px;
  color: #3a4353;
}

.field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  border: 1px solid #d5dae4;
  border-radius: 6px;
  padding: 10px 12px;
  background: #fbfcfe;
}

.remark-editor {
  border: 1px solid #e4e7ee;
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfe;
}

.employment-editor {
  border: 1px solid #e4e7ee;
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfe;
}

.employment-relation-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 220px) auto;
  gap: 10px;
  align-items: end;
  margin-top: 10px;
}

.selector-editor {
  border: 1px solid #d8deea;
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.selector-editor label {
  display: grid;
  gap: 8px;
}

.search-select {
  display: grid;
  gap: 8px;
}

.search-select-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.search-select select {
  min-height: 132px;
}

.search-select-options {
  display: grid;
  gap: 6px;
  max-height: 180px;
  overflow: auto;
  border: 1px solid #d8deea;
  border-radius: 6px;
  background: #fff;
  padding: 8px;
}

.search-select-options .check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border-radius: 6px;
}

.search-select-options .check:hover {
  background: #f3f6fb;
}

.search-select-options .hidden {
  display: none;
}

.inline-suggest {
  display: grid;
  gap: 6px;
}

.thumb {
  display: block;
  width: 92px;
  height: 52px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 6px;
  border: 1px solid #d8deea;
}

.image-preview {
  display: flex;
  align-items: center;
  gap: 10px;
}

.image-preview img {
  width: 180px;
  height: 96px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #d8deea;
}

.remark-row {
  display: grid;
  grid-template-columns: 180px 1fr auto;
  gap: 10px;
}

.remark-list {
  display: grid;
  gap: 4px;
  min-width: 180px;
}

.remark-list span {
  display: block;
}

.relation-lines {
  display: grid;
  gap: 4px;
  min-width: 180px;
}

.relation-lines span {
  display: block;
  line-height: 1.35;
}

.scope-tag {
  display: inline-block;
  margin-left: 6px;
  border-radius: 999px;
  background: #eef3ff;
  color: #2852a2;
  padding: 2px 6px;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
}

.status {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 13px;
  font-weight: 700;
}

.status.on {
  background: #e3f3ea;
  color: #17633a;
}

.status.off {
  background: #eef1f5;
  color: #626b78;
}

.status.warn {
  background: #fff1d6;
  color: #7a4b00;
}

.batch-card,
.block-head,
.rule-grid {
  display: grid;
  gap: 14px;
}

.batch-card,
.block-head {
  grid-template-columns: 1fr auto;
  align-items: start;
}

.config-block {
  margin-top: 16px;
  background: #fff;
  border: 1px solid #e4e7ee;
  border-left-width: 5px;
  border-radius: 8px;
  padding: 0;
  overflow: visible;
}

.scene-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: start;
  cursor: pointer;
  list-style: none;
}

.config-summary {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: start;
  cursor: pointer;
  list-style: none;
  padding: 16px 18px;
}

.config-block-batchUsers {
  border-left-color: #2563eb;
}

.config-block-selfFields {
  border-left-color: #059669;
}

.config-block-scoringTemplates {
  border-left-color: #7c3aed;
}

.config-block-scenes {
  border-left-color: #d97706;
}

.config-step {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #eef3ff;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 800;
}

.config-block-selfFields .config-step {
  background: #eaf8f1;
  color: #047857;
}

.config-block-scoringTemplates .config-step {
  background: #f1eafe;
  color: #6d28d9;
}

.config-block-scenes .config-step {
  background: #fff3df;
  color: #b45309;
}

.config-summary::-webkit-details-marker,
.scene-summary::-webkit-details-marker {
  display: none;
}

.config-summary h2,
.config-summary p {
  margin: 0;
}

.batch-card {
  padding: 12px 14px;
}

.batch-card h2 {
  margin: 2px 0 4px;
  font-size: 18px;
}

.batch-qr {
  display: grid;
  grid-template-columns: 84px minmax(180px, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 310px;
}

.batch-qr-image {
  position: relative;
  display: inline-flex;
  width: 84px;
  height: 84px;
}

.batch-qr-image img {
  width: 84px;
  height: 84px;
  border: 1px solid #e3e8f2;
  border-radius: 8px;
  background: #fff;
}

.batch-qr-logo-hole {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 22px;
  transform: translate(-50%, -50%);
  border: 2px solid #fff;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
  pointer-events: none;
}

.batch-qr-link {
  display: block;
  max-width: 360px;
  color: #1d4ed8;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.batch-qr-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.block-head {
  gap: 8px;
}

.subhead {
  margin: 12px 0 7px;
}

.subhead-row {
  margin-top: 12px;
}

.preview-compact {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}

.preview-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preview-stats span {
  border-radius: 999px;
  background: #fff;
  border: 1px solid #e2e8f0;
  padding: 5px 9px;
  color: #475569;
  font-size: 13px;
}

.preview-stats strong {
  color: #172033;
}

.preview-samples {
  display: grid;
  gap: 6px;
}

.preview-sample-row {
  display: grid;
  grid-template-columns: minmax(130px, 190px) 1fr;
  gap: 10px;
  align-items: start;
  border-top: 1px solid #e8edf5;
  padding-top: 7px;
  font-size: 13px;
}

.preview-sample-row span {
  color: #526070;
}

.preview-full-scroll {
  max-height: 260px;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}

.preview-full-scroll table {
  margin: 0;
  border: 0;
  border-radius: 0;
}

.preview-full-scroll thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef3fb;
}

.preview-full-scroll td:nth-child(3) {
  min-width: 360px;
  white-space: normal;
  line-height: 1.6;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 0;
}

.table-toolbar.compact {
  font-size: 13px;
}

.table-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.table-toolbar select {
  width: auto;
  min-width: 72px;
  padding: 6px 8px;
}

.pager {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pager.slim span {
  color: #647184;
  font-weight: 700;
}

.config-summary .muted {
  margin-top: 5px;
}

.config-meta {
  display: inline-block;
  margin-top: 8px !important;
  border-radius: 999px;
  background: #eef3ff;
  color: #2852a2;
  padding: 4px 9px;
  font-size: 13px;
  font-weight: 700;
}

.summary-toggle {
  align-self: center;
  border: 1px solid #d8dee9;
  border-radius: 6px;
  color: #526070;
  background: #f8fafc;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 700;
}

.task-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 16px;
}

.summary-card {
  border: 1px solid #e4e7ee;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.summary-card > summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  cursor: pointer;
  list-style: none;
}

.summary-card > summary::-webkit-details-marker {
  display: none;
}

.summary-card h2,
.summary-card h3,
.summary-card p {
  margin: 0;
}

.summary-card .muted {
  margin-top: 5px;
}

.summary-card table {
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
}

.summary-card[open] .summary-toggle {
  color: #1d4ed8;
  border-color: #c9d8ff;
  background: #edf3ff;
  font-size: 0;
}

.summary-card[open] .summary-toggle::before {
  content: "收起";
  font-size: 13px;
}

.config-block[open] .summary-toggle {
  color: #1d4ed8;
  border-color: #c9d8ff;
  background: #edf3ff;
}

.config-block[open] {
  border-color: #8fb2ff;
  border-left-color: #2864d8;
  box-shadow: 0 0 0 1px rgba(40, 100, 216, 0.08);
}

.config-block[open] > .config-summary {
  position: sticky;
  top: 66px;
  z-index: 22;
  border-bottom: 1px solid #c9d8ff;
  background: #edf4ff;
  color: #123b80;
  box-shadow: 0 8px 18px rgba(18, 31, 56, 0.08);
}

.config-block[open] > .config-summary h2 {
  color: #123b80;
}

.config-block[open] > .config-summary .muted {
  color: #385888;
}

.config-block[open] > .config-summary .config-meta {
  background: #dbe8ff;
  color: #1d4ed8;
}

.config-block[open] .summary-toggle::before {
  content: "收起";
}

.config-block[open] .summary-toggle {
  font-size: 0;
}

.config-block[open] .summary-toggle::before {
  font-size: 13px;
}

.config-content {
  border-top: 1px solid #edf0f5;
  padding: 16px 18px 18px;
}

.config-content > .inline-form,
.scene-detail > .inline-form {
  margin-top: 14px;
  border-color: #b9cdfb;
  border-left: 4px solid #2864d8;
  background: #f8fbff;
  box-shadow: none;
}

.config-content > .inline-form.hidden,
.scene-detail > .inline-form.hidden {
  display: none !important;
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid #e4e7ee;
  border-radius: 8px;
  background: #fbfcfe;
  padding: 14px;
  margin-bottom: 12px;
}

.time-window-row,
.peer-time-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto;
  align-items: end;
  gap: 8px;
  margin: 8px 0;
}

.time-window-row label,
.peer-time-panel label {
  display: grid;
  gap: 5px;
  color: #4b5a70;
  font-size: 13px;
}

.datetime-field-label {
  position: relative;
}

.datetime-single {
  position: relative;
}

.datetime-single-input {
  cursor: pointer;
  width: 100%;
}

.datetime-popover {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 60;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px auto;
  gap: 6px;
  padding: 8px;
  border: 1px solid #d8e1ef;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(18, 31, 56, 0.14);
}

.datetime-popover[hidden] {
  display: none;
}

.preview-check {
  border: 1px solid #dce4f2;
  border-radius: 8px;
  background: #f8fafc;
  padding: 14px;
  margin: 12px 0 18px;
}

.preview-check table {
  margin-top: 12px;
}

.preview-health-card {
  margin: 12px 0 18px;
  background: #f8fafc;
}

.preview-health-content {
  padding: 0 14px 14px;
}

.preview-health-content table {
  margin-top: 12px;
}

.preview-health-card .preview-health-toggle,
.preview-health-card[open] .preview-health-toggle {
  font-size: 13px;
}

.preview-health-card[open] .preview-health-toggle::before {
  content: none;
}

.switch-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.force-read-card {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 12px;
  margin: 0;
  border: 1px solid #b8cdf8;
  border-left: 5px solid #2864d8;
  border-radius: 8px;
  background: #f2f7ff;
  padding: 14px;
  cursor: pointer;
}

.force-read-card input {
  width: 18px;
  height: 18px;
  accent-color: #2864d8;
}

.force-read-copy {
  display: grid;
  gap: 4px;
}

.force-read-copy strong {
  color: #173d88;
  font-size: 16px;
}

.force-read-copy em {
  color: #536173;
  font-style: normal;
  line-height: 1.45;
}

.force-read-switch {
  position: relative;
  width: 48px;
  height: 26px;
  border-radius: 999px;
  background: #2864d8;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.38);
}

.force-read-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 23px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(23, 32, 51, 0.22);
}

.force-read-state {
  border-radius: 999px;
  background: #dceaff;
  color: #17458f;
  font-weight: 800;
  padding: 5px 9px;
  white-space: nowrap;
}

.force-read-card.is-off {
  border-color: #d8dee8;
  border-left-color: #8a94a8;
  background: #f8fafc;
}

.force-read-card.is-off .force-read-copy strong {
  color: #3a4353;
}

.force-read-card.is-off .force-read-switch {
  background: #a8b1bf;
}

.force-read-card.is-off .force-read-switch::after {
  left: 3px;
}

.force-read-card.is-off .force-read-state {
  background: #eceff4;
  color: #626b78;
}

.panel-lite {
  border: 1px solid #e4e7ee;
  border-radius: 8px;
  background: #fbfcfe;
  padding: 14px;
  margin-bottom: 12px;
}

.panel-lite h3 {
  margin: 0 0 6px;
}

.generate-result-panel {
  margin: 14px 0;
}

.generate-result-detail {
  border: 1px solid #e4e7ee;
  border-radius: 8px;
  background: #fff;
  margin-top: 10px;
  overflow: hidden;
}

.generate-result-detail summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  padding: 10px 12px;
  font-weight: 800;
}

.generate-result-detail .table-wrap {
  margin: 0;
  border-top: 1px solid #e4e7ee;
  max-height: 360px;
  overflow: auto;
}

.generate-result-detail > p {
  margin: 0;
  padding: 0 12px 12px;
}

.subhead {
  margin: 18px 0 10px;
  font-size: 16px;
}

.subhead-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.subhead-row .subhead {
  margin: 0;
}

.scene-rule-form {
  margin: 10px 0;
}

.config-block h2,
.rule-card h3 {
  margin: 0;
}

.rule-card {
  display: block;
  position: relative;
  border: 1px solid #cfdaf0;
  border-left: 4px solid #2f6df6;
  border-radius: 8px;
  padding: 0;
  margin-top: 10px;
  background: #fbfcfe;
  box-shadow: 0 5px 16px rgba(22, 37, 67, 0.06);
  overflow: visible;
}

.rule-card:nth-of-type(odd) {
  border-left-color: #1c9a7a;
  background: #fcfefd;
}

.scene-title {
  display: flex;
  align-items: center;
  gap: 7px;
}

.scene-summary {
  padding: 10px 12px;
  background: linear-gradient(90deg, #f8fbff 0%, #ffffff 62%);
}

.scene-card[open] > .scene-summary {
  position: sticky;
  top: 166px;
  z-index: 21;
  border-bottom: 1px solid #dbe6f7;
  border-radius: 8px 8px 0 0;
  background: rgba(248, 251, 255, 0.98);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 16px rgba(18, 31, 56, 0.08);
}

.scene-detail {
  border-top: 1px solid #e7ecf5;
  padding: 8px 10px 10px;
  background: #fff;
}

.scene-section {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  margin-top: 6px;
}

.scene-section:first-child {
  margin-top: 0;
}

.scene-section-basic {
  background: #fbfdff;
}

.scene-section-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 5px;
}

.scene-section-title strong {
  color: #172033;
  font-size: 14px;
}

.scene-section-title span {
  color: #647184;
  font-size: 12px;
}

.scene-setting-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.scene-detail .setting-row {
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
}

.scene-subsection {
  padding: 0;
}

.scene-subsection > .scene-section-title {
  margin: 0;
  padding: 7px 9px;
  cursor: pointer;
  list-style: none;
}

.scene-subsection > .scene-section-title::-webkit-details-marker {
  display: none;
}

.scene-section-heading {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.scene-section-heading small {
  color: #647184;
  font-size: 12px;
  font-weight: 500;
}

.scene-section-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 5px;
  background: #eef3fb;
  color: #3b4f6b;
  font-size: 16px;
  font-weight: 800;
}

.scene-section-toggle::before {
  content: "+";
}

.scene-subsection[open] .scene-section-toggle::before {
  content: "−";
}

.scene-section-content {
  padding: 0 8px 8px;
}

.scene-mobile-group-panel {
  display: grid;
  grid-template-columns: auto minmax(180px, 220px) minmax(260px, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin: 0;
  padding: 8px;
  border: 1px solid #d9e5ff;
  border-radius: 8px;
  background: #f7faff;
}

.scene-mobile-group-panel strong,
.advanced-filter-panel summary,
.advanced-filter-editor summary {
  color: #1e3a8a;
}

.scene-mobile-group-panel label {
  display: grid;
  gap: 4px;
  margin: 0;
  font-weight: 700;
}

.scene-mobile-group-panel textarea {
  min-height: 38px;
}

.scene-mobile-group-intro {
  align-self: center;
}

.mobile-group-overrides {
  display: grid;
  gap: 6px;
}

.mobile-group-overrides .field-head {
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mobile-group-override-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(150px, 180px) auto;
  gap: 6px;
  align-items: end;
  margin-top: 4px;
}

.mobile-group-override-row label {
  font-size: 13px;
}

.mobile-group-override-row input,
.mobile-group-override-row select {
  width: 100%;
}

.scene-mobile-group-actions {
  display: flex;
  justify-content: flex-end;
}

.compact-empty {
  margin: 0;
}

.advanced-filter-panel {
  margin: 10px 0;
  border: 1px dashed #d4ddec;
  border-radius: 8px;
  background: #fbfcff;
}

.advanced-filter-panel summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  cursor: pointer;
  font-weight: 800;
}

.advanced-filter-panel summary span {
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
}

.advanced-filter-panel .rule-grid {
  padding: 0 10px 10px;
}

.advanced-filter-editor {
  padding: 10px;
  border: 1px dashed #d4ddec;
  border-radius: 8px;
  background: #fbfcff;
}

.advanced-filter-editor summary {
  cursor: pointer;
  font-weight: 800;
}

.scene-summary-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 5px;
}

.scene-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px 8px;
  margin-top: 6px;
  max-width: 760px;
}

.scene-meta-grid span {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  color: #526071;
  font-size: 12px;
  line-height: 1.25;
}

.scene-meta-grid b {
  flex: 0 0 auto;
  color: #172033;
  font-weight: 800;
}

.scene-basic-form {
  display: grid;
  gap: 8px;
}

.scene-basic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.scene-basic-grid label {
  margin: 0;
}

.scene-basic-grid input,
.scene-basic-grid select {
  min-height: 34px;
}

.scene-basic-actions {
  margin: 0;
  justify-content: flex-start;
}

.scene-advanced-editor {
  padding: 8px;
}

.scene-actions {
  justify-content: flex-end;
  margin: 0;
}

.scene-mini-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

.scene-mini-stats span {
  border: 1px solid #e1e7f0;
  border-radius: 6px;
  background: #fff;
  color: #647184;
  padding: 3px 6px;
  font-size: 12px;
}

.scene-mini-stats strong {
  color: #1e293b;
}

.scene-title span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 12px;
  border-radius: 50%;
  background: #eaf0ff;
  color: #1d4ed8;
  font-weight: 800;
}

.scene-group {
  display: inline-block;
  margin: 4px 0 2px;
  padding: 3px 7px;
  border-radius: 6px;
  background: #eef6f3;
  color: #24604f;
  font-weight: 700;
  font-size: 12px;
}

.rule-grid {
  grid-template-columns: 1fr 1fr;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.chips span {
  border: 1px solid #dce3ee;
  border-radius: 999px;
  background: #f3f6fb;
  color: #354258;
  padding: 5px 9px;
  font-size: 13px;
}

/* Compact operations layout */
body {
  font-size: 14px;
}

.shell {
  grid-template-columns: 180px 1fr;
}

aside {
  padding: 16px 14px;
}

aside h2 {
  margin: 0 0 16px;
  font-size: 17px;
}

aside button {
  margin-bottom: 5px;
  padding: 9px 10px;
}

.content {
  padding: 0 16px 16px;
}

header {
  min-height: 66px;
  margin: 0 -16px 12px;
  padding: 10px 16px;
  box-shadow: 0 4px 14px rgba(18, 31, 56, 0.05);
}

header h1 {
  margin-top: 2px;
  font-size: 24px;
}

.eyebrow {
  font-size: 12px;
}

.header-actions {
  grid-template-columns: minmax(180px, 260px) auto;
  align-items: center;
}

form,
.panel {
  padding: 14px;
  box-shadow: none;
}

label {
  gap: 5px;
  margin-bottom: 10px;
}

input,
select,
textarea {
  padding: 7px 9px;
  border-radius: 5px;
}

button,
.mobile-link {
  padding: 8px 10px;
  border-radius: 5px;
}

button.small {
  padding: 5px 8px;
  font-size: 13px;
}

.actions {
  gap: 7px;
  margin: 9px 0;
}

.toolbar {
  gap: 8px;
  margin-bottom: 9px;
}

th,
td {
  padding: 8px 9px;
}

th {
  font-size: 13px;
}

.status {
  padding: 3px 7px;
  font-size: 12px;
}

.tag,
.mini-chip,
.scope-tag,
.chips span {
  margin: 0 4px 3px 0;
  padding: 2px 6px;
  font-size: 12px;
}

.grid {
  gap: 9px;
}

.stat,
.stat-grid > div {
  padding: 12px;
}

.stat strong,
.stat-grid strong {
  margin-top: 4px;
  font-size: 22px;
}

.notice,
.empty,
.preview-check,
.panel-lite,
.setting-row,
.remark-editor,
.selector-editor {
  padding: 10px;
  margin: 8px 0;
  border-radius: 6px;
}

.form-grid {
  gap: 9px;
}

.inline-form {
  margin: 8px 0 12px;
  border-left-width: 4px;
}

.inline-form h2 {
  margin: -2px 0 10px;
  font-size: 16px;
}

.checkbox-grid {
  gap: 6px 12px;
  padding: 8px;
}

.config-block {
  margin-top: 10px;
  border-radius: 6px;
}

.config-summary {
  padding: 10px 12px;
}

.config-summary .muted {
  margin-top: 3px;
}

.config-meta {
  margin-top: 5px !important;
  padding: 3px 7px;
  font-size: 12px;
}

.summary-toggle {
  padding: 4px 8px;
}

.config-content {
  padding: 10px 12px 12px;
}

.rule-card {
  margin-top: 10px;
  border-left-width: 4px;
  box-shadow: none;
}

.scene-summary {
  padding: 10px 12px;
}

.scene-card[open] > .scene-summary {
  top: 136px;
}

.scene-detail {
  padding: 10px 12px 12px;
}

.scene-setting-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.scene-section-title {
  display: grid;
}

.scene-mobile-group-panel {
  grid-template-columns: 1fr;
}

.mobile-group-override-row {
  grid-template-columns: 1fr;
}

.scene-title {
  gap: 7px;
}

.scene-title span {
  width: 24px;
  height: 24px;
}

.scene-group {
  margin: 5px 0 3px;
  padding: 3px 7px;
  font-size: 12px;
}

.scene-summary-side,
.scene-mini-stats {
  gap: 5px;
}

.scene-mini-stats span {
  padding: 4px 6px;
  font-size: 12px;
}

.department-grid-head,
.department-grid-row {
  grid-template-columns: 42px minmax(220px, 1.6fr) minmax(120px, 1fr) 58px 92px 118px 68px minmax(90px, 1fr) 170px;
}

.department-grid-head > div,
.department-grid-row > div {
  padding: 8px;
}

.department-row-actions {
  width: 170px;
  min-width: 170px;
  gap: 4px;
}

.department-row-actions button.small {
  padding: 5px 6px;
  font-size: 12px;
}

.department-sticky-tools {
  top: var(--department-tools-top, 66px);
  padding: 8px 2px;
}

.department-grid-head {
  top: var(--department-table-head-top, 112px);
}

.pagination {
  margin: 8px 0;
  font-size: 13px;
}

.order-actions,
.inline-order-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.order-actions span {
  min-width: 24px;
  color: #52627a;
  font-size: 12px;
}

.order-input {
  width: 54px;
  min-height: 30px;
  padding: 4px 6px;
  text-align: center;
}

.icon-btn {
  min-width: 28px;
  padding: 4px 7px;
  line-height: 1;
}

.target-order-editor {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid #d7e3f4;
  border-radius: 8px;
  background: #f8fbff;
}

.target-order-list {
  display: grid;
  gap: 6px;
}

.target-order-row {
  display: grid;
  grid-template-columns: 32px minmax(120px, 1fr) minmax(80px, auto) auto auto;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border: 1px solid #e3eaf5;
  border-radius: 6px;
  background: #fff;
}

.target-order-row span {
  color: #5b6c83;
  font-size: 12px;
}

.target-order-row small {
  color: #718096;
}

@media (max-width: 820px) {
  .login,
  .shell {
    display: block;
  }

  aside {
    position: sticky;
    top: 0;
    min-height: auto;
    max-height: none;
    display: flex;
    gap: 8px;
    overflow: auto;
    z-index: 35;
  }

  .content {
    padding: 0 14px 18px;
  }

  header {
    margin: 0 -14px 16px;
    padding: 14px;
    display: grid;
    gap: 12px;
  }

  #users .toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .config-block[open] > .config-summary {
    top: 74px;
  }

  aside h2 {
    display: none;
  }

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .task-stat-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .batch-card,
  .block-head,
  .rule-grid,
  .form-grid,
  .remark-row,
  .employment-relation-row,
  .task-summary-grid {
    grid-template-columns: 1fr;
  }

  .scene-setting-strip {
    grid-template-columns: 1fr;
  }

  .time-window-row,
  .peer-time-panel {
    grid-template-columns: 1fr;
  }
}
