:root {
  color-scheme: light;
  --bg: #f7f7f8;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-soft: #f4f4f5;
  --surface-muted: #f4f4f5;
  --surface-hover: #f4f4f5;
  --surface-pressed: #eaeaec;
  --border: #ececef;
  --border-strong: #d4d4d8;
  --text: #18181b;
  --text-muted: #6b7280;
  --text-faint: #9ca3af;
  --accent: #18181b;
  --accent-hover: #27272a;
  --accent-soft: #f4f4f5;
  --accent-line: #d4d4d8;
  --green: #16a34a;
  --green-soft: #ecfdf5;
  --amber: #b45309;
  --amber-soft: #fffbeb;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  /* Agent 科技感 accent — 用 indigo→violet 渐变作为高亮 */
  --tech-1: #6366f1;
  --tech-2: #a855f7;
  --tech-3: #06b6d4;
  --tech-glow: 0 0 24px rgba(99, 102, 241, 0.25);
  --tech-glow-strong: 0 0 32px rgba(99, 102, 241, 0.42);
  --tech-grad: linear-gradient(135deg, var(--tech-1) 0%, var(--tech-2) 100%);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 14px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 18px 40px rgba(15, 23, 42, 0.12);
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
}

body {
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Helvetica Neue", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a:hover {
  color: var(--accent-hover);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  min-height: 44px;
  padding: 0 20px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

button:hover {
  background: var(--surface-hover);
  border-color: var(--accent-line);
}

button:active {
  background: var(--surface-pressed);
}

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 600;
  position: relative;
  overflow: hidden;
}

button.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* primary.glow → 主 CTA 加深阴影强调 */
button.primary.glow {
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
}

button.primary.glow:hover {
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.24);
}

button.ghost {
  background: transparent;
  border-color: transparent;
}

button.ghost:hover {
  background: var(--surface-hover);
  border-color: var(--border);
}

button.danger {
  border-color: rgba(248, 113, 113, 0.4);
  color: var(--red);
}

button.danger:hover {
  background: var(--red-soft);
  border-color: var(--red);
}

input,
select,
textarea {
  width: 100%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text);
  min-height: 46px;
  padding: 11px 16px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(24, 24, 27, 0.08);
}

textarea {
  resize: vertical;
  min-height: 110px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.5;
}

::placeholder {
  color: var(--text-faint);
}

/* ============ Top Nav ============ */

.app-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 44px;
  padding: 0 48px;
  height: 80px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.app-nav-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.01em;
  color: var(--text);
}

.app-nav-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--text);
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
}

.app-nav-links {
  display: flex;
  gap: 8px;
  align-items: center;
}

.app-nav-links a {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 20px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 16px;
  font-weight: 500;
  transition: color 0.15s ease, background 0.15s ease;
}

.app-nav-links a:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.app-nav-links a.active {
  color: var(--text);
  background: var(--surface-soft);
}

.app-nav-spacer {
  flex: 1;
}

.app-nav-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 20px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 15px;
  color: var(--text-muted);
}

.app-nav-status::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.18);
  animation: live-pulse 2.4s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% {
    box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.18), 0 0 8px rgba(52, 211, 153, 0.5);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(52, 211, 153, 0.06), 0 0 14px rgba(52, 211, 153, 0.3);
  }
}

.app-nav-status.offline::before {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.18);
}

.app-nav-logout {
  margin-left: 12px;
  height: 36px;
  padding: 0 16px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.app-nav-logout:hover {
  background: var(--red-soft, #fee2e2);
  color: #b91c1c;
  border-color: #fecaca;
}

/* ============ Page Layout ============ */

.page {
  max-width: 1320px;
  margin: 0 auto;
  padding: 56px 40px 96px;
  display: grid;
  gap: 36px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.page-header > div:first-child {
  min-width: 0;
  max-width: 560px;
}

.page-header h1 {
  margin: 0;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-header p {
  margin: 12px 0 0;
  color: var(--text-muted);
  font-size: 16px;
}

.page-header .actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  flex-wrap: nowrap;
}

.page-header .actions button {
  min-height: 48px;
  padding: 0 16px;
  font-size: 16px;
  white-space: nowrap;
}

.page-header .actions .inline-date {
  width: 160px;
  min-height: 48px;
  font-size: 15px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.page-header .actions .doc-link-btn {
  text-decoration: none;
}
.page-header .actions .doc-link-btn button {
  background: var(--surface);
  border: 1px solid var(--border);
}
.page-header .actions .doc-link-btn button:hover {
  background: var(--bg);
}

.schedule-page-header .actions button {
  width: 92px;
}

.schedule-page-header .actions .doc-link-btn button {
  width: 116px;
}

.advanced-actions {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.advanced-actions[hidden] {
  display: none;
}

.advanced-actions summary {
  min-height: 52px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}

.advanced-actions summary:hover {
  color: var(--text);
  background: var(--bg);
}

.advanced-actions-body {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px 22px;
  border-top: 1px solid var(--border);
}

.advanced-actions-body button {
  min-height: 44px;
  padding: 0 18px;
  font-size: 15px;
  white-space: nowrap;
}

.advanced-empty-text {
  color: var(--text-muted);
  font-size: 14px;
}

/* ============ Cards ============ */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 28px;
  border-bottom: 1px solid var(--border);
}

.card-head h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.005em;
  color: var(--text);
}

.card-head .muted {
  color: var(--text-muted);
  font-size: 14px;
}

.card-body {
  padding: 28px;
}

/* ============ Stat row ============ */

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  display: grid;
  gap: 8px;
}

.stat-label {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-value {
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text);
  line-height: 1.1;
}

.stat-value.compact {
  font-size: 28px;
  line-height: 1.2;
}

.stat.accent .stat-value { color: var(--text); }
.stat.green .stat-value { color: var(--green); }
.stat.amber .stat-value { color: var(--amber); }
.stat.red .stat-value { color: var(--red); }

.stat {
  transition: transform 0.18s ease, box-shadow 0.2s ease;
}
.stat:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.process-card {
  display: grid;
}

.process-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--border);
}

.process-overview > div {
  padding: 18px 28px;
  display: grid;
  gap: 4px;
  border-right: 1px solid var(--border);
}

.process-overview > div:last-child {
  border-right: 0;
}

.process-overview span {
  color: var(--text-muted);
  font-size: 13px;
}

.process-overview strong {
  font-size: 26px;
  line-height: 1.2;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.process-list {
  display: grid;
}

.process-row {
  min-height: 58px;
  padding: 14px 28px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 16px;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.process-row:last-child {
  border-bottom: 0;
}

.process-row strong {
  display: block;
  font-size: 15px;
}

.process-row .muted {
  color: var(--text-muted);
  font-size: 13px;
}

.process-counts {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.process-counts span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ============ Shop cards ============ */

/* ============ Segmented Tabs (settings / resources) ============ */

.seg-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.seg-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 18px;
  border: 0;
  background: transparent;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.2s ease;
}

.seg-tabs button:hover:not(:disabled):not(.active) {
  color: var(--text);
  background: var(--surface-soft);
}

.seg-tabs button.active {
  color: #ffffff;
  background: var(--text);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.16);
}

.seg-tabs button:disabled {
  color: var(--text-faint);
  cursor: not-allowed;
  opacity: 0.6;
}

.seg-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(15, 23, 42, 0.08);
  color: var(--text);
}

.seg-tabs button.active .seg-badge {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.task-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 18px;
}

.task-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: grid;
  gap: 14px;
}

.task-card.task-card-enabled {
  border-left-color: var(--green);
  transition: transform 0.18s ease, box-shadow 0.2s ease;
}

.task-card.task-card-enabled:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.task-card.task-card-disabled { border-left-color: var(--text-faint); opacity: 0.55; }

.task-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.task-card-title {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.task-card-title strong {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.005em;
}

.task-card-platform {
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.task-card-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.task-card-stats {
  margin: 0;
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  row-gap: 6px;
  column-gap: 12px;
  font-size: 14px;
}

.task-card-stats dt { color: var(--text-muted); }
.task-card-stats dd { margin: 0; }

.task-card footer {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.task-card-cta {
  font-weight: 600;
}

.shop-table tbody tr {
  border-left: 3px solid transparent;
}
.shop-table tbody tr.status-authorized { border-left-color: var(--green); }
.shop-table tbody tr.status-pending_login,
.shop-table tbody tr.status-waiting_login { border-left-color: var(--amber); }
.shop-table tbody tr.status-expired,
.shop-table tbody tr.status-revoked,
.shop-table tbody tr.status-closed { border-left-color: var(--red); }

.shop-table th,
.shop-table td {
  padding: 18px 20px;
  vertical-align: middle;
}

.shop-table td.mono,
.shop-table td .row-sub {
  word-break: break-all;
}

.shop-row-name strong {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.005em;
  overflow-wrap: anywhere;
}

.shop-row-sub {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.shop-table .actions {
  gap: 8px;
  flex-wrap: nowrap;
}

.shop-table .actions button {
  min-height: 38px;
  padding: 0 14px;
  font-size: 14px;
  white-space: nowrap;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 20px;
}

.shop-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: grid;
  gap: 18px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.shop-card:hover {
  border-color: var(--border-strong);
}

.shop-card::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 18px;
  bottom: 18px;
  width: 3px;
  border-radius: 3px;
  background: var(--text-faint);
}

.shop-card.status-authorized::before { background: var(--green); }
.shop-card.status-expired::before,
.shop-card.status-revoked::before,
.shop-card.status-closed::before { background: var(--red); }
.shop-card.status-pending_login::before,
.shop-card.status-waiting_login::before { background: var(--amber); }

.shop-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.shop-card header {
  align-items: flex-start;
}

.shop-card .shop-title {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.shop-card header strong {
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.shop-card .shop-sub {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.shop-card dl {
  margin: 0;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  row-gap: 10px;
  column-gap: 14px;
  font-size: 15px;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
}

.shop-card dt {
  color: var(--text-muted);
  font-weight: 500;
}

.shop-card dd {
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

.shop-card .ellipsis {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shop-shot {
  width: 100%;
  max-height: 168px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.shop-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.shop-actions button {
  flex: 1 1 auto;
  min-height: 44px;
  padding: 0 18px;
  font-size: 15px;
}

.kv-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 14px;
}

.kv-row:last-of-type { border-bottom: 0; }
.kv-row .muted { color: var(--text-muted); }

/* ============ Chips ============ */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: var(--surface-soft);
  color: var(--text-muted);
  border: 1px solid var(--border);
  white-space: nowrap;
  flex-shrink: 0;
}

.chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.8;
}

.chip.authorized,
.chip.completed,
.chip.running { background: var(--green-soft); color: var(--green); border-color: rgba(22, 163, 74, 0.18); }
.chip.pending,
.chip.pending_login,
.chip.waiting_login { background: var(--amber-soft); color: var(--amber); border-color: rgba(180, 83, 9, 0.18); }
.chip.failed,
.chip.expired,
.chip.revoked,
.chip.closed,
.chip.blocked,
.chip.cancelled { background: var(--red-soft); color: var(--red); border-color: rgba(220, 38, 38, 0.18); }

/* ============ Forms ============ */

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

.form-grid label {
  display: grid;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

.form-grid label > input,
.form-grid label > select,
.form-grid label > textarea {
  color: var(--text);
}

.form-grid .span-2 {
  grid-column: 1 / -1;
}

.jst-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.8fr);
  gap: 20px;
  align-items: start;
}

.detail-list {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px 16px;
  margin: 0;
}

.detail-list dt {
  color: var(--text-muted);
  font-size: 13px;
}

.detail-list dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.timeline {
  display: grid;
  gap: 14px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--blue);
}

.timeline-item.level-error .timeline-dot { background: var(--red); }
.timeline-item.level-warn .timeline-dot,
.timeline-item.level-warning .timeline-dot { background: var(--amber); }
.timeline-item.level-info .timeline-dot { background: var(--green); }

.timeline-item strong {
  display: block;
  font-weight: 600;
}

.timeline-item span {
  color: var(--text-muted);
  font-size: 13px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.form-help {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.field-label {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

.date-picker-panel {
  display: grid;
  gap: 10px;
  align-content: start;
}

.date-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.date-shortcuts button {
  min-height: 38px;
  padding: 0 14px;
}

.date-add-row {
  display: grid;
  gap: 8px;
}

.date-picker-panel.span-2 {
  grid-template-columns: minmax(220px, 1fr) auto;
  align-items: end;
}

.selected-date-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.selected-date-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}

.selected-date-head button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.selected-date-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
  align-items: center;
}

.date-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px 0 12px;
  border-radius: 999px;
  border-color: rgba(37, 99, 235, 0.22);
  background: var(--blue-soft);
  color: var(--blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.date-chip strong {
  font-family: inherit;
  font-size: 16px;
  line-height: 1;
}

/* Switch */

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.switch input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: var(--border-strong);
  position: relative;
  transition: background 0.15s ease;
}

.switch-track::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.18);
  transition: transform 0.18s ease;
}

.switch input:checked + .switch-track {
  background: var(--accent);
}

.switch input:checked + .switch-track::before {
  transform: translateX(16px);
  background: #ffffff;
}

/* ============ Tables ============ */

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: var(--surface-soft);
}

.row-title {
  font-weight: 600;
}

.row-sub {
  color: var(--text-muted);
  margin-top: 4px;
  font-size: 12px;
  overflow-wrap: anywhere;
}

/* 任务长错误信息: 折叠展开 */
.row-sub-collapse {
  margin-top: 4px;
}
.row-sub-collapse > summary {
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 56px; /* 给「展开」标签让位 */
}
.row-sub-collapse > summary::-webkit-details-marker { display: none; }
.row-sub-collapse > summary::after {
  content: "展开";
  position: absolute;
  right: 0;
  top: 0;
  font-size: 11px;
  color: var(--brand);
  cursor: pointer;
}
.row-sub-collapse[open] > summary::after { content: "收起"; }
.row-sub-collapse[open] > summary { padding-right: 56px; }
.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-all;
}
.row-sub-collapse[open] .clamp-2 {
  -webkit-line-clamp: unset;
  display: block;
  overflow: visible;
}
.row-sub-full {
  margin: 6px 0 0;
  padding: 8px 10px;
  background: var(--surface-alt, #f7f7f8);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 360px;
  overflow: auto;
}
.row-sub-collapse:not([open]) .row-sub-full { display: none; }

.actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.actions button {
  min-height: 28px;
  padding: 0 10px;
  font-size: 12px;
}

/* ============ Events ============ */

.event-list {
  display: grid;
}

.event-row {
  display: grid;
  grid-template-columns: 200px 90px minmax(0, 1fr) 150px;
  gap: 20px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  align-items: baseline;
}

.event-row:last-child { border-bottom: 0; }

.event-row time {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
}

.event-row .level {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--surface-soft);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.event-row .level.info { background: var(--blue-soft); color: var(--blue); }
.event-row .level.warn { background: var(--amber-soft); color: var(--amber); }
.event-row .level.error { background: var(--red-soft); color: var(--red); }

.event-row .source {
  color: var(--text-faint);
  font-size: 12px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ============ Settings ============ */

.settings-grid {
  display: grid;
  gap: 20px;
}

.settings-section {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 40px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.settings-section header h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 650;
}

.settings-section header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.6;
}

.settings-row {
  display: grid;
  gap: 14px;
}

.settings-subtitle {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 750;
}

.settings-row .field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.settings-field {
  display: grid;
  gap: 8px;
}

.settings-field > span {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.settings-field small,
.schedule-switch small {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.tmall-schedule-section {
  border-left-color: #111827;
}

.tmall-schedule-card {
  gap: 18px;
}

.schedule-switch {
  width: 100%;
  min-height: 58px;
  padding: 0 18px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.schedule-switch > span:last-child {
  display: grid;
  gap: 3px;
}

.schedule-fields {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
}

.tmall-schedule-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
}

.tmall-schedule-pair textarea {
  min-height: 170px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.65;
}

.kv {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 16px;
  font-size: 14px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--border);
}

.kv:last-child { border-bottom: 0; }

.kv dt {
  color: var(--text-muted);
}

.kv dd {
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

/* ============ Modal ============ */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(2px);
  display: grid;
  place-items: center;
  z-index: 50;
}

.modal.hidden { display: none; }

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: min(480px, 92vw);
  display: grid;
  gap: 20px;
  box-shadow: var(--shadow-lg);
}

.modal-card h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.modal-card form {
  display: grid;
  gap: 14px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.small {
  font-size: 12px;
}

/* ============ Modal mask (hidden 属性切换可见) ============ */

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(2px);
  display: grid;
  place-items: center;
  z-index: 60;
}

.modal-mask[hidden] { display: none; }

.modal-mask .modal-card {
  width: min(640px, 94vw);
  max-height: 84vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 0;
  padding: 0;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
}

.modal-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 650;
}

.modal-body {
  padding: 16px 22px;
  overflow-y: auto;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 22px 18px;
  border-top: 1px solid var(--border);
}

.upload-now-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0 8px;
  font-size: 13px;
}

.upload-now-tools label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.upload-now-list {
  display: grid;
  gap: 6px;
}

.upload-now-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  background: var(--surface-soft);
  font-size: 13px;
}

.upload-now-item:hover {
  border-color: var(--border-strong, #c0c5cf);
}

.upload-now-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-now-meta {
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 320px;
}

/* ============ Drawer (LiveView) ============ */

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  display: grid;
  grid-template-rows: 72px minmax(0, 1fr);
  z-index: 1000;
}

.drawer.hidden { display: none; }

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.drawer-head strong {
  font-size: 14px;
  font-weight: 650;
}

.drawer-actions {
  display: flex;
  gap: 6px;
}

.drawer-body {
  position: relative;
  min-height: 0;
  background: #0f172a;
  overflow: hidden;
}

.drawer-state {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: 28px;
  color: #e5e7eb;
  background: #0f172a;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
}

.drawer-state[hidden] {
  display: none;
}

.drawer-state[data-tone="error"] {
  color: #fecaca;
  background: #111827;
}

.drawer iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #0f172a;
}

/* ============ LiveView (existing) ============ */

.live-body {
  margin: 0;
  background: #0f172a;
  color: #e5e7eb;
  overflow: hidden;
}

.live-shell {
  display: grid;
  grid-template-rows: 38px minmax(0, 1fr);
  width: 100vw;
  height: 100vh;
  outline: 0;
}

.live-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  color: #e5e7eb;
  background: #111827;
  border-bottom: 1px solid #1f2937;
  font-size: 12.5px;
}

.live-toolbar span { color: #93c5fd; }
.live-toolbar span.bad { color: #fca5a5; }

.live-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  cursor: default;
  background: #0f172a;
}

.live-stage img {
  display: none;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  user-select: none;
}

.live-empty {
  display: grid;
  place-items: center;
  color: #cbd5e1;
}

.live-input {
  position: fixed;
  left: -1000px;
  top: -1000px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

/* ============ Task technical docs ============ */

.task-doc {
  display: grid;
  gap: 24px;
}

/* ---------- broll health card ---------- */
.broll-health {
  display: grid;
  gap: 12px;
}

.bh-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.bh-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text-muted);
  display: inline-block;
}

.bh-dot-ok { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18); }
.bh-dot-stale { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18); }
.bh-dot-down { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18); }
.bh-dot-loading { background: #94a3b8; }

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

.bh-grid > div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.bh-grid span {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 4px;
}

.bh-grid strong {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.bh-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11.5px !important;
}

.bh-foot {
  font-size: 11.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  overflow-wrap: anywhere;
}

@media (max-width: 760px) {
  .bh-grid { grid-template-columns: 1fr 1fr; }
}

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

.doc-summary-grid > div {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.doc-summary-grid span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
}

.doc-summary-grid strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.doc-block {
  display: grid;
  gap: 12px;
}

.doc-block h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0;
}

.table-wrap.compact {
  border-top: 1px solid var(--border);
}

.doc-table th,
.doc-table td {
  padding: 12px 14px;
  font-size: 13px;
  vertical-align: top;
}

.doc-table td:first-child {
  white-space: nowrap;
}

.task-doc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: #111827;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 5px;
  padding: 1px 5px;
  overflow-wrap: anywhere;
}

.doc-flow {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.doc-flow li {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.doc-flow strong {
  font-size: 13px;
  font-weight: 650;
}

.doc-flow span {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.65;
}

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

.endpoint-grid code {
  display: block;
  min-height: 34px;
  padding: 8px 10px;
}

.doc-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

/* ============ Misc ============ */

.empty {
  text-align: center;
  color: var(--text-muted);
  padding: 56px 24px;
  font-size: 14px;
}

.job-note {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* 错误信息独立一小行，跨列展示，弱化背景和颜色 */
.job-err-row > td {
  background: transparent;
  border-top: 0;
  padding: 0 16px 6px;
}
.job-err-line {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
  word-break: break-all;
  white-space: normal;
}

/* 批次进度条 */
.batch-progress {
  display: flex;
  height: 6px;
  background: var(--border, #e5e7eb);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}
.batch-progress .bp-pub { background: #16a34a; }
.batch-progress .bp-fail { background: #dc2626; }
.batch-progress-text { font-size: 12px; display: flex; gap: 8px; }
.batch-progress-text .ok { color: #16a34a; font-weight: 600; }
.batch-progress-text .err { color: #dc2626; font-weight: 600; }

.batch-row.clickable { cursor: pointer; }
.batch-row.clickable:hover { background: var(--bg, #f9fafb); }
.batch-toggle {
  display: inline-block;
  width: 16px;
  text-align: center;
  color: var(--text-muted);
  user-select: none;
  font-size: 10px;
  cursor: pointer;
}
.batch-detail > td {
  background: var(--bg, #fafafa);
  border-top: 1px solid var(--border, #e5e7eb);
  font-size: 13px;
}
.batch-detail .job-err-line {
  margin-top: 4px;
}

/* ============ 批次状态徽标 ============ */
.batch-stat-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
  line-height: 1.4;
}
.batch-stat-chip.stat-pending { color: #6b7280; background: #f3f4f6; border-color: #e5e7eb; }
.batch-stat-chip.stat-running { color: #1d4ed8; background: #dbeafe; border-color: #bfdbfe; }
.batch-stat-chip.stat-done    { color: #15803d; background: #dcfce7; border-color: #bbf7d0; }
.batch-stat-chip.stat-partial { color: #b45309; background: #fef3c7; border-color: #fde68a; }
.batch-stat-chip.stat-failed  { color: #b91c1c; background: #fee2e2; border-color: #fecaca; }

/* ============ 顶部 stats: 大数字 + 标签 + 竖分隔 ============ */
.batch-stats {
  padding: 0 28px 8px;
}
.batch-stats:empty { display: none; }
.stats-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
  background: linear-gradient(180deg, #fafbff 0%, #fff 100%);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 12px;
  padding: 14px 18px;
}
.stats-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 22px;
  min-width: 88px;
}
.stats-block .stats-num {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
  color: #111827;
}
.stats-block .stats-lbl {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
  white-space: nowrap;
}
.stats-block.stats-primary .stats-num { color: #4f46e5; font-size: 28px; }
.stats-block.stats-primary .stats-lbl { color: #6366f1; font-weight: 600; }
.stats-block.stat-pending .stats-num { color: #6b7280; }
.stats-block.stat-running .stats-num { color: #1d4ed8; }
.stats-block.stat-done    .stats-num { color: #15803d; }
.stats-block.stat-partial .stats-num { color: #b45309; }
.stats-block.stat-failed  .stats-num { color: #b91c1c; }
.stats-block.stats-jobs .stats-jobs-extra { font-weight: 600; margin-left: 4px; }
.stats-block.stats-jobs .ok { color: #16a34a; }
.stats-block.stats-jobs .err { color: #dc2626; }
.stats-divider-v {
  width: 1px;
  align-self: center;
  height: 36px;
  background: var(--border, #e5e7eb);
  margin: 0 6px;
}

/* ============ 批次卡片列表 ============ */
.batch-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 28px 24px;
}
.empty-card {
  text-align: center;
  padding: 40px 0;
  color: var(--text-muted, #9ca3af);
  background: #fafafa;
  border-radius: 8px;
}
.batch-card {
  background: #fff;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.batch-card.open {
  border-color: #c7d2fe;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.08);
}
.batch-card-head {
  display: grid;
  grid-template-columns: 22px 80px minmax(180px, 1.2fr) minmax(160px, 1fr) minmax(220px, 1.4fr) minmax(140px, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}
.batch-card-head.clickable { cursor: pointer; }
.batch-card-head.clickable:hover { background: #fafbff; }
.batch-card-toggle {
  color: #9ca3af;
  font-size: 11px;
  user-select: none;
  text-align: center;
}
.batch-card-platform {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #4b5563;
  font-weight: 500;
}
.platform-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.platform-dot-pdd   { background: #ef4444; }   /* PDD 红 */
.platform-dot-tmall { background: #ec4899; }   /* 天猫粉 */
.platform-dot-weixin { background: #22c55e; }  /* 视频号绿 */
.batch-card-shop {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.batch-card-shop strong {
  font-size: 14px;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.batch-card-product {
  font-size: 12px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.batch-card-status {
  display: flex;
  align-items: center;
  gap: 8px;
}
.batch-card-date {
  font-size: 12px;
  font-family: var(--mono, ui-monospace, "SFMono-Regular", Consolas, monospace);
}
.batch-card-progress {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.batch-card-progress-bar {
  position: relative;
  display: flex;
  height: 6px;
  border-radius: 3px;
  background: #f3f4f6;
  overflow: hidden;
}
.batch-card-progress-bar .bp-pub { background: #16a34a; transition: width 0.3s; }
.batch-card-progress-bar .bp-fail { background: #dc2626; transition: width 0.3s; }
.batch-card-progress-text {
  display: inline-flex;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  align-items: center;
}
.batch-card-progress-text .ok { color: #16a34a; }
.batch-card-progress-text .err { color: #dc2626; }
.batch-card-progress-text .muted { color: #9ca3af; font-weight: 500; }
.batch-card-total { color: #9ca3af; font-weight: 500; }
.batch-card-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: #6b7280;
  min-width: 0;
}
.batch-card-meta > span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.batch-card-confirmed { font-size: 11px; color: #9ca3af; }
.batch-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-retry-batch {
  padding: 6px 14px;
  background: #fff;
  color: #b45309;
  border: 1px solid #fde68a;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn-retry-batch:hover {
  background: #fffbeb;
  border-color: #fbbf24;
}

/* 卡片展开后的明细列表 */
.batch-card-body {
  background: #fafbfc;
  border-top: 1px solid #e5e7eb;
  padding: 8px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.batch-detail-row {
  display: grid;
  grid-template-columns: 80px 1fr 100px 130px 80px;
  align-items: center;
  gap: 12px;
  padding: 8px 8px;
  font-size: 13px;
  border-radius: 6px;
}
.batch-detail-row:hover { background: #fff; }
.batch-detail-fname {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--mono, ui-monospace, "SFMono-Regular", Consolas, monospace);
  font-size: 12px;
  color: #374151;
}
.batch-detail-slot, .batch-detail-time {
  font-size: 12px;
}
.batch-detail-action {
  text-align: right;
}
.btn-retry-job {
  padding: 4px 12px;
  background: #fff;
  color: #4f46e5;
  border: 1px solid #c7d2fe;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}
.btn-retry-job:hover { background: #eef2ff; }
.batch-detail-row .job-err-line {
  grid-column: 1 / -1;
  font-size: 11px;
  color: #b91c1c;
  background: #fef2f2;
  padding: 6px 10px;
  border-radius: 4px;
  margin-top: 4px;
}
.empty-card-detail {
  text-align: center;
  padding: 12px;
  color: #9ca3af;
  font-size: 12px;
}

@media (max-width: 1280px) {
  .batch-card-head {
    grid-template-columns: 22px 70px minmax(140px, 1fr) minmax(140px, 1fr) minmax(180px, 1.2fr) auto;
  }
  .batch-card-meta { display: none; }
  .stats-block { padding: 4px 14px; min-width: 76px; }
}

/* ============ 设置页: 天猫今日话题列表 ============ */
.topics-today-list {
  margin-top: 12px;
  border-top: 1px dashed var(--border, #e5e7eb);
  padding-top: 12px;
}
.topics-empty {
  padding: 12px;
  color: var(--text-muted, #9ca3af);
  font-size: 13px;
  text-align: center;
}
.topics-empty.err { color: #b91c1c; }
.topics-head { font-size: 13px; color: #4b5563; margin-bottom: 8px; }
.topics-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 320px;
  overflow-y: auto;
}
.topic-row {
  display: grid;
  grid-template-columns: 36px minmax(160px, 1fr) 90px 80px 80px 70px;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  border: 1px solid transparent;
}
.topic-row.eligible { background: #f0fdf4; border-color: #bbf7d0; }
.topic-row.skip { background: #fafafa; color: #9ca3af; }
.topic-metric {
  font-size: 12px;
  color: #4b5563;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.topic-tag-hot {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 600;
  background: #fef3c7;
  color: #b45309;
  border-radius: 4px;
}
.topic-rank {
  font-family: var(--mono, ui-monospace, "SFMono-Regular", Consolas, monospace);
  font-size: 11px;
  color: #9ca3af;
}
.topic-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topic-tags { display: inline-flex; gap: 4px; }
.topic-tags > span {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.tag-act  { background: #dbeafe; color: #1d4ed8; }
.tag-skin { background: #fee2e2; color: #b91c1c; }
.tag-cat  { background: #f3f4f6; color: #4b5563; }
.topic-used { font-size: 11px; }

/* settings: pane-tmall 视觉区分 (浅蓝/猫色) */
.settings-section.pane-tmall {
  border-left: 3px solid #ec4899;
}
.settings-section.pane-pdd {
  border-left: 3px solid #f97316;
}
.settings-section.pane-jushuitan {
  border-left: 3px solid #0f766e;
}
.settings-section.pane-weixin-promotion {
  border-left: 3px solid #f97316;
}
.settings-section.pane-global {
  border-left: 3px solid #6b7280;
}
.settings-section header h3 .badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  background: #fce7f3;
  color: #9d174d;
  border-radius: 10px;
  vertical-align: middle;
}

button.small {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 6px;
}

.toast {
  position: fixed;
  top: 84px;
  left: 50%;
  transform: translateX(-50%);
  padding: 14px 22px;
  background: #1f2937;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.32);
  font-size: 15px;
  font-weight: 600;
  color: #f8fafc;
  z-index: 9999;
  max-width: min(720px, calc(100vw - 32px));
  animation: toast-in 0.18s ease;
  letter-spacing: 0.2px;
}

.toast.error {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.toast.success {
  background: linear-gradient(135deg, #16a34a, #15803d);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- PDD publish workspace ---------- */

.pdd-workspace {
  display: grid;
  gap: 18px;
}

.pdd-workspace[hidden] {
  display: none !important;
}

.pdd-filter-panel,
.pdd-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.pdd-filter-head,
.pdd-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.pdd-filter-head h2,
.pdd-panel-head h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.pdd-filter-head p {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

.pdd-filter-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.pdd-filter-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
  padding: 18px 24px 24px;
  align-items: end;
}

.pdd-filter-grid > label,
.pdd-filter-field {
  display: grid;
  gap: 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
}

.pdd-filter-grid > label {
  grid-column: span 2;
}

.pdd-status-field,
.pdd-search-field {
  grid-column: span 3;
}

.pdd-filter-grid input,
.pdd-filter-grid select {
  min-height: 42px;
  padding: 8px 12px;
  font-size: 14px;
}

.pdd-filter-rows {
  display: grid;
  gap: 12px;
  padding: 18px 24px 24px;
}

.pdd-filter-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
}

.pdd-filter-row[hidden] {
  display: none !important;
}

.pdd-filter-label {
  padding-top: 7px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.pdd-option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pdd-option-row button {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.pdd-option-row button:hover {
  background: var(--surface-hover);
}

.pdd-option-row button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.pdd-filter-row-controls {
  grid-template-columns: 86px minmax(200px, 280px) minmax(280px, 1fr);
}

.pdd-filter-row-controls::before {
  content: "";
}

.pdd-filter-row-controls label {
  display: grid;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 750;
}

.pdd-filter-row-controls .pdd-search-field {
  grid-column: auto;
}

.pdd-filter-row-controls input {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 14px;
}

.pdd-status-checks {
  min-height: 42px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.pdd-status-checks label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.pdd-status-checks input {
  min-height: 0;
  width: 14px;
  height: 14px;
  padding: 0;
}

.pdd-quick-tabs {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  background: #f6f7f9;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.pdd-quick-tabs button {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.pdd-quick-tabs button:hover {
  background: #fff;
}

.pdd-quick-tabs button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.pdd-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.pdd-summary-card {
  min-height: 84px;
  padding: 16px 18px;
  display: grid;
  align-content: center;
  gap: 4px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.pdd-summary-card span {
  color: var(--text-muted);
  font-size: 13px;
}

.pdd-summary-card strong {
  font-size: 28px;
  line-height: 1.1;
}

.pdd-summary-card.active {
  border-color: var(--text);
  background: #fafafa;
}

.pdd-board {
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.pdd-batch-list,
.pdd-job-list {
  display: grid;
  gap: 10px;
  padding: 14px;
  max-height: 760px;
  overflow: auto;
}

.pdd-batch-item {
  min-height: 116px;
  width: 100%;
  padding: 14px 16px;
  display: grid;
  gap: 5px;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.pdd-batch-item:hover {
  background: #fafafa;
}

.pdd-batch-item.active {
  border-color: var(--text);
  box-shadow: inset 3px 0 0 var(--text);
}

.pdd-batch-date,
.pdd-batch-counts {
  color: var(--text-muted);
  font-size: 12px;
}

.pdd-batch-item strong {
  font-size: 15px;
  line-height: 1.35;
}

.pdd-batch-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pdd-batch-counts .ok { color: var(--green); }
.pdd-batch-counts .err { color: var(--red); }

.pdd-job-section {
  display: grid;
  gap: 10px;
}

.pdd-job-section-head {
  position: sticky;
  top: -14px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 2px;
  background: var(--surface);
}

.pdd-job-section-head h3 {
  margin: 0;
  min-width: 0;
  font-size: 15px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdd-job-section-head span {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

.pdd-job-section-list {
  display: grid;
  gap: 10px;
}

.pdd-job-card {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) minmax(360px, 0.75fr) auto;
  gap: 16px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.pdd-job-status,
.pdd-job-main,
.pdd-job-actions {
  display: grid;
  gap: 8px;
}

.pdd-job-status .muted {
  font-size: 12px;
}

.pdd-job-main strong {
  font-size: 16px;
  line-height: 1.35;
}

.pdd-job-main .mono,
.pdd-job-path {
  color: var(--text-muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.pdd-job-error {
  padding: 7px 10px;
  border-radius: 7px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
  line-height: 1.45;
}

.pdd-job-meta {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}

.pdd-job-meta div {
  min-width: 0;
}

.pdd-job-meta dt {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 650;
}

.pdd-job-meta dd {
  margin: 3px 0 0;
  min-height: 22px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.pdd-content-id {
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
}

.pdd-content-id:hover {
  background: transparent;
  color: var(--accent-hover);
}

.pdd-job-actions {
  justify-items: end;
}

.pdd-job-actions button {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}

.pdd-table-wrap {
  overflow: auto;
  max-height: 760px;
}

.pdd-bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: #fff;
}

.pdd-bulk-left,
.pdd-bulk-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pdd-selected-count {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 750;
}

.pdd-table {
  width: 100%;
  min-width: 1240px;
  border-collapse: collapse;
  font-size: 13px;
}

.pdd-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 12px 14px;
  background: var(--surface-soft);
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.pdd-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.pdd-table tbody tr:hover {
  background: #fafafa;
}

.pdd-table th:nth-child(1),
.pdd-table td:nth-child(1),
.pdd-table th:nth-child(2),
.pdd-table td:nth-child(2) {
  width: 42px;
  padding-right: 4px;
  text-align: center;
}

.pdd-table th:nth-child(3) { width: 180px; }
.pdd-table th:nth-child(4) { width: 92px; }
.pdd-table th:nth-child(5) { width: 130px; }
.pdd-table th:nth-child(7) { width: 150px; }
.pdd-table th:nth-child(8) { width: 150px; }
.pdd-table th:nth-child(9) { width: 132px; }
.pdd-table th:nth-child(10) { width: 170px; text-align: center; }
.pdd-table td:nth-child(10) { text-align: center; }

.pdd-data-row.expanded {
  background: var(--surface-soft);
}

.pdd-data-row.selected {
  background: #f8fafc;
}

.pdd-data-row {
  cursor: pointer;
}

.pdd-select-col input,
.pdd-row-check {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.pdd-expand-col {
  text-align: center;
}

.pdd-expand-btn {
  width: 26px;
  height: 26px;
  min-height: 26px;
  padding: 0;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
}

.pdd-expand-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.pdd-video-cell,
.pdd-status-cell,
.pdd-row-actions {
  display: grid;
  gap: 6px;
}

.pdd-video-cell strong {
  font-size: 14px;
  line-height: 1.35;
}

.pdd-status-cell {
  align-content: start;
  gap: 4px;
}

.pdd-status-cell .chip {
  width: fit-content;
}

.pdd-video-cell .mono {
  max-width: 360px;
  color: var(--text-muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.pdd-status-cell .muted {
  font-size: 12px;
}

.pdd-runtime {
  width: fit-content;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 750;
}

.pdd-row-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pdd-row-actions button {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: 7px;
  white-space: nowrap;
}

.pdd-detail-row td {
  padding: 0 14px 14px 56px;
  background: var(--surface-soft);
  text-align: left !important;
}

.pdd-detail-card {
  display: grid;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.pdd-detail-card dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  justify-content: start;
  gap: 12px 20px;
}

.pdd-detail-card dl > div {
  min-width: 0;
}

.pdd-detail-card dl .wide {
  grid-column: 1 / -1;
}

.pdd-detail-card dt {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 750;
}

.pdd-detail-card dd {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
  text-align: left;
}

.pdd-detail-card dd.mono,
.pdd-detail-card .wide dd {
  line-height: 1.55;
  white-space: normal;
  word-break: break-word;
}

.pdd-detail-card .wide dd {
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.pdd-detail-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.pdd-empty-cell {
  padding: 34px !important;
  color: var(--text-muted);
  text-align: center;
}

.pdd-empty {
  padding: 28px;
  color: var(--text-muted);
  text-align: center;
}

@media (max-width: 900px) {
  .app-nav {
    padding: 0 16px;
    gap: 16px;
  }
  .app-nav-links { gap: 2px; }
  .app-nav-links a { padding: 0 8px; font-size: 12px; }
  .page {
    padding: 20px 16px 60px;
  }
  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .jst-layout {
    grid-template-columns: 1fr;
  }
  .date-picker-panel.span-2 {
    grid-template-columns: 1fr;
  }
  .settings-section {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 18px;
  }
  .doc-summary-grid,
  .endpoint-grid {
    grid-template-columns: 1fr;
  }
  .doc-flow li {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .event-row {
    grid-template-columns: 1fr;
  }
  .pdd-filter-grid,
  .pdd-summary-grid,
  .pdd-board,
  .pdd-job-card {
    grid-template-columns: 1fr;
  }
  .pdd-filter-row,
  .pdd-filter-row-controls,
  .pdd-detail-card,
  .pdd-detail-card dl {
    grid-template-columns: 1fr;
  }
  .pdd-filter-row-controls::before {
    display: none;
  }
  .pdd-detail-row td {
    padding-left: 14px;
  }
  .pdd-job-actions {
    justify-items: start;
    display: flex;
  }
  .pdd-filter-grid > label,
  .pdd-status-field,
  .pdd-search-field {
    grid-column: 1 / -1;
  }
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.data-table th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  background: var(--surface-muted);
}

.empty-cell {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.checkbox-line {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-line input {
  width: auto;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: var(--surface);
  font-weight: 700;
  text-decoration: none;
}

.link-button:hover {
  border-color: var(--text);
}

.compact-list {
  display: grid;
  gap: 10px;
}

.compact-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}

/* ============ Weixin Channels Promotion ============ */

.wxp-page {
  max-width: 1440px;
  gap: 28px;
}

.wxp-page .page-header {
  padding-bottom: 2px;
}

.wxp-page .page-header h1 {
  font-size: 42px;
}

.wxp-page .card {
  box-shadow: var(--shadow-sm);
}

.wxp-batch-card .card-head,
.wxp-results-card .card-head {
  align-items: center;
}

.wxp-batch-card {
  border-color: var(--border);
}

.wxp-live-preview {
  margin-top: 14px;
}

.wxp-live-preview-empty,
.wxp-live-preview-head {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-muted);
  padding: 12px 14px;
  color: var(--text-muted);
  font-size: 13px;
}

.wxp-live-preview-empty.is-error {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.28);
  background: rgba(239, 68, 68, 0.06);
}

.wxp-live-preview-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.wxp-live-preview-head strong {
  color: var(--text);
}

.wxp-live-preview-head em,
.wxp-live-preview-row em {
  color: var(--text-faint);
  font-style: normal;
}

.wxp-live-preview-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.wxp-live-preview-row {
  display: grid;
  grid-template-columns: minmax(100px, 160px) minmax(180px, 1fr) minmax(92px, auto) minmax(80px, auto) minmax(120px, auto);
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  font-size: 13px;
}

.wxp-live-preview-row span {
  color: var(--text);
  font-weight: 700;
}

.wxp-live-preview-row strong {
  overflow: hidden;
  color: var(--text-muted);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wxp-live-preview-row b {
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.wxp-batch-card .card-head {
  padding: 24px 28px;
  background: linear-gradient(180deg, #fff 0%, #fbfbfc 100%);
}

.wxp-batch-card .card-head h2,
.wxp-results-card .card-head h2,
.wxp-plan-card .card-head h2,
.wxp-orders-card .card-head h2,
.wxp-task-card .card-head h2,
.wxp-payment-card .card-head h2 {
  font-size: 20px;
}

.wxp-batch-status {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  max-width: 420px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wxp-batch-status.is-running {
  color: var(--blue);
  border-color: rgba(37, 99, 235, 0.2);
  background: var(--blue-soft);
}

.wxp-batch-status.is-completed {
  color: var(--green);
  border-color: rgba(22, 163, 74, 0.18);
  background: var(--green-soft);
}

.wxp-batch-status.is-failed {
  color: var(--red);
  border-color: rgba(220, 38, 38, 0.18);
  background: var(--red-soft);
}

.wxp-batch-form {
  display: grid;
  gap: 18px;
}

.wxp-form-main {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(180px, 0.7fr) minmax(380px, 1.5fr) minmax(120px, 0.35fr);
  gap: 16px;
  align-items: start;
}

.wxp-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 2px;
}

.wxp-form-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.wxp-field {
  display: grid;
  gap: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.wxp-inline-refresh {
  border-radius: 8px;
  font-size: 12px;
  min-height: 28px;
  padding: 0 10px;
  white-space: nowrap;
}

.wxp-field-subrow {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 30px;
}

.wxp-field-help {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

.wxp-field input,
.wxp-field select {
  min-width: 0;
  min-height: 46px;
  border-radius: 10px;
  background: #fff;
}

.wxp-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}

.wxp-check input {
  width: 18px;
  height: 18px;
}

.wxp-single-card {
  padding: 0;
}

.wxp-single-card summary {
  cursor: pointer;
  padding: 18px 28px;
  color: var(--text-muted);
  font-weight: 800;
  list-style: none;
  background: var(--surface);
}

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

.wxp-payment-list {
  display: grid;
  gap: 12px;
}

.wxp-batch-manager {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.wxp-batch-sidebar {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.wxp-batch-sidebar-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 13px;
}

.wxp-batch-list {
  display: grid;
  gap: 10px;
}

.wxp-batch-detail-pane {
  min-width: 0;
}

.wxp-batch-date-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  background: var(--surface);
  font-size: 12px;
  font-weight: 800;
}

.wxp-batch-date-filter input {
  width: 138px;
  min-height: 30px;
  border: 0;
  padding: 0;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
}

.wxp-progress-empty {
  padding: 28px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  text-align: center;
  background: var(--surface-muted);
}

.wxp-progress-empty.is-error {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.28);
  background: rgba(239, 68, 68, 0.06);
}

.wxp-progress-empty.is-running {
  color: var(--primary);
  border-color: rgba(59, 130, 246, 0.28);
  background: rgba(59, 130, 246, 0.06);
}

.wxp-progress-empty span {
  display: inline-block;
  margin-top: 6px;
  color: var(--text-muted);
  font-size: 13px;
}

.wxp-batch-context {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fafafa;
}

.wxp-batch-context span,
.wxp-payment-meta {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.wxp-batch-context strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wxp-payment-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.wxp-payment-item:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.wxp-payment-rank {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
}

.wxp-payment-main {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.wxp-payment-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.wxp-payment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  line-height: 1.5;
}

.wxp-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.wxp-list-footer {
  display: flex;
  justify-content: center;
  padding-top: 14px;
}

.wxp-list-footer:empty {
  display: none;
}

.wxp-list-footer .wxp-row-action {
  min-width: 128px;
}

.wxp-official-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wxp-official-metrics span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  background: var(--surface-muted);
  font-size: 12px;
  font-weight: 700;
}

.wxp-official-metrics b {
  color: var(--text-muted);
  font-weight: 800;
}

.wxp-wechat-push {
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  padding: 9px 11px;
}

.wxp-wechat-push.is-success {
  background: rgba(22, 163, 74, 0.08);
  border-color: rgba(22, 163, 74, 0.22);
  color: var(--green);
}

.wxp-wechat-push.is-warning {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.25);
  color: #92400e;
}

.wxp-wechat-push.is-error {
  background: rgba(239, 68, 68, 0.07);
  border-color: rgba(239, 68, 68, 0.25);
  color: var(--danger);
}

.wxp-payment-url {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
}

.wxp-payment-url input {
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--text);
  background: var(--surface-muted);
}

.wxp-plan-compare {
  display: grid;
  grid-template-columns: minmax(180px, 0.75fr) minmax(0, 0.95fr) minmax(0, 1.3fr);
  gap: 10px;
  padding: 12px;
  border-radius: 10px;
  background: var(--surface-muted);
}

.wxp-plan-objective,
.wxp-plan-original,
.wxp-plan-adjusted {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.wxp-plan-objective {
  align-content: start;
  border-right: 1px solid var(--border);
  padding-right: 10px;
}

.wxp-plan-objective > span,
.wxp-plan-original > span,
.wxp-plan-adjusted > span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.wxp-plan-objective strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

.wxp-plan-objective em {
  color: var(--accent);
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.wxp-plan-original em,
.wxp-plan-same em {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 6px 6px 0;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-style: normal;
  font-size: 12px;
  background: var(--surface);
}

.wxp-plan-original em b,
.wxp-plan-same em b {
  color: var(--text);
  font-weight: 800;
}

.wxp-plan-change-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.wxp-plan-change {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 12px;
  white-space: nowrap;
}

.wxp-plan-change strong {
  font-weight: 800;
}

.wxp-plan-change span {
  color: var(--text-muted);
}

.wxp-plan-change b {
  color: var(--accent);
  font-weight: 800;
}

.wxp-row-action {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.wxp-row-action.is-danger {
  border-color: rgba(220, 38, 38, 0.28);
  color: #b91c1c;
  background: #fff1f2;
}

.wxp-row-action.is-danger:hover:not(:disabled) {
  border-color: rgba(220, 38, 38, 0.48);
  background: #ffe4e6;
}

.wxp-table-actions {
  margin-top: 8px;
}

.wxp-edit-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.wxp-edit-context {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wxp-edit-context span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.wxp-edit-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 10px;
}

.wxp-edit-grid label {
  display: grid;
  gap: 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.wxp-edit-grid input {
  min-width: 0;
  height: 38px;
  font-size: 14px;
}

.wxp-edit-grid input:disabled {
  background: var(--surface-muted);
  color: var(--text-muted);
  cursor: not-allowed;
}

.wxp-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.wxp-plan-table th,
.wxp-order-table th,
.wxp-payment-table th {
  height: 48px;
}

.wxp-plan-table td,
.wxp-order-table td,
.wxp-payment-table td {
  vertical-align: middle;
}

.wxp-plan-table th:nth-child(4),
.wxp-plan-table td:nth-child(4) {
  min-width: 260px;
}

.wxp-source-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  background: var(--surface-muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.wxp-source-pill.is-auto {
  color: #0f766e;
  border-color: rgba(15, 118, 110, 0.22);
  background: #ecfdf5;
}

.wxp-order-name {
  color: var(--text);
  font-size: 15px;
  font-weight: 750;
  line-height: 1.35;
}

.wxp-order-id {
  margin-top: 4px;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.wxp-order-account {
  display: inline-flex;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wxp-task-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.wxp-task-row:hover {
  border-color: var(--border-strong);
  background: #fafafa;
}

.wxp-task-row.is-active {
  border-color: #111827;
  box-shadow: var(--shadow-sm);
}

.wxp-task-row.is-active .wxp-task-kind {
  background: var(--text);
  color: var(--surface);
}

.wxp-task-kind {
  display: inline-grid;
  place-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.wxp-task-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.wxp-task-topline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.wxp-task-main strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wxp-task-topline span {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  color: var(--surface);
  background: var(--text);
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
}

.wxp-task-main span {
  overflow: hidden;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wxp-task-state,
.wxp-task-action {
  display: flex;
  gap: 8px;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
}

.wxp-task-state {
  align-items: flex-start;
  gap: 6px;
}

.wxp-task-stats {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.wxp-task-time {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

.settings-list {
  display: grid;
  gap: 10px;
}

.settings-list-row {
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(120px, 0.8fr) minmax(220px, 1.6fr) minmax(160px, 0.8fr);
  padding: 12px 14px;
}

.settings-list-row span {
  color: var(--text-muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-list-row.muted {
  background: var(--surface-muted);
}

.woa-binding-row {
  grid-template-columns: minmax(220px, 0.9fr) minmax(0, 1.4fr) auto;
}

.woa-binding-row label {
  margin: 0;
}

.woa-binding-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.woa-binding-meta strong,
.woa-binding-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.woa-binding-meta span {
  color: var(--text-muted);
}

.woa-binding-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.settings-qr-box {
  min-height: 0;
}

.settings-qr-card {
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: inline-grid;
  gap: 10px;
  justify-items: center;
  padding: 14px;
}

.settings-qr-card img {
  height: 180px;
  width: 180px;
}

@media (max-width: 1180px) {
  .wxp-form-main {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .wxp-live-field {
    grid-column: 1 / -1;
  }

  .wxp-batch-manager {
    grid-template-columns: 280px minmax(0, 1fr);
  }

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

  .wxp-task-time {
    display: none;
  }
}

@media (max-width: 860px) {
  .wxp-batch-manager {
    grid-template-columns: 1fr;
  }

  .wxp-form-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .wxp-form-footer button {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .wxp-form-main,
  .wxp-payment-url,
  .wxp-edit-grid {
    grid-template-columns: 1fr;
  }

  .wxp-plan-compare {
    grid-template-columns: 1fr;
  }

  .wxp-payment-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .wxp-task-row {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .wxp-task-kind,
  .wxp-task-state,
  .wxp-task-action {
    justify-self: start;
    justify-content: flex-start;
  }
}
