/* ══════════════════ 远程同步弹窗 ══════════════════ */
.sync-modal {
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
#lightbox.show { z-index: 100001; }
.sync-modal-card { width: min(880px, 100%); max-height: 90vh; padding: 20px; background: var(--bg-card, #fff); border-color: var(--border-strong, rgba(0,0,0,0.18)); }
.sync-modal-card .modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.sync-modal-card .modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary, #111);
  background: var(--bg-elevated, #f1f5f9);
  border: 1px solid var(--border, rgba(0, 0, 0, 0.12));
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s var(--ease, ease);
}
.sync-modal-card .modal-close:hover {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
  transform: scale(1.06);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}
.sync-body { max-height: 70vh; overflow-y: auto; padding: 4px 2px; }
.sync-section { margin-bottom: 18px; }
.sync-steps { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; padding: 0; list-style: none; }
.sync-steps li { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary, #94a3b8); background: rgba(255,255,255,0.05); border: 1px solid var(--border, rgba(0,0,0,0.12)); border-radius: 99px; padding: 5px 10px; }
.sync-steps li b { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--accent, #0ea5e9); color: #fff; font-size: 11px; }
.sync-hint-box { margin-top: 8px; padding: 8px 10px; font-size: 12px; line-height: 1.6; color: var(--text-secondary, #94a3b8); background: rgba(14,165,233,0.08); border: 1px solid rgba(14,165,233,0.25); border-radius: 8px; }
.sync-hint-box b { color: var(--text-primary, #e5e7eb); font-weight: 600; }
.sync-hint-inline { margin: 0 0 10px; }
.sync-section-title { font-weight: 700; margin-bottom: 8px; color: var(--text, #e5e7eb); }
.sync-deployments { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.sync-dep-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: rgba(255,255,255,0.04); border-radius: 8px; }
.sync-dep-name { font-weight: 600; }
.sync-dep-url { color: var(--text-secondary, #94a3b8); font-size: 12px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-sm { padding: 4px 8px; font-size: 12px; }
.sync-modal .btn-ghost {
  min-height: 32px;
  color: var(--text-primary, #1d1d1f);
  background: var(--bg-surface, rgba(255,255,255,0.72));
  border: 1px solid var(--border-strong, rgba(0,0,0,0.18));
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
}
.sync-modal .btn-ghost:hover {
  color: var(--text-primary, #1d1d1f);
  background: var(--bg-card-hover, rgba(255,255,255,0.92));
  border-color: var(--accent, #007aff);
}
.sync-modal .sync-delete-btn { color: var(--danger, #ff3b30); }
.sync-modal .sync-delete-btn:hover { border-color: var(--danger, #ff3b30); background: rgba(255,59,48,0.08); }
.sync-modal .btn-ghost:focus-visible,
.sync-modal .btn-secondary:focus-visible,
.sync-modal .btn-primary:focus-visible {
  outline: 2px solid var(--accent, #007aff);
  outline-offset: 2px;
}
.sync-modal button:disabled {
  color: var(--text-secondary, #6e6e73);
  opacity: 0.58;
  cursor: not-allowed;
}
.sync-deploy-form { display: flex; gap: 6px; flex-wrap: wrap; }
.sync-status { min-height: 18px; margin-top: 7px; color: var(--text-secondary, #94a3b8); font-size: 12px; }
.sync-status.success { color: #4ade80; }
.sync-status.error { color: #f87171; }
.sync-input { padding: 8px; border-radius: 8px; border: 1px solid var(--border, #334155); background: rgba(255,255,255,0.05); color: inherit; min-width: 140px; flex: 1; }
.sync-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.sync-toolbar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; padding: 8px 0; background: var(--bg-card, #fff); }
.sync-count { color: var(--text-primary, #1d1d1f); font-size: 13px; font-weight: 600; }
.sync-preview { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.sync-empty { color: var(--text-secondary, #94a3b8); padding: 20px; text-align: center; grid-column: 1 / -1; }
.sync-card { display: flex; gap: 8px; align-items: flex-start; padding: 8px; border-radius: 10px; background: rgba(255,255,255,0.04); border: 1px solid transparent; cursor: pointer; }
.sync-card-disabled { opacity: 0.55; cursor: not-allowed; }
.sync-check { margin-top: 4px; }
.sync-thumb-button { flex: 0 0 auto; padding: 0; border: 0; border-radius: 8px; background: transparent; cursor: zoom-in; overflow: hidden; }
.sync-thumb-button:focus-visible { outline: 2px solid var(--accent, #007aff); outline-offset: 2px; }
.sync-thumb-button:hover .sync-thumb { transform: scale(1.05); }
.sync-thumb-button.sync-thumb-error::after { content: "加载失败"; display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; color: var(--text-muted); font-size: 10px; background: var(--bg-inset); }
.sync-thumb-button.sync-thumb-error .sync-thumb { display: none; }
.sync-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; background: #0f172a; }
.sync-thumb { transition: transform 0.18s ease; }
.sync-thumb-empty { display: flex; align-items: center; justify-content: center; font-size: 11px; color: #64748b; }
.sync-card-meta { font-size: 12px; line-height: 1.35; overflow: hidden; }
.sync-card-sub { color: var(--text-secondary, #94a3b8); font-size: 11px; }
.sync-card-sub.err { color: #f87171; }
.sync-badge { display: inline-block; font-size: 10px; padding: 1px 6px; border-radius: 6px; margin-top: 2px; }
.sync-badge.dup { background: rgba(250,204,21,0.18); color: #facc15; }
.sync-badge.err { background: rgba(248,113,113,0.18); color: #f87171; }
.sync-badge.ok { background: rgba(34,197,94,0.18); color: #4ade80; }
.sync-progress { padding: 14px 4px 4px; }
.sync-progress-bar { height: 8px; background: rgba(255,255,255,0.08); border-radius: 99px; overflow: hidden; }
.sync-progress-fill { height: 100%; width: 0%; background: var(--accent, #0ea5e9); transition: width 0.3s; }
.sync-progress-text { font-size: 12px; color: var(--text-secondary, #94a3b8); margin-top: 6px; }

@media (max-width: 520px) {
  .sync-modal { padding: 10px; }
  .sync-modal-card { padding: 14px; }
  .sync-toolbar #syncImportBtn { width: 100%; justify-content: center; }
  .sync-dep-row { flex-wrap: wrap; }
  .sync-dep-url { flex-basis: 100%; order: 2; }
}

/* 自定义日期范围显隐由 .hidden 控制（app 已有 .hidden 规则） */
.hidden { display: none !important; }
