:root {
  --primary: #4f8cff;
  --primary-2: #6c63ff;
  --accent: #28c7b7;
  --success: #18a058;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg: #f6fbff;
  --bg-2: #eef8ff;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-2: #ffffff;
  --surface-3: #f8fbff;
  --line: #dcebf7;
  --line-strong: #b7d7ff;
  --text: #1f2a44;
  --muted: #5f7190;
  --dim: #8ba0b8;
  --soft-blue: #eaf4ff;
  --soft-mint: #e9fbf8;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 14px 36px rgba(62, 118, 169, 0.12);
  --shadow-sm: 0 8px 22px rgba(62, 118, 169, 0.09);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 12% -6%, rgba(79, 140, 255, 0.22), transparent 30%),
    radial-gradient(circle at 92% 5%, rgba(40, 199, 183, 0.18), transparent 32%),
    linear-gradient(180deg, #f7fcff 0%, #eef8ff 48%, #f9fffc 100%);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 12px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid rgba(220, 235, 247, 0.78);
}
.account-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
}
.account-actions form { margin: 0; }
.account-actions > * { flex-shrink: 0; }
.account-name {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.75);
}
header h1 {
  font-size: 18px;
  font-weight: 850;
  letter-spacing: -0.02em;
  color: var(--text);
}
.muted {
  color: var(--dim);
  font-size: 11px;
  margin-top: 2px;
}

.grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px;
}

.card {
  position: relative;
  overflow: hidden;
  padding: 16px;
  background: var(--surface);
  border: 1px solid rgba(220, 235, 247, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, #8ec5ff, #9df0e7, #d6c9ff);
}
.card h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
  font-size: 15px;
  font-weight: 780;
  letter-spacing: -0.01em;
  color: var(--text);
}
.section-desc {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
.task-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.task-section-head h2 { margin-bottom: 0; }
.scheduler-capacity-settings {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.scheduler-capacity-settings label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.scheduler-capacity-settings input {
  width: 52px;
  min-height: 32px;
  padding: 5px 7px;
  text-align: center;
}
.scheduler-capacity-settings span {
  min-width: 92px;
  color: var(--primary);
  font-weight: 700;
  white-space: nowrap;
}
.card h2::before {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 0 0 5px rgba(79, 140, 255, 0.12);
  flex-shrink: 0;
}
.card h3 {
  margin: 16px 0 8px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 780;
  letter-spacing: 0.04em;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.row, .btn-group, .input-group {
  display: flex;
  gap: 8px;
  align-items: center;
}
.row, .btn-group { flex-wrap: wrap; }
.input-group { flex: 1; min-width: 0; }
.input-group input { flex: 1; min-width: 0; }

button {
  min-height: 38px;
  padding: 9px 14px;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  font-weight: 760;
  color: white;
  cursor: pointer;
  white-space: nowrap;
  background: linear-gradient(135deg, var(--primary), #6aa6ff);
  box-shadow: 0 9px 22px rgba(79, 140, 255, 0.22);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}
button:hover { box-shadow: 0 11px 26px rgba(79, 140, 255, 0.28); }
button:active { transform: scale(0.97); }
button.sm { min-height: 32px; padding: 6px 11px; font-size: 12px; }
button.outline, button.gray {
  color: #426484;
  background: #f7fbff;
  border: 1px solid var(--line);
  box-shadow: none;
}
button.outline:hover, button.gray:hover {
  border-color: var(--line-strong);
  background: #eef7ff;
}
button.accent {
  background: linear-gradient(135deg, var(--accent), #3bd6c9);
  box-shadow: 0 9px 22px rgba(40, 199, 183, 0.2);
}
button.danger {
  background: linear-gradient(135deg, #ff7b88, var(--danger));
  box-shadow: 0 9px 22px rgba(239, 68, 68, 0.16);
}
button.live-on {
  background: linear-gradient(135deg, #ff7b88, var(--danger));
  animation: pulse-red 1.8s infinite;
}
@keyframes pulse-red {
  0%, 100% { box-shadow: 0 0 0 rgba(239,68,68,0); }
  50% { box-shadow: 0 0 20px rgba(239,68,68,0.18); }
}

input, select, textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdff;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: #8fc2ff;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(79, 140, 255, 0.1);
}
input::placeholder { color: #a5b5c8; }
input[type="text"], input[type="tel"], input[type="number"], textarea { -webkit-appearance: none; appearance: none; }
input[type="datetime-local"], input[type="date"], input[type="time"], select { -webkit-appearance: auto; appearance: auto; color-scheme: light; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--primary); }

.hint {
  color: #55708f;
  font-size: 12px;
  padding: 10px 12px;
  border: 1px solid #d8efff;
  border-radius: 14px;
  background: linear-gradient(135deg, #f1f9ff, #f1fffc);
}
.flow-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}
.flow-steps span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 1px solid #d8efff;
  border-radius: 999px;
  background: #f7fcff;
  color: #4c7ca7;
  font-size: 11px;
  font-weight: 800;
}
.mode-indicator {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--dim);
  background: #f7fbff;
  font-size: 12px;
  font-weight: 760;
}
.mode-indicator.active {
  color: #15988d;
  border-color: #bdece7;
  background: var(--soft-mint);
}

#screenWrap { margin-top: 12px; }
#floatingScreen {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}
.floating-screen-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(31, 42, 68, 0.22);
  backdrop-filter: blur(5px);
}
.floating-screen-card {
  position: relative;
  width: min(420px, 100%);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  background: rgba(255,255,255,0.96);
  box-shadow: 0 18px 48px rgba(62, 118, 169, 0.22);
  overflow: hidden;
}
.floating-screen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}
.floating-close {
  min-height: 30px;
  width: 30px;
  padding: 0;
  border-radius: 50%;
  background: #f1f7ff;
  color: var(--muted);
  box-shadow: none;
  font-size: 20px;
  line-height: 1;
}
.floating-screen-body {
  padding: 12px;
  overflow: auto;
  display: flex;
  justify-content: center;
}
.floating-screen-body #screenWrap {
  margin-top: 0;
  width: 100%;
  max-width: 390px;
}
.floating-screen-body #screen {
  width: 390px;
  max-width: 100%;
}
#screen {
  display: block;
  width: 100%;
  max-width: 390px;
  height: auto;
  aspect-ratio: 9/19.5;
  margin: 0 auto;
  border: 1px solid #c9e2ff;
  border-radius: 26px;
  background: #f4f8ff;
  touch-action: none;
  box-shadow: 0 16px 36px rgba(63, 124, 184, 0.13), inset 0 0 0 6px rgba(255,255,255,0.65);
}
#browserStatus {
  display: none;
  max-height: 60px;
  margin-top: 8px;
  padding: 8px 10px;
  overflow: auto;
  white-space: pre-wrap;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
  color: #237cbb;
  font: 11px/1.45 "SF Mono", "Fira Code", monospace;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 0;
  border-radius: 14px;
}
.orders-wrap { font-size: 13px; }
.orders-meta { margin-bottom: 10px; color: #6b7280; font-size: 12px; }
.orders-loading, .orders-empty, .orders-error { padding: 24px 8px; text-align: center; color: #6b7280; }
.orders-error { color: #dc2626; }
.orders-table { width: 100%; border-collapse: collapse; }
.orders-table th, .orders-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid #eef0f3; white-space: nowrap; }
.orders-table th { font-weight: 600; color: #374151; background: #f9fafb; position: sticky; top: 0; }
.order-cancelled { color: #9ca3af; font-size: 12px; }
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}
.section-head h3 { margin: 0; }
.log-hint {
  color: var(--dim);
  font-size: 12px;
  margin: 6px 0 8px;
}
#runs {
  max-height: 360px;
  overflow: auto;
}
#runs .table { margin: 0; }
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 8px;
  font-size: 12px;
}
.table th {
  padding: 0 10px 2px;
  color: var(--dim);
  font-size: 11px;
  font-weight: 780;
  text-align: left;
  white-space: nowrap;
}
.table td {
  padding: 10px;
  background: #ffffff;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  word-break: break-word;
}
.table td:first-child { border-left: 1px solid var(--line); border-radius: 12px 0 0 12px; }
.table td:last-child { border-right: 1px solid var(--line); border-radius: 0 12px 12px 0; }

.card-list { display: flex; flex-direction: column; gap: 9px; }
.card-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}
.card-item-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 6px;
}
.card-item-row:last-child { margin-bottom: 0; }
.card-item-label {
  flex-shrink: 0;
  color: var(--dim);
  font-size: 12px;
}
.card-item-value {
  color: var(--text);
  font-size: 13px;
  text-align: right;
  word-break: break-word;
}
.card-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.slot-row-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.slot-row-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.slot-row-main span {
  color: var(--text);
  font-size: 13px;
  font-weight: 780;
  word-break: break-word;
}
.slot-row-main small {
  color: var(--dim);
  font-size: 11px;
  word-break: break-word;
}
.slot-row-card .danger {
  flex-shrink: 0;
}
.time-toolbar {
  display: flex;
  margin-bottom: 8px;
}
.time-toolbar button {
  width: 100%;
  justify-content: center;
}
/* ===== 账号工具栏 ===== */
/* ===== 账号工具栏 ===== */
.user-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  box-shadow: var(--shadow-sm);
}
.utb-search-row,
.utb-action-row {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  gap: 8px;
}
.utb-action-row {
  justify-content: space-between;
}
.utb-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.utb-search-wrap {
  position: relative;
  flex: 1;
  min-width: 140px;
  max-width: none;
}
.utb-search-icon {
  position: absolute;
  left: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--dim);
  pointer-events: none;
}
.utb-search {
  width: 100% !important;
  height: 34px !important;
  min-height: 34px !important;
  padding: 0 10px 0 30px !important;
  font-size: 13px !important;
  border-radius: 10px !important;
  border: 1px solid var(--line) !important;
  background: var(--bg) !important;
  box-shadow: none !important;
}
.utb-search:focus { border-color: var(--primary) !important; box-shadow: 0 0 0 3px rgba(79,140,255,.12) !important; }
.utb-search-btn {
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 12px !important;
  font-size: 12px !important;
  border-radius: 9px !important;
  white-space: nowrap;
  flex-shrink: 0;
}
.utb-count {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.utb-count b { color: var(--text); font-weight: 700; }
.utb-del {
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 12px !important;
  font-size: 12px !important;
  border-radius: 9px !important;
  white-space: nowrap;
  flex-shrink: 0;
  background: #fef2f2 !important;
  color: #dc2626 !important;
  border: 1px solid #fecaca !important;
  cursor: pointer !important;
  box-shadow: none !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  transform: none !important;
}
.utb-del:hover { background: #fee2e2 !important; }
.utb-del:disabled {
  opacity: .45;
  pointer-events: none;
}
.utb-del-hidden { visibility: hidden; pointer-events: none; }
.utb-del-count { font-weight: 600; }
.utb-pager {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.utb-status-select,
.utb-psize {
  height: 32px !important;
  min-height: 32px !important;
  width: auto !important;
  padding: 0 24px 0 10px !important;
  font-size: 12px !important;
  border: 1px solid var(--line) !important;
  border-radius: 9px !important;
  background: var(--bg) !important;
  color: var(--muted) !important;
  cursor: pointer;
  box-shadow: none !important;
  appearance: auto !important;
}
.utb-status-select {
  min-width: 76px;
}
.utb-slot-select {
  width: 108px !important;
  max-width: 108px;
  text-overflow: ellipsis;
}
.u-group-badge:disabled { opacity: .55; cursor: wait; }
.user-card-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.utb-pg-btn {
  height: 32px !important;
  min-height: 32px !important;
  width: 32px !important;
  min-width: 32px !important;
  padding: 0 !important;
  border: 1px solid var(--line) !important;
  border-radius: 9px !important;
  background: var(--bg) !important;
  box-shadow: none !important;
  font-size: 16px !important;
  line-height: 1 !important;
  color: var(--primary) !important;
  cursor: pointer;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  font-weight: 400 !important;
  transform: none !important;
}
.utb-pg-btn:disabled { color: #ccc !important; border-color: #eaeaea !important; cursor: default; }
.utb-pg-btn:not(:disabled):hover { background: #fff !important; border-color: var(--primary) !important; }
.utb-pg-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  padding: 0 4px;
  font-variant-numeric: tabular-nums;
}
.utb-pg-num em {
  font-style: normal;
  font-weight: 400;
  color: var(--dim);
}
/* ===== 账号表格 ===== */
.user-table {
  table-layout: fixed;
  width: 100%;
  min-width: 0;
}
.user-table th,
.user-table td {
  padding: 9px 8px;
  vertical-align: middle;
  white-space: nowrap;
}
.user-table thead th {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  border-bottom: 2px solid var(--line);
  text-align: left;
}
.user-table tbody td {
  font-size: 13px;
  border-bottom: 1px solid #f0f4f8;
}
.user-table tbody td:nth-child(2),
.user-table tbody td:nth-child(3),
.user-table tbody td:nth-child(4),
.user-table tbody td.td-slot {
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-table tbody td:first-child,
.user-table thead th:first-child {
  text-align: center;
  padding-left: 10px;
  padding-right: 10px;
}
.user-table tbody td:first-child,
.user-table tbody td:nth-child(6),
.user-table tbody td:last-child {
  overflow: visible;
  text-overflow: clip;
}
.user-table tbody tr:hover td { background: #f6fffd; }
.user-table tbody tr.row-sel td,
table tr.row-sel td { background: #e9fbf8; }
.user-table tbody tr.row-sel:hover td,
table tr.row-sel:hover td { background: #d9f6f1; }
.user-table input[type="checkbox"],
input.user-sel-cb,
input.task-sel-cb {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 5px !important;
  accent-color: var(--primary);
  cursor: pointer;
  vertical-align: middle;
  flex-shrink: 0;
  transition: none !important;
  box-shadow: none !important;
}
.user-table input[type="checkbox"]:focus,
input.user-sel-cb:focus,
input.task-sel-cb:focus {
  box-shadow: none !important;
  outline: none !important;
  border-color: revert !important;
  background: revert !important;
}

.utb-del.is-disabled {
  opacity: .45;
  pointer-events: none;
  filter: grayscale(.1);
}

.user-select-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.user-select-line input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--primary);
}
.user-nick-text {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 用户表格关联时段徽章（pill 风格） */
.u-slot-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px !important;
  border: 1px solid #bdebcf !important;
  border-radius: 999px !important;
  background: #eafaf1 !important;
  color: #0f8a49 !important;
  box-shadow: none !important;
  cursor: pointer;
  min-height: 22px !important;
  transform: none !important;
  white-space: nowrap;
}
.u-slot-badge:hover { background: #d5f5e3 !important; }
.u-slot-badge.u-slot-empty {
  background: #f9fafb !important;
  border: 1px dashed #d1d5db !important;
  color: #9ca3af !important;
  font-weight: 600;
}
.u-slot-badge.u-slot-empty:hover { border-color: #bdebcf !important; color: #0f8a49 !important; background: #eafaf1 !important; }
.u-slot-more {
  font-size: 10px;
  font-weight: 600;
  color: #0f8a49;
  flex-shrink: 0;
}
/* 关联时段按钮已改用 .slot-summary + .slot-summary.empty */
.manual-slot-row {
  padding: 8px;
  border: 1px dashed #c9e2ff;
  border-radius: 14px;
  background: #f8fcff;
}
.card-item-actions.compact button,
.table-actions button {
  min-height: 26px;
  padding: 3px 7px;
  font-size: 11px;
}
.table-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}
.task-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.task-title {
  min-width: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.slot-summary {
  width: 100%;
  min-height: auto !important;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 6px;
  padding: 6px 8px !important;
  border: 1px solid #c9eee9 !important;
  border-radius: 12px !important;
  background: var(--soft-mint) !important;
  color: #167f77 !important;
  box-shadow: none !important;
  text-align: left;
  white-space: normal;
  font-weight: 400 !important;
  transform: none !important;
}
.slot-summary span {
  font-size: 12px;
  font-weight: 800;
}
.slot-summary small {
  grid-column: 1 / -1;
  color: #6b879d;
  font-size: 10px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.slot-more {
  align-self: start;
  padding: 1px 6px;
  border-radius: 999px;
  background: #ffffff;
  color: #15988d;
  font-size: 10px;
  font-weight: 800;
}
.slot-summary.empty {
  display: inline-flex;
  width: auto;
  color: var(--dim) !important;
  background: #fff !important;
  border-color: var(--line) !important;
  cursor: pointer;
  padding: 4px 10px !important;
}
.slot-summary.empty:hover { border-color: var(--primary) !important; color: var(--primary) !important; }
.slot-detail-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.slot-detail-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fcff;
}
.slot-detail-item b {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--soft-blue);
  color: var(--primary);
  font-size: 12px;
}
.slot-detail-item span {
  color: var(--text);
  font-size: 13px;
  word-break: break-word;
}

.form-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(360px, 1.3fr);
  gap: 12px;
}
.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}
.form-grid label small,
.modal-form label small {
  color: var(--dim);
  font-size: 11px;
  font-weight: 520;
  line-height: 1.35;
}
.form-grid .full-width { grid-column: 1 / -1; }
.task-user-field select {
  min-width: 0;
  width: 100%;
}
.task-name-field input {
  min-width: 0;
}
.form-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}
.form-label em {
  padding: 3px 9px;
  border: 1px solid #c9eee9;
  border-radius: 999px;
  background: var(--soft-mint);
  color: #17988d;
  font-style: normal;
  font-size: 11px;
  white-space: nowrap;
}

/* ===== 任务预约人 / 时间段选择 ===== */
.task-user-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}
.task-user-heading .form-label {
  flex: 1;
  margin-bottom: 0;
}
.task-user-group-filter {
  flex: 0 0 auto;
  min-width: 112px;
}
#taskSlot {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 9px;
  max-height: 240px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fcff;
}
.task-user-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 9px;
  max-height: 240px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fcff;
}
.slot-choice {
  display: grid;
  grid-template-columns: 24px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 9px;
  row-gap: 3px;
  width: 100%;
  min-height: 58px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
  box-shadow: none;
}
.user-choice {
  display: grid;
  grid-template-columns: 24px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 9px;
  row-gap: 3px;
  width: 100%;
  min-height: 58px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #ffffff;
  color: var(--text);
  text-align: left;
  box-shadow: none;
}
.user-choice.selected {
  border-color: #78dcd2;
  background: linear-gradient(135deg, #eafffc, #eef6ff);
  box-shadow: 0 0 0 3px rgba(40, 199, 183, 0.1);
}
.slot-choice.selected {
  border-color: #78dcd2;
  background: linear-gradient(135deg, #eafffc, #eef6ff);
  box-shadow: 0 0 0 3px rgba(40, 199, 183, 0.1);
}
.user-choice-check {
  grid-row: 1 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid #cbddeb;
  border-radius: 50%;
  color: transparent;
  font-weight: 800;
  background: #fff;
}
.slot-check {
  grid-row: 1 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 1px solid #cbddeb;
  border-radius: 50%;
  color: transparent;
  font-weight: 800;
}
.user-choice.selected .user-choice-check {
  color: white;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--primary));
}
.slot-choice.selected .slot-check {
  color: white;
  border-color: transparent;
  background: linear-gradient(135deg, var(--accent), var(--primary));
}
.slot-main { color: var(--text); font-size: 13px; font-weight: 760; word-break: break-word; }
.slot-sub { color: var(--dim); font-size: 11px; word-break: break-word; }
.user-choice-main {
  color: var(--text);
  font-size: 13px;
  font-weight: 760;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-choice-sub {
  color: var(--dim);
  font-size: 11px;
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.user-choice-person {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-user-group-tag {
  flex: 0 0 auto;
  padding: 1px 6px;
  border: 1px dashed #c9d6e2;
  border-radius: 999px;
  background: #f8fafc;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.45;
}
.task-user-group-tag.customer {
  border-color: #a9ded7;
  background: #effcf9;
  color: #14877e;
}
.empty-state {
  grid-column: 1 / -1;
  padding: 14px 10px;
  color: var(--dim);
  text-align: center;
  font-size: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}
.ok { color: #0f8a49; background: #eafaf1; border: 1px solid #bdebcf; }
.warn { color: #b77900; background: #fff8e6; border: 1px solid #ffe1a3; }
.bad { color: #d92d43; background: #fff0f2; border: 1px solid #ffd0d7; }

#modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.modal-backdrop { position: absolute; inset: 0; background: rgba(31, 42, 68, 0.28); backdrop-filter: blur(6px); }
.modal-container {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 620px;
  max-height: 84vh;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: var(--shadow);
  animation: modalIn 0.18s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.96) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}
.modal-title { font-size: 14px; font-weight: 800; }
.modal-close {
  min-height: auto;
  padding: 4px 8px;
  background: transparent;
  box-shadow: none;
  color: var(--dim);
  font-size: 22px;
  line-height: 1;
}
.modal-body { flex: 1; overflow-y: auto; padding: 16px; }
.confirm-box,
.notice-box {
  display: grid;
  gap: 14px;
  justify-items: center;
  text-align: center;
  padding: 8px 4px 2px;
}
.confirm-icon,
.notice-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: rgba(69, 143, 246, 0.14);
  color: var(--primary);
  font-size: 24px;
  font-weight: 900;
}
.success-notice .notice-icon {
  background: rgba(34, 197, 94, 0.14);
  color: #0f8a49;
}
.warning-notice .notice-icon,
.confirm-icon {
  background: rgba(255, 179, 71, 0.18);
  color: #d88700;
}
.danger-confirm .confirm-icon,
.danger-notice .notice-icon {
  background: rgba(255, 94, 94, 0.14);
  color: var(--danger);
}
.confirm-message,
.notice-message {
  max-width: 420px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  padding: 0;
  border: 0;
  background: transparent;
}
.confirm-actions,
.notice-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding-top: 2px;
}
.confirm-actions button,
.notice-actions button { min-width: 104px; }
.detail-live-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--dim);
  font-size: 12px;
}
.detail-live-head button { margin-left: auto; }
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #22c55e;
  box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.12);
}
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--dim);
  font-size: 12px;
}
.modal-form {
  display: grid;
  grid-template-columns: minmax(160px, 0.65fr) minmax(380px, 1.35fr);
  gap: 12px;
}
.modal-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}
.modal-form .full-width,
.modal-actions {
  grid-column: 1 / -1;
}
.password-form {
  grid-template-columns: 1fr;
}
.password-form label,
.password-form .modal-actions {
  grid-column: 1 / -1;
}
.edit-slot-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #f8fcff;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}
.modal-body pre {
  max-height: 220px;
  overflow: auto;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f8fbff;
  color: #246b9a;
  white-space: pre-wrap;
  word-break: break-all;
  font: 11px/1.5 "SF Mono", "Fira Code", monospace;
}
.detail-section { margin-bottom: 13px; }
.detail-section h4 { margin-bottom: 6px; color: var(--muted); font-size: 12px; }

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.login-wrap {
  width: min(420px, 100%);
}
.login-card {
  padding: 24px;
}
.login-brand {
  margin-bottom: 12px;
  color: var(--text);
  font-size: 22px;
  font-weight: 880;
  letter-spacing: -0.03em;
}
.login-notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 10px 0 14px;
  padding: 12px 13px;
  border: 1px solid rgba(245, 158, 11, .45);
  border-radius: 16px;
  background: linear-gradient(135deg, #fff7ed, #fffbeb);
  color: #7c2d12;
  box-shadow: 0 12px 26px rgba(245, 158, 11, .14);
}
.login-notice .notice-icon {
  display: grid;
  place-items: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #f97316;
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
}
.login-notice strong {
  display: block;
  margin-bottom: 4px;
  color: #111827;
  font-size: 15px;
  font-weight: 900;
}
.login-notice span {
  display: block;
  color: #7c2d12;
  font-size: 13px;
  font-weight: 760;
  line-height: 1.65;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}
.login-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}
.login-error {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #fecaca;
  border-radius: 12px;
  background: #fff1f2;
  color: #dc2626;
  font-size: 12px;
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c8dcec; border-radius: 999px; }

.truncate { display: inline-block; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }

@media (max-width: 600px) {
  header { padding: 12px 13px 10px; flex-direction: column; align-items: stretch; gap: 10px; }
  header h1 { font-size: 17px; }
  .muted { font-size: 10px; line-height: 1.35; }
  .account-actions { justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
  .grid { padding: 10px; gap: 12px; }
  .card { padding: 14px; border-radius: 20px; }
  .card h2 { font-size: 15px; margin-bottom: 10px; }
  .card h3 { margin-top: 15px; }
  .task-section-head { align-items: flex-start; flex-direction: column; }
  .scheduler-capacity-settings { width: 100%; flex-wrap: wrap; }
  .scheduler-capacity-settings span { margin-left: auto; text-align: right; }
  .btn-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; gap: 8px; }
  .btn-group .mode-indicator { grid-column: 1 / -1; width: 100%; }
  .row { width: 100%; margin: 0; }
  .input-group { width: 100%; }
  .input-group button { flex-shrink: 0; }
  button { min-height: 42px; padding: 10px 12px; font-size: 13px; }
  button.sm { min-height: 34px; padding: 7px 10px; font-size: 12px; }
  input, select { min-height: 44px; font-size: 16px; }
  .form-grid { grid-template-columns: 1fr; gap: 11px; }
  .task-user-heading { align-items: flex-end; }
  .task-user-heading .form-label { min-width: 0; }
  .task-user-group-filter { min-width: 104px; width: auto; font-size: 14px; }
  #taskSlot, .task-user-picker { grid-template-columns: 1fr; max-height: 280px; padding: 7px; }
  .slot-choice, .user-choice { min-height: 62px; padding: 12px; }
  .card-item { padding: 12px; }
  .card-item-row {
    align-items: flex-start;
  }
  .card-item-value {
    max-width: none;
    min-width: 0;
    flex: 1;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    word-break: break-word;
  }
  .card-item-value .u-slot-badge,
  .card-item-value .slot-summary {
    max-width: 100%;
    white-space: normal;
  }
  .card-item-actions { display: flex; flex-wrap: wrap; }
  .card-item-actions button { flex: 0 0 auto; }
  .user-toolbar { gap: 8px; padding: 10px; }
  .utb-search-row { align-items: stretch; flex-wrap: wrap; }
  .utb-search-row .utb-search-wrap { flex-basis: calc(100% - 64px); }
  .utb-action-row { align-items: flex-start; flex-wrap: wrap; }
  .utb-search-wrap { max-width: none; }
  .utb-pager { margin-left: auto; flex-wrap: wrap; max-width: 100%; }
  .utb-pager .utb-pg-num { white-space: nowrap; }
  #screen { max-width: 100%; border-radius: 22px; }
  #floatingScreen { padding: 8px; align-items: flex-start; }
  .floating-screen-card { width: 100%; max-height: calc(100vh - 16px); border-radius: 20px; }
  .floating-screen-body { padding: 8px; justify-content: center; }
  .modal-container { max-height: 90vh; border-radius: 18px; }
  .modal-body { padding: 12px; }
  .modal-form { grid-template-columns: 1fr; gap: 10px; }
  .edit-slot-list { grid-template-columns: 1fr; max-height: 260px; padding: 7px; }
  .modal-actions { justify-content: stretch; }
  .modal-actions button { flex: 1; }
  .modal-body pre { font-size: 10px; }
}

@media (min-width: 1024px) {
  .grid { display: grid; grid-template-columns: minmax(420px, 480px) 1fr; }
  .full { grid-column: 1 / -1; }
}

/* ===== 代理总开关 ===== */
.proxy-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  flex-wrap: nowrap;
  white-space: nowrap;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.75);
}
.proxy-switch input { display: none; }
.proxy-switch-slider {
  position: relative;
  width: 38px;
  height: 20px;
  background: var(--line);
  border-radius: 999px;
  transition: background .2s;
  flex: 0 0 auto;
}
.proxy-switch-slider::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.proxy-switch input:checked + .proxy-switch-slider {
  background: #2ecc71;
}
.proxy-switch input:checked + .proxy-switch-slider::before {
  transform: translateX(18px);
}
.proxy-switch-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-block;
}

.account-actions .proxy-port-select {
  height: 34px;
  min-height: 34px;
  width: 68px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 760;
  flex-shrink: 0;
  line-height: 1;
}

/* 时间段分页 */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 4px 4px;
  flex-wrap: wrap;
}
.pager-info {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}
.pager button[disabled] {
  opacity: .45;
  cursor: not-allowed;
}

/* 全局请求限流 */
.rate-limit-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: #f8fcff;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.top-rate-limit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
}
.top-rate-limit .proxy-switch {
  margin: 0;
}
.top-rate-limit .rate-limit-field {
  margin: 0;
  gap: 3px;
  white-space: nowrap;
}
.top-rate-limit .rate-limit-field input {
  width: 20px !important;
  height: 26px !important;
  min-height: 26px !important;
  padding: 0 1px !important;
  text-align: center;
}
.rate-limit-head {
  min-width: 180px;
  flex: 1;
}
.rate-limit-desc {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--dim);
  line-height: 1.4;
}
.rate-limit-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  margin: 0;
}
.rate-limit-field input {
  width: 96px !important;
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 9px !important;
  font-size: 13px !important;
}
.top-rate-limit .rate-limit-field input#rateLimitPerSecond {
  width: 42px !important;
  max-width: 42px !important;
  min-width: 42px !important;
  flex: 0 0 42px !important;
  height: 26px !important;
  min-height: 26px !important;
  padding: 0 4px !important;
  text-align: center;
}
.top-rate-limit input#rateLimitPerSecond::-webkit-outer-spin-button,
.top-rate-limit input#rateLimitPerSecond::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.top-rate-limit input#rateLimitPerSecond[type="number"] {
  -moz-appearance: textfield;
}

/* 放号探测器 */
.probe-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
  background: var(--soft-mint);
}
.probe-head { display: flex; align-items: center; gap: 8px; }
.probe-title { font-weight: 850; font-size: 14px; color: var(--text); }
.probe-dot { width: 9px; height: 9px; border-radius: 50%; background: #b7c3d4; flex: 0 0 auto; }
.probe-dot.on { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245,158,11,.18); animation: probePulse 1s infinite; }
.probe-dot.hit { background: var(--success); box-shadow: 0 0 0 3px rgba(24,160,88,.18); }
@keyframes probePulse { 0%,100%{opacity:1} 50%{opacity:.4} }
.probe-state { font-size: 12px; font-weight: 760; color: var(--muted); }
.probe-desc { font-size: 11px; color: var(--dim); margin: 6px 0 8px; line-height: 1.4; }
.probe-actions { display: flex; gap: 8px; margin-bottom: 8px; }
.probe-log {
  font-size: 12px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  word-break: break-all;
}

/* 探测门控开关 */
.probe-gate {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  margin-bottom: 8px;
}
.probe-gate input { display: none; }
.probe-gate-slider {
  position: relative;
  width: 38px; height: 20px;
  background: var(--line);
  border-radius: 999px;
  transition: background .2s;
  flex: 0 0 auto;
}
.probe-gate-slider::before {
  content: ""; position: absolute; left: 2px; top: 2px;
  width: 16px; height: 16px; background: #fff;
  border-radius: 50%; transition: transform .2s;
  box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.probe-gate input:checked + .probe-gate-slider { background: var(--primary); }
.probe-gate input:checked + .probe-gate-slider::before { transform: translateX(18px); }
.probe-gate-label { font-size: 12px; font-weight: 760; color: var(--muted); white-space: nowrap; }

/* 探测门控未开探测器警示 */
.probe-warn {
  margin: 8px 0;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.5;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 8px;
}
