/* demo.css — 动画关键帧 + 微调样式 */

/* ─── 导航 ─── */
.nav-link { text-decoration: none; color: inherit; }
.nav-active { color: #006EFF !important; font-weight: 600; }

/* ─── Loading ─── */
.loading-spinner {
  width: 32px; height: 32px;
  border: 3px solid #E5E6EB;
  border-top-color: #006EFF;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Modal ─── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
}
.modal-overlay.hidden { display: none; }

/* ─── OCR 动画 ─── */
@keyframes scan-line {
  0%   { top: 0%; opacity: 0.9; }
  50%  { opacity: 0.6; }
  100% { top: 100%; opacity: 0.1; }
}
@keyframes field-extract {
  0%   { opacity: 0; transform: translateY(8px) translateX(-12px); }
  60%  { opacity: 0.7; transform: translateY(-2px) translateX(2px); }
  100% { opacity: 1; transform: translateY(0) translateX(0); }
}
@keyframes row-highlight {
  0%   { background-color: rgba(245, 63, 63, 0.15); }
  100% { background-color: transparent; }
}
@keyframes pulse-warning {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 125, 0, 0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(255, 125, 0, 0); }
}
@keyframes shimmer {
  0%   { background-position: -200px 0; }
  100% { background-position: 200px 0; }
}

.ocr-scan-line {
  position: absolute; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, #00B42A, transparent);
  animation: scan-line 1s ease-in-out forwards;
  pointer-events: none; z-index: 5;
}

.field-animate {
  opacity: 0;
  animation: field-extract 0.35s ease-out forwards;
}
.field-animate:nth-child(1) { animation-delay: 0.05s; }
.field-animate:nth-child(2) { animation-delay: 0.15s; }
.field-animate:nth-child(3) { animation-delay: 0.25s; }
.field-animate:nth-child(4) { animation-delay: 0.35s; }
.field-animate:nth-child(5) { animation-delay: 0.45s; }
.field-animate:nth-child(6) { animation-delay: 0.55s; }
.field-animate:nth-child(7) { animation-delay: 0.65s; }
.field-animate:nth-child(8) { animation-delay: 0.75s; }
.field-animate:nth-child(9) { animation-delay: 0.85s; }

.row-new-highlight {
  animation: row-highlight 1.5s ease-out;
}

.pulse-warning {
  animation: pulse-warning 2s infinite;
}

/* ─── 审计表格 ─── */
.audit-table th {
  position: sticky; top: 0; z-index: 10;
  background: #F5F7FA;
  font-weight: 600; font-size: 0.8125rem;
  color: #1D2129;
  white-space: nowrap;
}
.audit-table td {
  font-size: 0.8125rem;
  white-space: nowrap;
}
.audit-table tr.error-row {
  background: rgba(245, 63, 63, 0.06);
}
.audit-table tr.error-row:hover {
  background: rgba(245, 63, 63, 0.12);
}
.audit-table tr.normal-row:hover {
  background: #F5F7FA;
}

/* ─── 邮件预览 ─── */
.email-card {
  border: 1px solid #E5E6EB;
  border-radius: 12px;
  overflow: hidden;
}
.email-header {
  background: #F5F7FA;
  border-bottom: 1px solid #E5E6EB;
  padding: 12px 16px;
}
.email-body {
  padding: 16px;
  font-size: 0.875rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

/* ─── 步骤卡片 hover ─── */
.step-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.step-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* ─── 发票预览 ─── */
.invoice-thumb {
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s, transform 0.15s;
}
.invoice-thumb:hover {
  border-color: #006EFF;
  transform: scale(1.03);
}
.invoice-thumb.active {
  border-color: #006EFF;
  box-shadow: 0 0 0 3px rgba(0, 110, 255, 0.15);
}

/* ─── 搜索高亮 ─── */
.search-highlight {
  background: #FFF3CD;
  padding: 0 2px;
  border-radius: 2px;
}

/* ─── 动画完成勾 ─── */
@keyframes check-pop {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.check-animate {
  animation: check-pop 0.4s ease-out forwards;
}

/* ─── Toast ─── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #1D2129; color: #fff; padding: 10px 24px;
  border-radius: 8px; font-size: 0.875rem; z-index: 200;
  animation: toast-in 0.3s ease-out;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ─── 发送动画 ─── */
@keyframes send-fly {
  0%   { transform: translateX(0) scale(1); opacity: 1; }
  100% { transform: translateX(200px) scale(0.3); opacity: 0; }
}
.send-animate {
  animation: send-fly 0.6s ease-in forwards;
}
