:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --border: #e2e5eb;
  --text: #1a1d24;
  --muted: #5c6370;
  --accent: #2563eb;
  --accent-dim: #1d4ed8;
  --success: #059669;
  --danger: #dc2626;
  --input-bg: #ffffff;
  /* 拉丁文用 DM Sans，中文用 Noto Sans SC，风格接近、字重对齐 */
  --font-sans: "DM Sans", "Noto Sans SC", ui-sans-serif, system-ui, -apple-system,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 100%;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.form-field {
  margin-bottom: 1rem;
}

.error-message {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 0.25rem;
  min-height: 1.2rem;
}

.field-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 0.25rem;
  display: block;
  min-height: 1.2rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  position: relative;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  background: #f8f9fc;
  color: #475467;
  border: 1px solid #d0d5dd;
}

.tag-delete {
  margin-left: 0.35rem;
  font-size: 0.85em;
  font-weight: 700;
  color: rgba(190, 18, 60, 0.45);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, color 0.15s ease;
}

.tag:hover .tag-delete {
  opacity: 1;
}

.tag-delete:hover {
  color: #be123c;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.topbar .brand {
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.topbar nav {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-top: 1.25rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.card.flush-top {
  margin-top: 0;
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin: 0 0 0.5rem;
  color: var(--text);
}

h2 {
  font-size: 1.1rem;
  line-height: 1.4;
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-weight: 600;
}

label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
  color: var(--muted);
}

/* 表单项纵向间距：紧跟在控件后的标签 */
form input + label,
form select + label,
form textarea + label {
  margin-top: 0.75rem;
}

form p + label,
p.hint + label {
  margin-top: 0.75rem;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
textarea,
select {
  width: 100%;
  max-width: 420px;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
}

select optgroup {
  font-weight: bold;
  font-style: normal;
}

select option {
  font-weight: normal;
}

input[type="number"] {
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

textarea {
  min-height: 120px;
  max-width: 100%;
  resize: vertical;
}

.btn {
  display: inline-block;
  padding: 0.55rem 1rem;
  border-radius: 8px;
  border: none;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
}

.btn:hover {
  background: var(--accent-dim);
}

.btn-ghost {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 500;
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

.btn-ghost.active {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

.btn-sm {
  padding: 0.35rem 0.65rem;
  font-size: 0.9rem;
  font-weight: 500;
}

/* 列表内仅图标的操作按钮（加号 / 书写等） */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  line-height: 0;
}

.btn-icon svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: currentColor;
}

.flash {
  padding: 0.65rem 1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  position: fixed;
  top: 25%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1000;
  max-width: 400px;
  text-align: center;
}

.flash.success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: var(--success);
}

.flash.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--danger);
}

.login-box {
  max-width: 380px;
  margin: 4rem auto;
}

.login-box .card {
  margin-top: 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  line-height: 1.5;
}

th,
td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: 600;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag-cell-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.tag-cell-row .tag-stack {
  flex: 1;
  min-width: 0;
  max-width: none;
}

.tag-cell-row .tag-inline-add {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  flex-shrink: 0;
}

.tag-stack {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 360px;
}

.tag-line {
  margin-bottom: 0.25rem;
}

.tag-line-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.tag-inline-add {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

/* 与员工管理弹窗内「业务组」等 select 一致：使用全局 select 的宽度上限，不强制拉满弹窗 */
.tag-modal-select-wrap {
  margin-top: 0;
}

.modal-overlay .modal-panel select {
  max-width: 420px;
  width: 100%;
  box-sizing: border-box;
}

.tag-entry-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.tag-entry-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.tag-delete-form {
  margin: 0;
}

.tag-add-form {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.tag-cell {
  max-width: 440px;
  vertical-align: top;
}

.note-cell {
  min-width: 14rem;
  max-width: 440px;
  vertical-align: top;
}

.note-cell-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.note-cell-row .js-note-preview {
  flex: 1;
  min-width: 0;
}

.note-cell-row .note-inline-actions {
  flex-shrink: 0;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay[hidden] {
  display: none !important;
}

.modal-overlay.modal-stacked {
  z-index: 310;
}

.modal-overlay .modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  cursor: pointer;
}

.modal-overlay .modal-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 28rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
}

.modal-overlay .modal-panel textarea {
  max-width: 100%;
  width: 100%;
}

.modal-title {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}

.note-line {
  font-size: 0.875rem;
  color: var(--text);
  word-break: break-word;
  line-height: 1.45;
}

.assign-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 720px) {
  .assign-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.check-list {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem;
  background: #fafbfc;
}

.check-list label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0;
  padding: 0.35rem 0.25rem;
  cursor: pointer;
  border-radius: 6px;
}

.check-list label:hover {
  background: #f0f4ff;
}

.hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

.row-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.row-actions.mt-form {
  margin-top: 0.75rem;
}

.row-actions.no-mt {
  margin-top: 0;
}

.row-actions.assign-select-toolbar {
  margin-top: 0.5rem;
  margin-bottom: 0;
}

.assign-pool-dtype-fieldset {
  margin-top: 0.75rem;
}

.assign-pool-dtype-actions {
  margin-top: 0.5rem;
  margin-bottom: 0;
}

.add-group-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
  margin-top: 0.5rem;
}

.add-group-row .add-group-field {
  flex: 1;
  min-width: 200px;
}

/* 配置管理：数据分类（1/2/3）与添加标签分类行内表单 */
.dtype-names-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  margin-top: 0.5rem;
}

.dtype-names-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.dtype-names-field--slot {
  flex: 1 1 7rem;
  min-width: 6rem;
}

.dtype-names-field--slot input {
  width: 100%;
  max-width: 100%;
}

.dtype-names-actions {
  flex-shrink: 0;
}

/* 添加标签分类 — 分类标签 / 排序 / 按钮同一行（不依赖 Tailwind） */
.tag-category-add-form {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 0.75rem 1rem;
  margin-top: 0.5rem;
}

.tag-category-add-form .tag-category-add-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.tag-category-add-form .tag-category-add-field--label {
  flex: 1 1 10rem;
  min-width: 8rem;
}

.tag-category-add-form .tag-category-add-field--label input {
  width: 100%;
  min-width: 0;
}

.tag-category-add-form .tag-category-add-field--sort {
  flex: 0 0 6.75rem;
  width: 6.75rem;
}

.tag-category-add-form .tag-category-add-field--sort input {
  width: 100%;
}

.tag-category-add-form .tag-category-add-actions {
  flex-shrink: 0;
}

@media (max-width: 640px) {
  .tag-category-add-form {
    flex-wrap: wrap;
  }

  .tag-category-add-form .tag-category-add-field--sort {
    flex: 1 1 6rem;
    width: auto;
  }
}

.is-hidden {
  display: none !important;
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* —— 标签管理页 —— */
.tag-admin-page {
  margin-bottom: 2rem;
}

.tag-admin-page-head {
  margin-bottom: 1.25rem;
}

.tag-admin-page-head h1 {
  margin-bottom: 0.35rem;
}

.tag-admin-lead {
  margin: 0;
  max-width: 42rem;
  line-height: 1.55;
  font-size: 0.95rem;
}

.tag-admin-section-title {
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 700;
}

.tag-admin-card .tag-admin-section-title {
  margin-bottom: 0.35rem;
}

.tag-admin-section-hint {
  margin: 0 0 1rem;
  max-width: 40rem;
}

.tag-admin-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1rem;
}

.tag-admin-section-head .tag-admin-section-title {
  margin: 0;
}

.tag-admin-count-badge {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  background: #f1f5f9;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.tag-admin-form-panel {
  margin-top: 0.25rem;
  padding: 1rem 1.1rem;
  background: linear-gradient(165deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.tag-admin-form-panel .tag-category-add-form {
  margin-top: 0;
}

.tag-admin-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.tag-admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  background: #fff;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  line-height: 1.3;
}

.tag-admin-badge strong {
  font-weight: 700;
  color: var(--text);
}

.tag-admin-badge--id {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-weight: 500;
  font-size: 0.7rem;
  color: #64748b;
  background: #f8fafc;
}

.tag-admin-badge--soft {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.tag-admin-btn-delete:hover {
  border-color: #fecaca !important;
  color: var(--danger) !important;
  background: #fef2f2 !important;
}

.tag-admin-list {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.tag-admin-category {
  border: 1px solid var(--border);
  border-radius: 12px;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  padding: 1rem 1.15rem 1.1rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.tag-admin-category-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.tag-admin-category-title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  min-width: 0;
}

.tag-admin-category-name {
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.35;
}

.tag-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  justify-content: flex-end;
}

.tag-admin-actions--option {
  flex-shrink: 0;
}

.tag-admin-inline-form {
  margin: 0;
  display: inline-flex;
}

.tag-admin-edit {
  margin-top: 0.85rem;
  padding: 1rem;
  border-radius: 10px;
  border: 1px solid #c7d2fe;
  background: linear-gradient(180deg, #eef2ff 0%, #f8fafc 55%);
}

.tag-admin-edit-form {
  margin: 0;
}

.tag-admin-edit-grid {
  display: grid;
  grid-template-columns: 1fr 8rem;
  gap: 0.75rem;
  align-items: end;
}

.tag-admin-edit-grid input {
  max-width: 100%;
}

.tag-admin-options {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--border);
}

.tag-admin-options-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.tag-admin-options-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}

.tag-admin-empty {
  padding: 0.85rem 1rem;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
}

.tag-admin-empty p {
  margin: 0;
}

.tag-admin-empty--page {
  text-align: center;
  padding: 2rem 1.5rem;
}

.tag-admin-empty--page p:first-child {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.35rem;
}

.tag-admin-option-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.tag-admin-option-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  background: #fafbfc;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tag-admin-option-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.tag-admin-option-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.65rem;
  min-width: 0;
}

.tag-admin-modal-panel {
  max-width: 34rem !important;
}

.tag-admin-modal-grid {
  display: grid;
  grid-template-columns: 1fr 8rem;
  gap: 0.75rem;
  align-items: end;
}

.tag-admin-modal-grid input {
  max-width: 100%;
}

@media (max-width: 760px) {
  .tag-admin-edit-grid,
  .tag-admin-modal-grid {
    grid-template-columns: 1fr;
  }
}

.table-scroll {
  overflow-x: auto;
  margin-top: 1rem;
}

.table-scroll.tight-top {
  margin-top: 0.5rem;
}

.form-inline-nowrap {
  flex-wrap: nowrap;
  align-items: center;
}

.login-form {
  margin-top: 1.25rem;
}

.login-form .login-password-label {
  margin-top: 0.75rem;
}

.login-hint {
  margin-top: 1rem;
}

/* 表格内联表单：输入与其它字段同宽上限 */
.table-inline-field {
  max-width: 420px;
}

code {
  font-size: 0.85em;
  padding: 0.15em 0.4em;
  background: #f0f2f5;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.admin-per-user-meta {
  margin-bottom: 0.65rem;
}

.admin-per-user-meta:last-child {
  margin-bottom: 0;
}

.admin-emp-label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.admin-note-line {
  font-size: 0.875rem;
  word-break: break-word;
  margin-bottom: 0.15rem;
}

.admin-note-block {
  margin-bottom: 0.65rem;
}

.admin-note-block:last-child {
  margin-bottom: 0;
}

.filter-form-card h2 {
  margin-top: 0;
}

.filter-form-details {
  margin: 0;
}

.filter-form-summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  padding: 0;
  user-select: none;
}

.filter-form-summary::-webkit-details-marker,
.filter-form-summary::marker {
  display: none;
}

.filter-form-summary-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--muted);
}

.filter-form-summary-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  margin-left: auto;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fafbfc;
  flex-shrink: 0;
}

.filter-form-summary-chevron::before {
  content: "";
  display: block;
  width: 0.4rem;
  height: 0.4rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

.filter-form-details[open] .filter-form-summary-chevron::before {
  transform: rotate(45deg);
  margin-top: 0.1rem;
}

.filter-form-details-inner {
  padding-top: 0.5rem;
}

.filter-top-row-wrap {
  margin-bottom: 0.25rem;
}

.filter-top-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1.25rem;
  padding-bottom: 0.15rem;
}

.filter-q-block {
  flex: 1 1 auto;
  min-width: 9rem;
  max-width: 30rem;
}

.filter-q-block input[type="text"] {
  width: 100%;
  max-width: 100%;
}

.filter-q-block input[type="date"] {
  flex: 1;
  min-width: 12rem;
}

.filter-assign-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 0.65rem;
}

.filter-assign-heading {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
  padding-bottom: 0.45rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.filter-date-field--compact input[type="date"] {
  max-width: 11rem;
  min-width: 9rem;
}

.tag-filter-fieldset {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-top: 0.75rem;
}

.tag-filter-fieldset legend {
  padding: 0 0.35rem;
  font-size: 0.875rem;
  color: var(--muted);
  font-weight: 600;
}

.tag-filter-row-horizontal {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  align-items: stretch;
}

.tag-filter-groups-234 {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 2rem;
}

.tag-filter-group-234 {
  flex: 0 1 auto;
}

.tag-filter-group-inline {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
}

.tag-filter-group-label {
  font-size: 0.875rem;
  color: var(--muted);
  font-weight: 600;
  flex-shrink: 0;
  margin-right: 0.15rem;
}

.tag-filter-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 1rem;
  cursor: pointer;
  margin: 0;
}

.dtype-filter-fieldset,
.assignee-filter-fieldset {
  margin-top: 0.75rem;
}

.dtype-unassigned-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1.25rem;
}

.dtype-filter-fieldset--grow {
  flex: 1 1 auto;
  min-width: 14rem;
}

.dtype-filter-fieldset--side {
  flex: 0 1 auto;
  min-width: 8rem;
}

.dtype-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.filter-date-fieldset {
  margin-top: 0.75rem;
}

.filter-date-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: flex-end;
}

.assign-quick-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.4rem;
}

.assign-quick-label {
  font-size: 0.8rem;
  margin-right: 0.1rem;
  white-space: nowrap;
}

.filter-date-field label {
  display: block;
  margin-bottom: 0.25rem;
}

.filter-date-field input[type="date"] {
  max-width: 12rem;
}

/* 确保filter-q-block内的日期输入框不受上述限制 */
.filter-q-block input[type="date"] {
  max-width: 100%;
}

.dtype-counts {
  margin: 1rem 0;
}

.dtype-counts-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.dtype-count-item {
  padding: 0.5rem 1rem;
  border-radius: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  font-weight: 500;
}

.list-result-bar {
  padding: 0.75rem 1.25rem;
  margin-top: 1rem;
}

.list-result-bar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.list-result-count {
  font-size: 0.9rem;
}

.list-result-pageinfo {
  font-size: 0.85rem;
}

.pagination-links {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.assign-time-cell {
  font-size: 0.85rem;
  color: var(--muted);
  vertical-align: top;
  max-width: 10rem;
  word-break: break-all;
}

.assign-at-cell {
  font-size: 0.8rem;
  min-width: 6.5rem;
  vertical-align: top;
}

.admin-assign-at-line {
  margin-bottom: 0.35rem;
  line-height: 1.45;
}

.admin-assign-at-line:last-child {
  margin-bottom: 0;
}

/* 业绩报表：筛选区（与全局表单变量一致） */
.perf-filter-form .perf-filter-row {
  margin: 0;
}

.perf-filter-date-field {
  width: 100%;
  max-width: 100%;
}

.perf-filter-date-field label {
  margin-bottom: 0.35rem;
}

.perf-filter-date-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
}

.perf-filter-date-line input[type="date"] {
  width: auto;
  min-width: 9rem;
  max-width: 12rem;
}

.date-range-separator {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0.25rem;
  white-space: nowrap;
}

.perf-quick-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin-top: -0.2rem;
}

.perf-quick-links .btn-sm {
  white-space: nowrap;
}

.perf-filter-actions {
  margin-top: 0.75rem;
}

/* 业绩报表：表格与 Tab */
.perf-table-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.perf-tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.35rem;
  border-bottom: 1px solid var(--border);
  margin: -0.15rem 0 0.35rem;
  padding-bottom: 0;
}

.perf-tab-btn {
  padding: 0.5rem 1rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  border-radius: 8px 8px 0 0;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.perf-tab-btn:hover {
  color: var(--text);
  background: #f4f5f7;
}

.perf-tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: transparent;
}

.perf-table-card .tab-content {
  display: none;
}

.perf-table-card .tab-content.active {
  display: block;
}

/* 业绩报表：图表卡片显隐（与切换按钮联动） */
#chart-container:not(.is-visible) {
  display: none;
}

#chart-container.is-visible {
  display: block;
}

#table-container.is-hidden {
  display: none;
}

.perf-chart-wrap {
  height: 400px;
  min-height: 260px;
  position: relative;
}

.perf-chart-wrap canvas {
  max-height: 100%;
}

/* Tab切换样式 */
.tabs {
  margin-top: 1.25rem;
}

.tab-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.35rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
  padding-bottom: 0;
}

.tab-button {
  padding: 0.5rem 1rem;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--muted);
  border-radius: 8px 8px 0 0;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.tab-button:hover {
  color: var(--text);
  background: #f4f5f7;
}

.tab-button.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: transparent;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* 标签checkbox样式 */
.tag-checkbox-groups {
  margin-top: 0.5rem;
  max-height: 400px;
  overflow-y: auto;
}

.tag-checkbox-group {
  margin-bottom: 1rem;
}

.tag-checkbox-group-label {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.tag-checkbox-options {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.tag-checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 calc(33.333% - 0.667rem);
}

.tag-checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.tag-checkbox-item label {
  cursor: pointer;
  font-weight: normal;
  margin: 0;
}

/* 重复数据背景颜色 */
.bg-yellow-50 {
  background-color: #fef9c3;
}

.bg-red-50 {
  background-color: #fecaca;
}

.bg-blue-50 {
  background-color: #eff6ff;
}

/* 弹窗样式 */
.toast {
  position: fixed;
  top: 25%;
  left: 50%;
  z-index: 500;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.3s ease;
  transform: translate(-50%, -50%) scale(0.8);
  opacity: 0;
}

.toast.show {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}

.toast.success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: var(--success);
}

.toast.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--danger);
}

.toast.info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: var(--accent);
}

/* Prompt弹窗样式 */
.prompt-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.45);
}

.prompt-overlay[hidden] {
  display: none !important;
}

.prompt-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 30rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
}

.prompt-title {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.prompt-message {
  margin: 0 0 1.5rem;
  color: var(--muted);
  line-height: 1.5;
}

.prompt-input {
  margin-bottom: 1.5rem;
}

.prompt-input input {
  width: 100%;
  max-width: 100%;
}

.prompt-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

