/* ============================================================
   消费者端：NFC 溯源（证书仪式感）+ 批次选择页
   ============================================================ */

/* ---------- 批次选择页 ---------- */
.trace-list-page {
  min-height: 100vh;
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}
.trace-list-head { display: flex; gap: 16px; align-items: center; margin-bottom: 24px; }
.trace-list-title h1 { font-size: 26px; }
.trace-list-title p { font-size: 13px; margin-top: 2px; }
.trace-batches { display: flex; flex-direction: column; gap: 12px; }
.trace-batch-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--paper-bright);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  box-shadow: var(--sh-1);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
@media (hover: hover) {
  .trace-batch-card:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
}
.trace-batch-card:active { transform: scale(.98); }
.trace-batch-info h2 { font-size: 17px; }
.trace-batch-arrow { color: var(--gold-deep); font-size: 18px; flex-shrink: 0; }
.trace-nfc-help { margin-top: 24px; padding: 18px 20px; }
.trace-nfc-help h2 { font-size: 16px; margin-bottom: 6px; }

/* ---------- 溯源页 ---------- */
.trace-page {
  min-height: 100vh;
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 18px 40px;
  background: linear-gradient(180deg, rgba(127, 184, 161, .12), transparent 320px);
}

/* NFC 加载态 */
.trace-loading {
  min-height: 70vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
}
.nfc-ring {
  position: relative;
  width: 96px; height: 96px;
  display: grid; place-items: center;
}
.nfc-ring i {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--tea-green);
  box-shadow: 0 0 0 8px rgba(62, 122, 82, .14);
}
.nfc-ring span {
  position: absolute; inset: 0;
  border: 2px solid var(--tea-green);
  border-radius: 50%;
  animation: radar 2.2s var(--ease-out) infinite;
}
.nfc-ring span:nth-child(2) { animation-delay: .55s; }
.nfc-ring span:nth-child(3) { animation-delay: 1.1s; }
@keyframes radar {
  0% { transform: scale(.4); opacity: .9; }
  100% { transform: scale(1.5); opacity: 0; }
}
.nfc-connecting { color: var(--tea-deep); font-size: 14px; letter-spacing: .08em; }

/* 连接完成横条 */
.trace-nfc-bar {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px;
  background: rgba(62, 122, 82, .08);
  border: 1px solid rgba(62, 122, 82, .2);
  border-radius: var(--r-pill);
  margin-bottom: 18px;
  color: var(--tea-deep); font-size: 13px;
  animation: fadeUp var(--dur-med) var(--ease-out);
}
.trace-nfc-chip { display: inline-flex; color: var(--tea-green); }

/* 溯源证书 */
.trace-cert {
  position: relative;
  background:
    linear-gradient(rgba(252, 249, 241, .93), rgba(252, 249, 241, .93)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.34 0 0 0 0 0.31 0 0 0 0 0.24 0 0 0 0.05 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  border: 1px solid rgba(62, 122, 82, .28);
  border-radius: var(--r-xl);
  padding: 28px 24px 22px;
  box-shadow: var(--sh-2);
  animation: fadeUp var(--dur-med) var(--ease-out);
}
.trace-cert-corners i {
  position: absolute;
  width: 22px; height: 22px;
  border: 2px solid var(--gold);
  opacity: .75;
}
.trace-cert-corners i:nth-child(1) { top: 10px; left: 10px; border-right: none; border-bottom: none; border-top-left-radius: 8px; }
.trace-cert-corners i:nth-child(2) { top: 10px; right: 10px; border-left: none; border-bottom: none; border-top-right-radius: 8px; }
.trace-cert-corners i:nth-child(3) { bottom: 10px; left: 10px; border-right: none; border-top: none; border-bottom-left-radius: 8px; }
.trace-cert-corners i:nth-child(4) { bottom: 10px; right: 10px; border-left: none; border-top: none; border-bottom-right-radius: 8px; }

.trace-cert-head { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }
.trace-cert-title { font-size: 22px; line-height: 1.5; }
.trace-cert-meta { color: var(--clay); font-size: 13px; margin-top: 4px; }

.trace-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; margin-bottom: 20px; }
.trace-facts > div { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.trace-facts dt { font-size: 12px; color: var(--clay); }
.trace-facts dd { font-size: 14px; margin-top: 2px; }

/* 防伪 */
.trace-anti {
  display: flex; gap: 12px;
  padding: 14px 16px;
  background: rgba(201, 162, 39, .07);
  border: 1px solid rgba(201, 162, 39, .3);
  border-radius: var(--r-md);
}
.trace-anti-item { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.trace-anti-label { font-size: 12px; color: var(--clay); }
.trace-finger { font-size: 18px; font-weight: 700; color: var(--tea-deep); letter-spacing: .12em; }
.trace-scan-num { font-size: 18px; font-weight: 700; color: var(--gold-deep); }
.trace-anti-tip { font-size: 11px; color: var(--clay); margin-top: 10px; }

/* 验真失败 */
.trace-cert-invalid { border-color: rgba(180, 85, 45, .4); }
.trace-invalid-tip {
  margin: 18px 0;
  padding: 12px 16px;
  background: rgba(180, 85, 45, .08);
  border-radius: var(--r-md);
  font-size: 13px; color: var(--clay-red);
}

/* 种植历程时间轴 */
.trace-journey { margin-top: 28px; }
.trace-sec-title { font-size: 18px; margin-bottom: 18px; }
.tl-card { padding: 16px; margin-left: 0; }
.tl-note { font-size: 14px; margin: 8px 0 10px; line-height: 1.75; }
.tl-photo {
  border-radius: var(--r-md);
  overflow: hidden;
  outline: 1px solid rgba(0,0,0,.08); outline-offset: -1px;
  transition: transform var(--dur-fast) var(--ease-out);
}
@media (hover: hover) { .tl-photo:hover { transform: scale(1.02); } }
.tl-photo:active { transform: scale(.97); }
.tl-by { font-size: 11px; color: var(--clay); margin-top: 10px; text-align: right; }

.trace-feedback { margin-top: 28px; }
.trace-foot { margin-top: 36px; text-align: center; color: var(--ink-soft); font-size: 13px; }
.trace-foot p:first-child { font-family: var(--font-display); letter-spacing: .1em; }

/* AI 茗白（白话档案 + 问茶助手） */
.trace-ai-sec { margin-top: 28px; }
.trace-summary-card { padding: 18px 20px; }
.trace-summary-text { font-size: 14.5px; line-height: 1.9; }
.trace-summary-foot, .trace-ask-note { font-size: 11.5px; color: var(--clay); }
.trace-summary-foot { margin-top: 10px; }
.trace-ask-note { margin: 12px 0 0; }
.trace-ask-card { padding: 18px 20px; }
.trace-ask-err { font-size: 13px; color: var(--clay-red); margin-top: 12px; line-height: 1.7; }

/* AI 茗道（茶识卡片 + 茶识问答） */
.trace-tea-card { padding: 18px 20px; }
.trace-tea-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.trace-tea-item {
  padding: 12px 14px; background: rgba(62, 122, 82, .05);
  border-radius: var(--r-md); border-left: 3px solid rgba(62, 122, 82, .35);
}
.trace-tea-topic { font-size: 13px; color: var(--tea-deep); margin-bottom: 6px; letter-spacing: .04em; }
.trace-tea-body { font-size: 13px; line-height: 1.75; color: var(--ink-soft); }
.trace-disclaimer {
  font-size: 11px; color: var(--clay); margin-top: 14px;
  padding-top: 10px; border-top: 1px dashed var(--line);
}
.trace-tea-ask { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line); }
@media (max-width: 560px) {
  .trace-tea-grid { grid-template-columns: 1fr; }
}
