/* ==========================================================================
   v12 · Dopamine-Driven Social Commerce Layer
   专业 AI 解读电商 — 轻量社交激励层
   ========================================================================== */

/* ---------- 设计变量 ---------- */
:root {
  --dop-orange: #f97316;
  --dop-indigo: #4f46e5;
  --dop-red: #dc2626;
  --dop-gold: #fbbf24;
  --dop-gold-deep: #d97706;
  --dop-bg-soft: #fff7ed;
  --dop-text: #1f2937;
  --dop-text-muted: #6b7280;
  --dop-radius: 12px;
  --dop-shadow: 0 4px 14px rgba(249, 115, 22, 0.15);
}

/* ---------- prefers-reduced-motion 全局开关 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}


/* ==========================================================================
   1. STREAK BAR — 连续签到条（JS 动态生成插入 #v12-streak-anchor）
   ========================================================================== */
.streak-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin: 16px auto;
  max-width: 1100px;
  background: linear-gradient(135deg, #fff7ed 0%, #eef2ff 100%);
  border: 1px solid #fed7aa;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.12);
  font-size: 14px;
  color: #1f2937;
  flex-wrap: wrap;
}
.streak-bar__info { flex: 1; min-width: 0; order: 1; }
.streak-bar__count { font-weight: 700; color: #f97316; font-size: 15px; }
.streak-bar__hint { font-size: 12px; color: #6b7280; margin-top: 2px; }
.streak-bar__days {
  display: flex; gap: 6px; order: 2; width: 100%;
  justify-content: space-between; margin-top: 6px;
}
.streak-bar__dot {
  width: 24px; height: 24px; border-radius: 50%;
  background: #e5e7eb; border: 2px solid #d1d5db;
  transition: all 0.3s ease; position: relative;
}
.streak-bar__dot.claimed {
  background: radial-gradient(circle at 30% 30%, #fcd34d, #d97706);
  border-color: #d97706;
  box-shadow: 0 0 6px rgba(251, 191, 36, 0.5);
}
.streak-bar__dot.today { border-color: #f97316; border-style: dashed; }
.streak-bar__dot .streak-bar__label {
  position: absolute; top: -18px; left: 50%;
  transform: translateX(-50%); font-size: 10px;
  color: #6b7280; white-space: nowrap;
}
.streak-bar__btn {
  order: 3; padding: 8px 18px;
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #fff; border: none; border-radius: 20px;
  font-weight: 600; font-size: 13px; cursor: pointer;
  white-space: nowrap; position: relative; overflow: hidden;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.4);
  font-family: inherit;
}
.streak-bar__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.55);
}
.streak-bar__btn.checked {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.4);
}
.streak-bar__btn:not(.checked)::after {
  content: ''; position: absolute; inset: -3px;
  border-radius: 24px;
  background: linear-gradient(135deg, #f97316, #ea580c);
  opacity: 0; z-index: -1;
  animation: dop-pulse-glow 2s ease-out infinite;
}
@keyframes dop-pulse-glow {
  0% { transform: scale(1); opacity: 0.6; }
  70% { transform: scale(1.3); opacity: 0; }
  100% { transform: scale(1.3); opacity: 0; }
}
@media (max-width: 480px) {
  .streak-bar { padding: 10px 12px; gap: 8px; font-size: 13px; }
  .streak-bar__dot { width: 20px; height: 20px; }
  .streak-bar__btn { padding: 7px 14px; font-size: 12px; }
}


/* ==========================================================================
   2. SCROLL REVEAL — IntersectionObserver 驱动
   JS 给元素加 .revealed → CSS 触发渐显
   安全性：默认可见（无 JS 也不影响展示），JS 初始化时才隐藏
   ========================================================================== */
/* JS 未加载时默认可见，JS 初始化后通过内联 style 设置 opacity:0 */
.tc-v4-card, .v4-card, .hotspot-ov-card, .hot-chip, .latest-card {
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.tc-v4-card[data-v12-hidden], .v4-card[data-v12-hidden],
.hotspot-ov-card[data-v12-hidden], .hot-chip[data-v12-hidden], .latest-card[data-v12-hidden] {
  opacity: 0;
  transform: translateY(20px);
}
.tc-v4-card.revealed, .v4-card.revealed,
.hotspot-ov-card.revealed, .hot-chip.revealed, .latest-card.revealed {
  opacity: 1 !important;
  transform: translateY(0) !important;
}


/* ==========================================================================
   3. SHARE LOCK — 分享解锁徽章（JS 注入 .v12-share-lock）
   ========================================================================== */
.v12-share-lock {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px; margin-left: 8px;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
  border: 1px solid #4f46e5; border-radius: 14px;
  font-size: 11px; color: #4f46e5; font-weight: 600;
  cursor: pointer; user-select: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.v12-share-lock:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(79, 70, 229, 0.25);
}
.v12-share-lock.unlocked {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-color: #d97706; color: #d97706;
  animation: dop-micro-bounce 0.5s ease;
}
@keyframes dop-micro-bounce {
  0%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
  60% { transform: translateY(2px); }
}
/* 分享面板 */
.v12-share-panel {
  position: absolute; z-index: 1000;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  padding: 10px; margin-top: 6px; min-width: 180px;
  display: none;
}
.v12-share-panel.open { display: block; }
.v12-sp-title { font-size: 12px; font-weight: 700; color: #4f46e5; margin-bottom: 8px; }
.v12-sp-options { display: flex; flex-direction: column; gap: 4px; }
.v12-sp-options button {
  padding: 6px 12px; border: 1px solid #e5e7eb; border-radius: 6px;
  background: #f9fafb; font-size: 12px; cursor: pointer;
  text-align: left; font-family: inherit;
}
.v12-sp-options button:hover { background: #eef2ff; border-color: #4f46e5; color: #4f46e5; }


/* ==========================================================================
   4. SCARCITY — 稀缺/真实销量徽章（JS 注入 .v12-scarcity）
   ========================================================================== */
.v12-scarcity {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; margin-left: 6px;
  background: #fef2f2; border: 1px solid #fecaca; border-radius: 6px;
  font-size: 11px; color: #dc2626; font-weight: 600;
}
.v12-scarcity.urgent {
  animation: dop-breathe 2.4s ease-in-out infinite;
}
@keyframes dop-breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
  50% { box-shadow: 0 0 8px 2px rgba(220, 38, 38, 0.18); }
}


/* ==========================================================================
   5. CELEBRATION — 全屏庆祝（JS 注入 .v12-celebration）
   ========================================================================== */
.v12-celebration {
  position: fixed; inset: 0; z-index: 9999;
  pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.15);
  animation: dop-fade-in 0.2s ease-out;
}
@keyframes dop-fade-in { from { opacity: 0; } to { opacity: 1; } }
.v12-cele-text {
  text-align: center; padding: 20px 36px;
  background: rgba(255,255,255,0.97);
  border-radius: 16px;
  font-size: 20px; font-weight: 800; color: #f97316;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
  animation: dop-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  position: relative; z-index: 1;
}
@keyframes dop-pop {
  0% { transform: scale(0.3); opacity: 0; }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}
.v12-cele-sub {
  display: block; font-size: 13px; font-weight: 600;
  color: #6b7280; margin-top: 6px;
}
.v12-cele-particles {
  position: absolute; inset: 0; overflow: hidden;
}
.v12-particle {
  position: absolute;
  top: -20px;
  width: 8px; height: 8px;
  animation: v12-fall 1.2s ease-out forwards;
}
@keyframes v12-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}


/* ==========================================================================
   6. PRICE PROGRESS — 满减进度条（JS 注入 .v12-price-progress）
   ========================================================================== */
.v12-price-progress {
  margin-top: 8px; font-size: 11px; color: #6b7280;
}
.v12-pp-label { display: flex; justify-content: space-between; margin-bottom: 4px; }
.v12-pp-track {
  width: 100%; height: 5px; background: #f3f4f6;
  border-radius: 99px; overflow: hidden;
}
.v12-pp-fill {
  height: 100%;
  background: linear-gradient(90deg, #f97316, #fbbf24);
  border-radius: 99px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}
.v12-pp-fill::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
  animation: dop-shimmer 2s linear infinite;
}
@keyframes dop-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
