/* 智能派单工作台：复用主题变量，所有规则限定在 dispatch 前缀内。 */
.dispatch-root {
  --dispatch-ink: var(--ink, #1d2a23);
  --dispatch-muted: var(--ink-faint, #7c877f);
  --dispatch-line: var(--line, #e2dccb);
  --dispatch-surface: var(--card, #fffdf7);
  --dispatch-soft: var(--card-2, #faf7ee);
  color: var(--dispatch-ink);
}
.dispatch-root * { box-sizing: border-box; }
.dispatch-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 30px;
  overflow: hidden;
  border: 1px solid var(--dispatch-line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 82% 12%, color-mix(in srgb, var(--accent, #0e7a5c) 17%, transparent), transparent 34%),
    linear-gradient(135deg, var(--dispatch-surface), var(--dispatch-soft));
  box-shadow: var(--shadow-sm, 0 2px 10px rgba(29, 42, 35, .06));
}
.dispatch-hero::after {
  content: "";
  position: absolute;
  right: -46px;
  bottom: -78px;
  width: 210px;
  height: 210px;
  border: 1px solid color-mix(in srgb, var(--accent, #0e7a5c) 22%, transparent);
  border-radius: 50%;
  pointer-events: none;
}
.dispatch-hero-copy { position: relative; z-index: 1; max-width: 680px; }
.dispatch-hero h2 {
  margin: 6px 0 8px;
  font: 650 28px/1.25 var(--serif, "Songti SC", serif);
  letter-spacing: -.02em;
}
.dispatch-hero p { margin: 0; color: var(--dispatch-muted); font-size: 13px; line-height: 1.7; }
.dispatch-hero-actions { position: relative; z-index: 1; display: flex; gap: 10px; flex-shrink: 0; }
.dispatch-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 16px 0;
}
.dispatch-metric {
  padding: 18px 20px;
  border: 1px solid var(--dispatch-line);
  border-radius: 16px;
  background: var(--dispatch-surface);
}
.dispatch-metric span { display: block; color: var(--dispatch-muted); font-size: 12px; }
.dispatch-metric strong {
  display: block;
  margin: 5px 0 2px;
  font: 650 26px/1.2 var(--mono, monospace);
  font-variant-numeric: tabular-nums;
}
.dispatch-metric small { color: var(--dispatch-muted); font-size: 11px; }
.dispatch-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.dispatch-segment {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--dispatch-line);
  border-radius: 12px;
  background: var(--dispatch-soft);
}
.dispatch-segment button {
  min-height: 34px;
  padding: 0 15px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--dispatch-muted);
  font: 600 12px/1 var(--sans, sans-serif);
  cursor: pointer;
  transition: background .18s, color .18s, box-shadow .18s;
}
.dispatch-segment button.active {
  background: var(--accent, #0e7a5c);
  color: var(--on-accent, #fff);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent, #0e7a5c) 20%, transparent);
}
.dispatch-search input {
  width: min(320px, 40vw);
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--dispatch-line);
  border-radius: 12px;
  outline: none;
  background: var(--dispatch-surface);
  color: var(--dispatch-ink);
  font-size: 12px;
  transition: border-color .18s, box-shadow .18s;
}
.dispatch-search input:focus {
  border-color: var(--accent, #0e7a5c);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #0e7a5c) 12%, transparent);
}
.dispatch-workbench { display: grid; grid-template-columns: minmax(300px, .82fr) minmax(480px, 1.6fr); gap: 16px; align-items: start; }
.dispatch-demand-panel, .dispatch-candidate-panel { min-height: 520px; padding: 20px; }
.dispatch-candidate-panel { min-width: 0; }
.dispatch-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.dispatch-panel-head h3 { margin: 4px 0 0; font-size: 17px; }
.dispatch-panel-head-meta { color: var(--dispatch-muted); font-size: 11px; }
.dispatch-demand-list { display: grid; gap: 10px; max-height: 660px; overflow-y: auto; padding-right: 3px; }
.dispatch-demand-card {
  width: 100%;
  padding: 16px;
  border: 1px solid var(--dispatch-line);
  border-radius: 14px;
  background: var(--dispatch-surface);
  color: var(--dispatch-ink);
  text-align: left;
  cursor: pointer;
  transition: border-color .18s, background .18s, transform .18s, box-shadow .18s;
}
.dispatch-demand-card:hover { transform: translateY(-1px); border-color: var(--accent, #0e7a5c); box-shadow: var(--shadow-sm); }
.dispatch-demand-card.active {
  border-color: var(--accent, #0e7a5c);
  background: var(--accent-soft-2, var(--accent-soft, #edf6f1));
  box-shadow: inset 3px 0 0 var(--accent, #0e7a5c);
}
.dispatch-demand-top, .dispatch-demand-meta, .dispatch-candidate-top, .dispatch-candidate-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dispatch-demand-top { justify-content: space-between; }
.dispatch-demand-title { font-size: 15px; font-weight: 650; }
.dispatch-demand-no { margin: 5px 0 10px; color: var(--dispatch-muted); font: 10px/1.4 var(--mono, monospace); }
.dispatch-demand-time { margin: 10px 0 0; color: var(--dispatch-muted); font-size: 11px; line-height: 1.6; }
.dispatch-demand-meta { color: var(--dispatch-muted); font-size: 11px; }
.dispatch-demand-meta span + span::before { content: "·"; margin-right: 8px; }
.dispatch-candidate-summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--dispatch-line);
}
.dispatch-candidate-summary h3 { margin: 4px 0 6px; font-size: 18px; }
.dispatch-candidate-summary p { margin: 0; color: var(--dispatch-muted); font-size: 12px; line-height: 1.6; }
.dispatch-candidate-list { display: grid; gap: 12px; }
.dispatch-candidate-card {
  padding: 18px;
  border: 1px solid var(--dispatch-line);
  border-radius: 16px;
  background: var(--dispatch-surface);
  transition: border-color .18s, box-shadow .18s;
}
.dispatch-candidate-card:hover { border-color: color-mix(in srgb, var(--accent, #0e7a5c) 55%, var(--dispatch-line)); box-shadow: var(--shadow-sm); }
.dispatch-candidate-card.is-excluded { background: var(--dispatch-soft); }
.dispatch-candidate-top { justify-content: space-between; flex-wrap: nowrap; }
.dispatch-coach { display: flex; align-items: center; gap: 12px; min-width: 0; }
.dispatch-coach-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 13px;
  background: var(--accent-soft, #e1f0e8);
  color: var(--accent-deep, #0a5c46);
  font-size: 16px;
  font-weight: 700;
}
.dispatch-coach-name { margin-bottom: 4px; font-size: 15px; font-weight: 650; }
.dispatch-coach-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.dispatch-score { text-align: right; flex-shrink: 0; }
.dispatch-score strong { display: block; font: 650 28px/1 var(--mono, monospace); color: var(--accent-deep, #0a5c46); }
.dispatch-score span { color: var(--dispatch-muted); font-size: 10px; }
.dispatch-score-detail { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 16px 0; }
.dispatch-score-part { padding: 9px 6px; border-radius: 10px; background: var(--dispatch-soft); text-align: center; }
.dispatch-score-part b { display: block; font: 650 13px/1.2 var(--mono, monospace); }
.dispatch-score-part span { color: var(--dispatch-muted); font-size: 10px; }
.dispatch-candidate-meta { color: var(--dispatch-muted); font-size: 11px; }
.dispatch-candidate-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
.dispatch-reasons { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.dispatch-reason {
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--red-soft, #fbe6e2);
  color: var(--red, #d4584a);
  font-size: 10px;
  line-height: 1.4;
}
.dispatch-empty { display: grid; place-items: center; min-height: 220px; padding: 28px; color: var(--dispatch-muted); text-align: center; }
.dispatch-empty-mark {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  margin-bottom: 12px;
  border: 1px dashed var(--dispatch-line);
  border-radius: 16px;
  color: var(--accent, #0e7a5c);
  font: 650 18px/1 var(--mono, monospace);
}
.dispatch-empty h3 { margin: 0 0 6px; color: var(--dispatch-ink); font-size: 16px; }
.dispatch-empty p { margin: 0; font-size: 12px; line-height: 1.6; }
.dispatch-candidate-empty { min-height: 450px; align-content: center; }
.dispatch-loading { display: grid; gap: 10px; }
.dispatch-skeleton { height: 108px; border-radius: 14px; background: linear-gradient(100deg, var(--dispatch-soft) 30%, var(--dispatch-surface) 50%, var(--dispatch-soft) 70%); background-size: 240% 100%; animation: dispatch-shimmer 1.4s infinite; }
.dispatch-dialog {
  box-sizing: border-box;
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--dispatch-line);
  border-radius: 22px;
  background: var(--dispatch-surface);
  color: var(--dispatch-ink);
  box-shadow: 0 28px 90px rgba(15, 30, 24, .24);
}
.dispatch-dialog * { box-sizing: border-box; }
.dispatch-dialog::backdrop { background: rgba(15, 26, 21, .48); backdrop-filter: blur(4px); }
.dispatch-dialog-card { padding: 24px; }
.dispatch-dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.dispatch-dialog-head h3 { margin: 4px 0 0; font-size: 20px; }
.dispatch-dialog-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--dispatch-line);
  border-radius: 10px;
  background: var(--dispatch-soft);
  color: var(--dispatch-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.dispatch-assign-overview { padding: 16px; border-radius: 14px; background: var(--dispatch-soft); }
.dispatch-assign-overview strong { display: block; margin-bottom: 6px; font-size: 16px; }
.dispatch-assign-overview p { margin: 4px 0; color: var(--dispatch-muted); font-size: 12px; }
.dispatch-relax-warning { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--gold-soft, #fbedc4); color: #8a641d; font-size: 12px; line-height: 1.6; }
.dispatch-field { display: grid; gap: 7px; margin-top: 16px; font-size: 12px; font-weight: 600; }
.dispatch-field textarea, .dispatch-import-input {
  width: 100%;
  min-height: 88px;
  padding: 12px;
  resize: vertical;
  border: 1px solid var(--dispatch-line);
  border-radius: 12px;
  outline: none;
  background: var(--dispatch-surface);
  color: var(--dispatch-ink);
  font: 12px/1.6 var(--sans, sans-serif);
}
.dispatch-field textarea:focus, .dispatch-import-input:focus { border-color: var(--accent, #0e7a5c); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #0e7a5c) 12%, transparent); }
.dispatch-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.dispatch-import-dialog { width: min(860px, calc(100vw - 32px)); }
.dispatch-dialog-tip { margin: 0 0 14px; color: var(--dispatch-muted); font-size: 12px; line-height: 1.7; }
.dispatch-import-input { min-height: 190px; font-family: var(--mono, monospace); }
.dispatch-import-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.dispatch-import-summary { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.dispatch-import-summary:empty { display: none; }
.dispatch-import-results { max-height: 260px; overflow: auto; margin-top: 12px; }
.dispatch-import-results:empty { display: none; }
.dispatch-import-row { display: grid; grid-template-columns: 58px 64px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--dispatch-line); font-size: 11px; }
.dispatch-import-row .is-ok { color: var(--accent-deep, #0a5c46); }
.dispatch-import-row .is-bad { color: var(--red, #d4584a); }
.dispatch-import-row small { color: var(--dispatch-muted); line-height: 1.5; }
.dispatch-root button:focus-visible, .dispatch-dialog button:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent, #0e7a5c) 25%, transparent); outline-offset: 2px; }
@keyframes dispatch-shimmer { to { background-position: -240% 0; } }
@media (max-width: 1080px) {
  .dispatch-workbench { grid-template-columns: 1fr; }
  .dispatch-demand-panel, .dispatch-candidate-panel { min-height: auto; }
  .dispatch-demand-list { max-height: 390px; }
  .dispatch-candidate-empty { min-height: 260px; }
}
@media (max-width: 720px) {
  .dispatch-hero { align-items: flex-start; flex-direction: column; padding: 22px; }
  .dispatch-hero h2 { font-size: 24px; }
  .dispatch-hero-actions { width: 100%; flex-wrap: wrap; }
  .dispatch-metrics { grid-template-columns: 1fr; gap: 10px; }
  .dispatch-toolbar { align-items: stretch; flex-direction: column; }
  .dispatch-search input { width: 100%; }
  .dispatch-demand-panel, .dispatch-candidate-panel { padding: 16px; }
  .dispatch-score-detail { grid-template-columns: repeat(5, minmax(48px, 1fr)); overflow-x: auto; }
  .dispatch-candidate-footer { align-items: flex-start; flex-direction: column; }
  .dispatch-candidate-footer .btn { width: 100%; }
  .dispatch-import-tools { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  .dispatch-root *, .dispatch-dialog * { animation: none !important; transition: none !important; }
}
