/* ============================================================
   admin.css — 后台样式
   ============================================================ */

.admin-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
  background: var(--bg-1);
  font-family: "Noto Sans SC", "Source Han Sans SC", "Source Han Sans CN", "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
}

/* 覆盖 base.css 通用组件字号（后台专属） */
.admin-shell .btn,
.admin-shell .btn-sm { font-size: 14px; }
.admin-shell .input,
.admin-shell .select,
.admin-shell .textarea { font-size: 14px; }
.admin-shell .field-label { font-size: 10px; }

.admin-sidebar {
  background: #1f2330;
  color: #d6dae8;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  align-self: start; /* grid 关键：不被 stretch，固定 100vh */
}
.admin-sidebar .brand {
  padding: 20px 18px;
  font-size: 18px;
  font-weight: 600;
  border-bottom: 1px solid #2c3142;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.admin-sidebar .brand .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--color-primary);
  box-shadow: 0 0 8px var(--color-primary);
}
.admin-sidebar nav {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}
.admin-sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: #b4bdd6;
  font-size: 16px;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.admin-sidebar nav a:hover { background: #2c3142; color: #fff; text-decoration: none; }
.admin-sidebar nav a.active {
  background: var(--color-primary);
  color: #fff;
}
.admin-sidebar nav a .icon {
  width: 18px; height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.admin-sidebar .foot {
  padding: 14px 16px;
  border-top: 1px solid #2c3142;
  font-size: 14px;
  color: #7d8499;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.admin-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  background: var(--bg-1);
}
.admin-topbar {
  height: 60px;
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 14px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 5;
}
.admin-topbar .page-title {
  font-size: 19px;
  font-weight: 600;
  color: var(--color-text);
}
.admin-topbar .grow { flex: 1; }
.admin-topbar .actions { display: flex; gap: 8px; }

.admin-content {
  flex: 1;
  padding: 24px;
  width: 100%;
}

/* 数据看板 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.stat-card {
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
}
.stat-card .label { font-size: 14px; color: var(--color-text-soft); }
.stat-card .value {
  font-size: 30px;
  font-weight: 700;
  margin-top: 4px;
  color: var(--color-text);
}
.stat-card .meta { font-size: 14px; color: var(--color-text-mute); margin-top: 4px; }
.stat-card.primary { background: linear-gradient(135deg, #fff6ea 0%, #ffe5cb 100%); }
.stat-card.success { background: linear-gradient(135deg, #e7f6ee 0%, #c9eed8 100%); }

/* 表格 */
.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
}
.admin-table th,
.admin-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
  font-size: 15px;
  vertical-align: middle;
  white-space: nowrap;
}
.admin-table td[data-label="说明"] {
  white-space: normal;
  max-width: 360px;
}
.admin-table thead th {
  background: #f4f6fb;
  font-weight: 600;
  color: var(--color-text-soft);
}
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover { background: #fafbfd; }
.admin-table .actions { display: flex; gap: 6px; flex-wrap: nowrap; }

/* 登录页 */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(800px 400px at 20% 0%, #c5e1ff 0%, transparent 60%),
    radial-gradient(800px 400px at 80% 100%, #ffe5cb 0%, transparent 60%),
    linear-gradient(180deg, #eaf6ff 0%, #fef0d8 100%);
}
.login-card {
  width: 100%;
  max-width: 380px;
  padding: 32px 28px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(255, 255, 255, 0.7);
}
.login-card h1 {
  font-size: 24px;
  margin: 0 0 6px;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.login-card .sub {
  font-size: 15px;
  color: var(--color-text-soft);
  margin-bottom: 22px;
}
.login-card .field { margin-bottom: 14px; }
.login-card .btn-primary { width: 100%; }
/* 未连接云端时登录页的提示（新设备拉不到其他设备建的账号） */
.login-cloud-hint {
  margin-top: 10px;
  padding: 10px 12px;
  background: #fff8e1;
  color: #8a6100;
  border: 1px solid #f0dfa8;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.6;
  text-align: left;
}

/* 表单 */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.form-grid .full { grid-column: 1 / -1; }
.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--color-border);
}

/* 云端未连接警告横幅（topbar 与内容区之间） */
.cloud-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 12px 0;
  padding: 8px 12px;
  background: #fff7e6;
  border: 1px solid #f0c36d;
  border-radius: var(--radius-md);
  font-size: 13px;
  color: #8a5a00;
}
.cloud-banner .txt { line-height: 1.5; }
.cloud-banner .btn-sm { flex-shrink: 0; }
@media (max-width: 600px) {
  .cloud-banner { margin: 8px 10px 0; flex-direction: column; align-items: stretch; text-align: left; }
  .cloud-banner .btn-sm { align-self: flex-end; }
}

/* 弹窗 */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 27, 45, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}
.modal {
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 24px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal h3 {
  margin: 0 0 14px;
  font-size: 18px;
}
.modal .field { margin-bottom: 12px; }

/* Toast */
.toast-wrap {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 10px 18px;
  border-radius: var(--radius-md);
  background: rgba(20, 27, 45, 0.92);
  color: #fff;
  font-size: 14px;
  box-shadow: var(--shadow-soft);
  animation: toastIn 0.2s ease;
}
.toast.success { background: #2fa971; }
.toast.error { background: #e94e60; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* 卡片 / 通用 */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-soft);
  padding: 18px 22px;
  margin-bottom: 16px;
}
.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.card-title {
  font-weight: 600;
  font-size: 17px;
  color: var(--color-text);
  flex: 1;
}
.quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ---------- 手机版背景图库 ---------- */
.bg-lib-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.bg-lib-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bg-lib-thumb {
  width: 100%;
  aspect-ratio: 9 / 16;
  border-radius: 8px;
  overflow: hidden;
  background: #eef1f6;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bg-lib-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.bg-lib-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--color-text);
  text-align: center;
}
.bg-lib-meta {
  font-size: 12px;
  color: var(--color-text-soft);
  text-align: center;
}
.bg-lib-actions {
  display: flex;
  gap: 6px;
  justify-content: center;
}
.hint {
  background: var(--bg-tag-blue);
  color: #1f4d99;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 12px;
}
.hint-info {
  background: #e7f6ee;
  color: #2c7a52;
  margin-top: 12px;
  margin-bottom: 0;
}
/* 冲突提示：云端比本地新，自动保存被乐观锁拦截 */
.hint-danger {
  background: #fdecee;
  color: #b3243a;
  margin-top: 12px;
  margin-bottom: 0;
  border-left: 3px solid #e94e60;
}
.hint-danger .btn {
  margin-top: 8px;
}
.data-summary {
  font-size: 15px;
  color: var(--color-text-soft);
  line-height: 1.9;
}

/* 筛选行 */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}
.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  color: var(--color-text-soft);
  cursor: pointer;
}

/* 开关 */
.switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 15px;
  color: var(--color-text-soft);
}
.switch input { width: 36px; height: 20px; cursor: pointer; }
.switch span { min-width: 60px; }

/* 标签 */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
}
.tag-today      { background: #ffe5cb; color: #b35b1a; }
.tag-tomorrow   { background: #fff6cc; color: #8a7400; }
.tag-day-after  { background: #d8f0e0; color: #2c7a52; }
.tag-warn       { background: #ffe1e1; color: #b42318; }
.tag-week       { background: #e0eaff; color: #2c4ea8; }
.tag-free       { background: #e8e8ee; color: #6a7088; }
.tag-default    { background: #f0f0f5; color: #6a7088; }

/* 字段编辑 */
.inline-input {
  display: inline-block;
  max-width: 240px;
  padding: 4px 8px;
  font-size: 15px;
}

/* 隐藏行 */
.row-hidden { opacity: 0.55; }

/* 用户管理 - 侧边栏用户卡 */
.user-card {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.user-name {
  font-size: 15px;
  color: #d6dae8;
  display: flex;
  align-items: center;
  gap: 6px;
}
.role-tag {
  display: inline-block;
  padding: 1px 6px;
  font-size: 12px;
  border-radius: 4px;
  background: #2c3142;
  color: #b4bdd6;
}
.role-tag.super {
  background: #b35b1a;
  color: #fff;
}
.user-actions { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }

.hint-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 13px;
  background: #fff6ea;
  color: #b35b1a;
}

/* 访客页快捷入口（topbar 右上） */
.quick-public {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn.btn-public {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: linear-gradient(135deg, #2c7a52 0%, #3a9a6c 100%);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 500;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 3px rgba(44, 122, 82, 0.3);
}
.btn.btn-public:hover {
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(44, 122, 82, 0.4);
}
.btn.btn-public .ico { font-size: 12px; }
.btn.btn-public-ghost {
  padding: 6px 12px;
  background: transparent;
  color: var(--color-text-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn.btn-public-ghost:hover {
  background: #f4f6fb;
  color: var(--color-text);
  border-color: #c8cfdd;
}

/* expandable 编辑 */
.exp-section {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px;
  margin-bottom: 10px;
}
.exp-head {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}
.exp-head .input { flex: 1; }

/* modal-lg 在弹窗复用 */
.modal-lg { max-width: 640px; }
.modal .field-label { font-size: 14px; color: var(--color-text-soft); display: block; margin-bottom: 4px; }
.modal .field { margin-bottom: 10px; }

/* ============================================================
   响应式
   ============================================================ */
.admin-topbar .menu-btn { display: none; }

/* ---------- 平板 / 大屏手机（≤900px）：侧边栏变抽屉 ---------- */
@media (max-width: 900px) {
  /* 关键修复：侧边栏 fixed 后网格必须收成单列，
     否则主内容区左侧永久空出 220px，手机上整个被挤没 */
  .admin-shell { grid-template-columns: 1fr; }

  .admin-sidebar {
    position: fixed;
    left: -240px;
    top: 0;
    height: 100vh;
    width: 220px;
    z-index: 50;
    transition: left 0.2s ease;
    box-shadow: none;
  }
  .admin-sidebar.open {
    left: 0;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.35);
  }

  .admin-topbar { padding: 0 12px; gap: 8px; height: 54px; }
  .admin-topbar .page-title { font-size: 16px; }
  .admin-topbar .actions { gap: 6px; }

  .admin-content { padding: 12px; }
  .form-grid { grid-template-columns: 1fr; }
  .admin-topbar .menu-btn { display: inline-flex; }

  /* 弹窗宽度跟随屏宽 */
  .modal { max-width: 92vw; }
  .modal-lg { max-width: 94vw; }
}

/* ---------- 手机（≤600px）：表格转卡片 + 细节压缩 ---------- */
@media (max-width: 600px) {
  .admin-topbar { padding: 0 8px; }
  .admin-topbar .page-title { font-size: 15px; flex: 1; min-width: 0; }
  .admin-topbar .actions .btn { padding: 5px 8px; font-size: 13px; }

  .admin-content { padding: 10px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }

  .card { padding: 12px; border-radius: 10px; }
  .card-title { font-size: 15px; }
  .page-head { flex-direction: column; align-items: stretch; gap: 8px; }
  .page-head .form-actions { flex-wrap: wrap; }

  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-card { padding: 12px; }
  .stat-card .value { font-size: 22px; }

  .admin-table, .admin-table thead, .admin-table tbody,
  .admin-table tr, .admin-table th, .admin-table td { display: block; }
  .admin-table thead { display: none; }
  .admin-table tbody tr {
    margin-bottom: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    padding: 10px;
    background: #fff;
  }
  .admin-table td {
    border-bottom: 0;
    padding: 5px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    white-space: normal;
    word-break: break-all;
  }
  .admin-table td::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--color-text-soft);
    font-size: 13px;
    flex-shrink: 0;
    margin-right: 10px;
  }
  .admin-table td .actions {
    flex-wrap: wrap;
    justify-content: flex-start;
    padding-top: 8px;
    margin-top: 4px;
    border-top: 1px dashed var(--color-border);
  }
  .admin-table td .btn-sm { font-size: 13px; padding: 4px 8px; }

  /* 弹窗：占满宽度、内容可滚动、适配 iOS 安全区 */
  .modal-backdrop { padding: 10px; align-items: flex-end; }
  .modal {
    max-width: 100%;
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    border-radius: 14px 14px 0 0;
    padding: 14px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }
  .modal h3 { font-size: 17px; }
  .modal .form-actions { flex-wrap: wrap; }
  .modal .form-actions .btn { flex: 1 1 40%; }

  /* 登录页 */
  .login-shell { padding: 20px 14px; }
  .login-card { padding: 22px 16px; border-radius: 14px; }
  .login-card h1 { font-size: 20px; }

  .form-actions { flex-wrap: wrap; }
  .hint { font-size: 13px; padding: 8px 10px; }
}
/* 主播头像预览（列表 + 编辑弹窗）——圆形，方图自动取中间 */
.bc-admin-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef1f6;
  border: 1px solid var(--color-border);
  color: #98a0b3;
  font-weight: 600;
}

/* ============================================================
   半自动传图页（renderSemiAuto）
   说明：该页已包进 shell()，落入 .admin-content（自带留边距）。
   这里只补「居中 + 返回按钮 + 表单卡片留白」，专门解决
   手机端内容贴边、按钮难点的问题。
   ============================================================ */
.semi-auto-page {
  max-width: 760px;
  margin: 0 auto;
}
.semi-auto-page .sa-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: sticky;
  top: 8px;
  z-index: 20;
  margin: 0 0 16px;
  padding: 8px 16px;
  font-size: 15px;
  cursor: pointer;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-soft);
  transition: all 0.15s ease;
}
.semi-auto-page .sa-back:hover {
  background: #f4f6fb;
  color: var(--color-text);
  border-color: #c8cfdd;
}
.semi-auto-page .page-head { margin-bottom: 16px; }
.semi-auto-page .page-head h2 { margin: 0 0 10px; }
.semi-auto-page .form-card {
  background: var(--bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 22px 24px;
}
.semi-auto-page .form-row { margin-bottom: 18px; }
.semi-auto-page .form-row .field-label {
  display: block;
  margin-bottom: 6px;
}
.semi-auto-page .form-row .select,
.semi-auto-page .form-row .sa-file { width: 100%; }
.semi-auto-page .sa-thumb { margin-top: 10px; }
.semi-auto-page .sa-thumb img { display: block; }
.semi-auto-page .form-actions .btn { padding: 10px 18px; }
/* 保存结果卡片：给明确的返回 / 再传出口，避免手机端卡在结果页只能刷新 */
.semi-auto-page .sa-result {
  margin-top: 18px;
  padding: 18px 20px;
  background: #f3fbf4;
  border: 1px solid #bfe6c6;
  border-radius: var(--radius-lg);
}
.semi-auto-page .sa-result-msg { font-size: 15px; color: #1f7a36; margin-bottom: 14px; }
.semi-auto-page .sa-result-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.semi-auto-page .sa-result-actions .btn { flex: 1; min-width: 120px; }
/* 手机端：卡片更贴边但有留白，按钮更好点 */
@media (max-width: 600px) {
  .semi-auto-page .form-card { padding: 16px; border-radius: 12px; }
  /* 2026-09-18 马老师实测：识别出结果后按钮被压成竖排文字、点不到。
     病根 = .form-actions 不换行 + .btn{flex:1;min-width:0} 可被压到比文字还窄。
     修法：允许换行、按钮不参与压缩（保留最小宽度 + 文字不折行），状态文字独占一行。 */
  .semi-auto-page .form-actions { gap: 10px; flex-wrap: wrap; align-items: center; }
  .semi-auto-page .form-actions .btn {
    flex: 1 1 45%;
    min-width: 132px;
    white-space: nowrap;
    padding: 12px 10px;
    font-size: 15px;
  }
  .semi-auto-page .form-actions .hint { flex: 1 1 100%; }
}
/* 预览表格：手机上横向可滚动，避免表格把按钮挤扁（识别后最容易踩） */
.semi-auto-page .sa-tbl-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.semi-auto-page .sa-tbl-wrap table { min-width: 520px; }
.semi-auto-page .sa-tbl-wrap .sa-name,
.semi-auto-page .sa-tbl-wrap .sa-code { min-width: 110px; }

/* ===== 批量上传模式（自动认人头） ===== */
.semi-auto-page .sa-mode-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}
.semi-auto-page .sa-mode-btn {
  flex: 1;
  min-width: 0;
  padding: 11px 12px;
  font-size: 15px;
  text-align: center;
  cursor: pointer;
  background: var(--bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-soft);
  transition: all 0.15s ease;
}
.semi-auto-page .sa-mode-btn:hover { border-color: #c8cfdd; color: var(--color-text); }
.semi-auto-page .sa-mode-btn.active {
  background: #eef2ff;
  border-color: #93b4ff;
  color: #2b5cff;
  font-weight: 600;
}
.semi-auto-page .sa-mode-pane { margin-bottom: 8px; }

/* 已选图列表 */
.semi-auto-page .sa-batch-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin: 12px 0 16px;
}
.semi-auto-page .sa-batch-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}
.semi-auto-page .sa-batch-idx {
  align-self: flex-start;
  padding: 1px 8px;
  font-size: 12px;
  font-weight: 600;
  color: #2b5cff;
  background: #eef2ff;
  border-radius: 999px;
}
.semi-auto-page .sa-batch-name {
  font-size: 13px;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.semi-auto-page .sa-batch-st { font-size: 12px; color: var(--color-text-soft); }

/* 错误提示 */
.semi-auto-page .sa-batch-err {
  margin: 8px 0;
  padding: 8px 12px;
  font-size: 13px;
  color: #c0392b;
  background: #fff1f0;
  border: 1px solid #f5c2c0;
  border-radius: var(--radius-md);
}

/* 按主播分组的预览 */
.semi-auto-page .sa-batch-preview { margin-top: 6px; }
.semi-auto-page .sa-batch-group {
  margin-bottom: 16px;
  background: var(--bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.semi-auto-page .sa-batch-group-h {
  padding: 10px 14px;
  font-weight: 600;
  background: #f6f8fc;
  border-bottom: 1px solid var(--color-border);
}
.semi-auto-page .sa-batch-group > .sa-batch-err,
.semi-auto-page .sa-batch-group > .sa-batch-unknown,
.semi-auto-page .sa-batch-group > .sa-batch-row { padding: 10px 14px; }
.semi-auto-page .sa-batch-group > .sa-batch-row { border-bottom: 1px dashed #e6e9f0; }
.semi-auto-page .sa-batch-group > .sa-batch-row:last-child { border-bottom: none; }

/* 未识别主播：人工指派 */
.semi-auto-page .sa-batch-unknown {
  background: #fff7ed;
  border-bottom: 1px solid #f3d3b0;
}
.semi-auto-page .sa-batch-hostsel {
  display: block;
  width: 100%;
  margin: 8px 0 4px;
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
}

/* 单条派送行：宝可梦名 + 密语 + 状态 */
.semi-auto-page .sa-batch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.semi-auto-page .sa-batch-rlabel {
  flex: 0 0 auto;
  min-width: 72px;
  font-size: 14px;
  color: var(--color-text-soft);
}
.semi-auto-page .sa-b-name,
.semi-auto-page .sa-b-code {
  flex: 1 1 160px;
  min-width: 120px;
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--color-text);
}
.semi-auto-page .sa-b-name:focus,
.semi-auto-page .sa-b-code:focus { border-color: #93b4ff; outline: none; }
.semi-auto-page .sa-b-status {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--color-text-soft);
  white-space: nowrap;
}

/* 截止时间「跟随」态：同一主播共用一个截止时间，其余各只只读跟随第一只 */
.input-locked {
  background: #eef1f6;
  color: #6b7280;
  cursor: not-allowed;
  border-style: dashed;
}
#e-deadline-hint { color: #6b7280; line-height: 1.5; }

/* 单主播模式·认人头校验：图被识别为别的主播时黄色提示 + 一键摆正 */
.sa-host-mismatch {
  margin: 0 0 12px;
  padding: 10px 12px;
  background: #fff7e0;
  border: 1px solid #f0c36d;
  border-radius: 8px;
  color: #8a6d1e;
  font-size: 13px;
  line-height: 1.6;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.sa-host-mismatch b { color: #b8860b; }
.sa-host-mismatch .btn {
  margin-left: auto;
  padding: 4px 12px;
  font-size: 12px;
  background: #f0c36d;
  border-color: #e0a93b;
  color: #5c4500;
}
.sa-host-mismatch .btn:hover { background: #f5cd7a; }
