/* ============================================
   溯源时间轴组件 · Provenance Timeline
   复用 style.css tokens · 跨模块可嵌入
   ============================================ */

.prov-hero {
  padding: 120px 0 80px;
  background:
    radial-gradient(ellipse at 20% 0%, var(--accent-glow) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(78, 197, 168, 0.08) 0%, transparent 50%);
}

.prov-hero .eyebrow {
  display: inline-block;
  font-family: var(--font-mono, "SF Mono", Consolas, monospace);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--accent);
  background: var(--accent-glow);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 24px;
}

.prov-hero h1 {
  font-size: clamp(40px, 6vw, 64px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}

.prov-hero .hero-sub {
  font-size: 18px;
  color: var(--text-secondary);
  max-width: 640px;
  margin-bottom: 48px;
  line-height: 1.6;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 24px;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.hero-stats .stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 8px;
}

.hero-stats .stat-num {
  font-family: var(--font-mono, "SF Mono", Consolas, monospace);
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.hero-stats .stat-label {
  font-size: 13px;
  color: var(--text-muted);
}

/* ============ 4 步机制 ============ */
.prov-how {
  padding: 80px 0;
  background: var(--bg-secondary);
}

.section-title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 700;
  text-align: center;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

.section-sub {
  font-size: 16px;
  color: var(--text-secondary);
  text-align: center;
  max-width: 640px;
  margin: 0 auto 48px;
}

.section-sub code {
  font-family: var(--font-mono, monospace);
  font-size: 14px;
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: var(--accent);
}

.step-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}

.step-card {
  background: var(--bg-card);
  padding: 32px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  position: relative;
  transition: var(--transition);
}

.step-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.step-card .step-num {
  position: absolute;
  top: 16px;
  right: 20px;
  font-family: var(--font-mono, monospace);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.1em;
}

.step-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  margin-bottom: 16px;
  background-size: 24px 24px;
  background-position: center;
  background-repeat: no-repeat;
}

.step-source-icon  { background-color: var(--info); background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2"><path d="M4 19.5A2.5 2.5 0 0 1 6.5 17H20"/><path d="M6.5 2H20v20H6.5A2.5 2.5 0 0 1 4 19.5v-15A2.5 2.5 0 0 1 6.5 2z"/></svg>'); }
.step-fork-icon    { background-color: var(--accent); background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2"><circle cx="6" cy="3" r="2"/><circle cx="6" cy="21" r="2"/><circle cx="18" cy="6" r="2"/><path d="M18 9v6M6 9v9M6 12h6"/></svg>'); }
.step-distill-icon { background-color: var(--success); background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2"><path d="M9 2v6L4 18a2 2 0 0 0 1.7 3h12.6A2 2 0 0 0 20 18L15 8V2"/><path d="M9 2h6"/></svg>'); }
.step-attest-icon  { background-color: var(--warning); background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2"><path d="M12 2L4 6v6c0 5 3.5 9.5 8 10 4.5-.5 8-5 8-10V6l-8-4z"/><path d="M9 12l2 2 4-4"/></svg>'); }

.step-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.step-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ============ 真实案例 · 时间轴本体 ============ */
.prov-examples {
  padding: 80px 0;
}

.example-block {
  margin-bottom: 56px;
  scroll-margin-top: 80px;
}

.example-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.example-head h3 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 6px;
}

.example-meta {
  font-size: 14px;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}

.example-meta span { color: var(--text-muted); margin-right: 4px; }
.example-meta code {
  font-family: var(--font-mono, monospace);
  background: var(--bg-tertiary);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.example-tag {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}

.tag-financial { background: var(--entry-financial-glow); color: var(--entry-financial-aa); }
.tag-health    { background: var(--entry-health-glow); color: var(--entry-health-aa); }
.tag-relations { background: var(--entry-relations-glow); color: var(--entry-relations-aa); }
.tag-purpose   { background: var(--entry-purpose-glow); color: var(--entry-purpose-aa); }

/* ========== 时间轴本体 · 核心组件 ========== */
.provenance-strip {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow);
  position: relative;
}

.strip-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.timeline {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(
    to bottom,
    var(--info) 0%,
    var(--info) 25%,
    var(--accent) 25%,
    var(--accent) 50%,
    var(--success) 50%,
    var(--success) 75%,
    var(--warning) 75%,
    var(--warning) 100%
  );
  border-radius: 1px;
}

.timeline li {
  position: relative;
  padding-left: 28px;
  padding-bottom: 18px;
  transition: var(--transition);
}

.timeline li:last-child { padding-bottom: 0; }

.step-dot {
  position: absolute;
  left: 0;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid var(--bg-card);
  box-shadow: 0 0 0 1px currentColor;
}

.step-source  .step-dot { color: var(--info);    background: var(--info); }
.step-fork    .step-dot { color: var(--accent);  background: var(--accent); }
.step-distill .step-dot { color: var(--success); background: var(--success); }
.step-attest  .step-dot { color: var(--warning); background: var(--warning); }

.step-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.step-content time {
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.step-content em {
  font-size: 15px;
  font-weight: 600;
  font-style: normal;
  color: var(--text-primary);
}

.step-detail {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.timeline li:hover .step-content em {
  color: var(--accent);
}

/* ========== 底栏：已核验 + hash + 链接 ========== */
.strip-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px dashed var(--border-light);
}

.verified-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(0, 132, 73, 0.08);
  color: var(--success);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.verified-btn:hover {
  background: var(--success);
  color: white;
}

.hash-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono, monospace);
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.hash-btn:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.hash-btn.copied {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.hash-btn .copy-hint {
  font-family: -apple-system, sans-serif;
  font-size: 11px;
  color: var(--text-muted);
}

.hash-btn.copied .copy-hint { color: rgba(255,255,255,0.85); }

.open-link {
  margin-left: auto;
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
}

.open-link:hover { text-decoration: underline; }

/* ========== 验证器 ========== */
.prov-verifier {
  padding: 80px 0;
  background: var(--bg-secondary);
}

.verifier-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow);
}

.verifier-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.verifier-input-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.verifier-input {
  flex: 1;
  min-width: 280px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-mono, monospace);
  font-size: 14px;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: var(--transition);
}

.verifier-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

#verify-btn {
  padding: 12px 24px;
  background: var(--accent);
  color: white;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
}

#verify-btn:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
}

#verify-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.verifier-result {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px dashed var(--border-light);
}

.result-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 20px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--warning);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.result-pending { color: var(--warning); }

.result-success { color: var(--success); }
.result-success .status-dot { background: var(--success); animation: none; }

.result-steps {
  list-style: none;
  padding: 0;
  margin: 0;
}

.result-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  margin-bottom: 8px;
  font-size: 14px;
  transition: var(--transition);
}

.result-step .step-num {
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  min-width: 28px;
}

.result-step .step-label {
  flex: 1;
  color: var(--text-secondary);
}

.step-status {
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}

.step-status-pending { background: rgba(168, 104, 0, 0.12); color: var(--warning); }
.step-status-running { background: var(--accent-glow); color: var(--accent); }
.step-status-done    { background: rgba(0, 132, 73, 0.12); color: var(--success); }

.result-final {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: rgba(0, 132, 73, 0.06);
  border: 1px solid rgba(0, 132, 73, 0.2);
  border-radius: var(--radius);
  margin-top: 16px;
  font-weight: 600;
  color: var(--success);
}

.verifier-note {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

.verifier-note code {
  font-family: var(--font-mono, monospace);
  background: var(--bg-tertiary);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
}

/* ========== 集成卡片 ========== */
.prov-integrate {
  padding: 80px 0;
}

.integrate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.integrate-card {
  background: var(--bg-card);
  padding: 28px 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  transition: var(--transition);
}

.integrate-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.integrate-icon {
  font-size: 32px;
  margin-bottom: 12px;
  display: block;
}

.integrate-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.integrate-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.integrate-card code {
  font-family: var(--font-mono, monospace);
  font-size: 13px;
  background: var(--bg-tertiary);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  color: var(--accent);
}

/* ========== Footer ========== */
.prov-footer {
  background: var(--bg-tertiary);
  padding: 60px 0 24px;
  margin-top: 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.prov-footer p {
  font-size: 13px;
  color: var(--text-muted);
}

.prov-footer h4 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.prov-footer ul li {
  margin-bottom: 8px;
}

.prov-footer ul a {
  font-size: 13px;
  color: var(--text-secondary);
  transition: var(--transition);
}

.prov-footer ul a:hover {
  color: var(--accent);
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
  .prov-hero { padding: 100px 0 60px; }
  .prov-hero h1 { font-size: 36px; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .step-grid { grid-template-columns: 1fr; }
  .example-head { flex-direction: column; }
  .timeline::before { left: 5px; }
  .timeline li { padding-left: 24px; }
  .step-dot { width: 12px; height: 12px; }
  .strip-footer { flex-direction: column; align-items: stretch; }
  .open-link { margin-left: 0; text-align: right; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
}

/* ========== 减弱动效偏好 ========== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .status-dot { animation: none; }
}