/* ============================================================
   防治邀请模块 · 与 theme-v3 设计令牌保持一致
   加载顺序：style.css → theme.css → theme-v3.css → invitations.css
   ============================================================ */
.inv-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--v3-s3, 12px);
  margin: 0 0 var(--v3-s4, 16px);
}
.inv-stat {
  background: var(--v3-surface, #fff);
  border: 1px solid var(--v3-border, #e5e9f0);
  border-radius: var(--v3-r-md, 12px);
  padding: 14px 18px;
  box-shadow: var(--v3-sh-1, 0 1px 2px rgba(15,23,42,.04));
}
.inv-stat .is-n { font-size: var(--v3-f-2xl, 26px); font-weight: 600; line-height: 1.2; color: var(--v3-primary, #4f46e5); }
.inv-stat .is-t { font-size: var(--v3-f-base, 14px); font-weight: 600; color: var(--v3-text, #1f2937); margin-top: 2px; }
.inv-stat .is-s { font-size: var(--v3-f-xs, 12px); color: var(--v3-text-3, #94a3b8); margin-top: 3px; }

.inv-filters { padding: 14px 16px !important; margin-bottom: var(--v3-s4, 16px) !important; }
.iv-grid { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.iv-grid .iv-f { width: auto; min-width: 148px; flex: 0 1 180px; margin: 0; }
.iv-grid .iv-f[placeholder] { flex: 1 1 220px; min-width: 200px; }
.iv-check { display: inline-flex; align-items: center; gap: 6px; font-size: var(--v3-f-sm, 13px); color: var(--v3-text-2, #475569); white-space: nowrap; }
.iv-check input[type=checkbox] { width: auto !important; }
.iv-f {
  box-sizing: border-box;
  width: 100%;
  padding: 8px 11px;
  font-family: inherit;
  font-size: var(--v3-f-base, 14px);
  color: var(--v3-text, #1f2937);
  background: var(--v3-input-bg, #fff);
  border: 1px solid var(--v3-border-2, #d8dfe9);
  border-radius: var(--v3-r-sm, 10px);
  outline: none;
}
.iv-f:focus { border-color: var(--v3-primary, #4f46e5); box-shadow: 0 0 0 3px var(--v3-primary-soft, #eef2ff); }
textarea.iv-f { resize: vertical; min-height: 76px; line-height: 1.6; }
.iv-row { display: flex; flex-direction: column; gap: 6px; font-size: var(--v3-f-sm, 13px); color: var(--v3-text-2, #475569); }
.iv-row > span i { color: var(--v3-danger, #e11d48); font-style: normal; }
.iv-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.iv-grid2 .iv-full { grid-column: 1 / -1; }
.inv-form { padding: 20px !important; }
.iv-ph-label { margin: 18px 0 8px; font-size: var(--v3-f-sm, 13px); font-weight: 600; color: var(--v3-text-2, #475569); }

.inv-photos { display: flex; flex-wrap: wrap; gap: 10px; }
.iv-ph { position: relative; width: 96px; height: 96px; border-radius: var(--v3-r-sm, 10px); overflow: hidden; border: 1px solid var(--v3-border, #e5e9f0); background: var(--v3-surface-2, #f8fafc); }
.iv-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.iv-ph button { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(15,23,42,.72); color: #fff; cursor: pointer; line-height: 1; font-size: 15px; }
.iv-add { width: 96px; height: 96px; border: 1px dashed var(--v3-border-2, #d8dfe9); border-radius: var(--v3-r-sm, 10px); background: var(--v3-surface-2, #f8fafc); color: var(--v3-text-2, #475569); font-size: var(--v3-f-xs, 12px); cursor: pointer; }
.iv-add:hover { border-color: var(--v3-primary, #4f46e5); color: var(--v3-primary, #4f46e5); }

.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.inv-card {
  background: var(--v3-surface, #fff);
  border: 1px solid var(--v3-border, #e5e9f0);
  border-left: 3px solid var(--v3-primary, #4f46e5);
  border-radius: var(--v3-r-md, 12px);
  padding: 15px 17px;
  box-shadow: var(--v3-sh-1, 0 1px 2px rgba(15,23,42,.04));
  cursor: pointer;
  transition: box-shadow .15s, transform .15s, border-color .15s;
}
.inv-card:hover { box-shadow: var(--v3-sh-2, 0 4px 14px rgba(15,23,42,.07)); transform: translateY(-1px); border-color: var(--v3-primary-line, #c7d2fe); }
.inv-card.st-pending { border-left-color: var(--v3-warn, #d97706); }
.inv-card.st-accepted, .inv-card.st-scheduled { border-left-color: var(--v3-info, #0891b2); }
.inv-card.st-working { border-left-color: var(--v3-primary, #4f46e5); }
.inv-card.st-done { border-left-color: var(--v3-success, #0d9488); }
.inv-card.st-rejected, .inv-card.st-cancelled { border-left-color: var(--v3-text-3, #94a3b8); opacity: .82; }
.inv-ctop { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.inv-no { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: var(--v3-f-xs, 12px); color: var(--v3-text-3, #94a3b8); margin-right: auto; }
.inv-title { font-size: var(--v3-f-md, 15px); font-weight: 600; color: var(--v3-text, #1f2937); margin: 10px 0 2px; line-height: 1.5; }
.inv-kind { font-size: var(--v3-f-xs, 12px); color: var(--v3-primary-text, #4f46e5); }
.inv-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 12px; margin: 12px 0 0; font-size: var(--v3-f-xs, 12px); color: var(--v3-text-2, #475569); }
.inv-meta span { display: flex; gap: 6px; min-width: 0; }
.inv-meta b { flex: 0 0 30px; font-weight: 500; color: var(--v3-text-3, #94a3b8); }
.inv-meta .iv-wide { grid-column: 1 / -1; }
.inv-desc { margin-top: 10px; padding: 8px 10px; border-radius: var(--v3-r-sm, 10px); background: var(--v3-surface-2, #f8fafc); font-size: var(--v3-f-xs, 12px); color: var(--v3-text-2, #475569); line-height: 1.6; max-height: 54px; overflow: hidden; }
.inv-cfoot { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; padding-top: 11px; border-top: 1px solid var(--v3-border, #e5e9f0); }
.inv-page { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; font-size: var(--v3-f-sm, 13px); color: var(--v3-text-2, #475569); }

.inv-dtitle { font-size: var(--v3-f-lg, 18px); font-weight: 600; color: var(--v3-text, #1f2937); margin-bottom: 18px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.inv-block { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--v3-border, #e5e9f0); font-size: var(--v3-f-sm, 13px); line-height: 1.7; color: var(--v3-text-2, #475569); white-space: pre-wrap; }
.inv-block b { display: block; font-size: var(--v3-f-sm, 13px); color: var(--v3-text, #1f2937); margin-bottom: 6px; }
.inv-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--v3-border, #e5e9f0); }
.inv-timeline { position: relative; padding-left: 18px; }
.inv-timeline::before { content: ''; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 1px; background: var(--v3-border-2, #d8dfe9); }
.it-item { position: relative; padding: 0 0 16px 0; }
.it-dot { position: absolute; left: -18px; top: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--v3-primary, #4f46e5); border: 2px solid var(--v3-surface, #fff); box-sizing: content-box; }
.it-b { font-size: var(--v3-f-sm, 13px); color: var(--v3-text-2, #475569); line-height: 1.6; }
.it-b b { color: var(--v3-text, #1f2937); }
.it-m { font-size: var(--v3-f-xs, 12px); color: var(--v3-text-3, #94a3b8); margin-top: 3px; }
.inv-flow { font-size: var(--v3-f-sm, 13px); color: var(--v3-text-2, #475569); line-height: 1.9; }
.inv-flow b { color: var(--v3-primary-text, #4f46e5); margin-right: 6px; }

.inv-mask { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--v3-scrim, rgba(15,23,42,.55)); }
.inv-dialog { width: min(460px, 100%); background: var(--v3-surface, #fff); border: 1px solid var(--v3-border, #e5e9f0); border-radius: var(--v3-r-lg, 14px); box-shadow: var(--v3-sh-3, 0 12px 32px rgba(15,23,42,.13)); overflow: hidden; }
.inv-dh { display: flex; align-items: center; justify-content: space-between; padding: 15px 20px; border-bottom: 1px solid var(--v3-border, #e5e9f0); font-size: var(--v3-f-md, 15px); color: var(--v3-text, #1f2937); }
.iv-x { border: 0; background: none; font-size: 22px; line-height: 1; color: var(--v3-text-3, #94a3b8); cursor: pointer; }
.inv-db { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; max-height: 60vh; overflow: auto; }
.inv-df { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 20px; border-top: 1px solid var(--v3-border, #e5e9f0); background: var(--v3-surface-2, #f8fafc); }

@media (max-width: 900px) {
  .inv-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inv-grid { grid-template-columns: 1fr; }
  .iv-grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .inv-meta { grid-template-columns: 1fr; }
  .iv-grid .iv-f, .iv-grid .iv-f[placeholder] { flex: 1 1 100%; min-width: 0; }
  .inv-cfoot .btn { flex: 1 1 auto; }
}
