/* ═══════════════════════════════════════════════════
   Spice Sourcing Assistant — Styles
   ═══════════════════════════════════════════════════ */

/* ─── 浮动触发按钮 ──────────────────────────────────── */
.sourcing-float-btn {
  position: fixed;
  bottom: 100px;
  left: 24px;
  z-index: 1100;
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #d32f2f 0%, #ff6f00 100%);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 14px 22px;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Segoe UI', sans-serif;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(211, 47, 47, 0.45);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.3px;
  animation: floatPulse 3s ease-in-out infinite;
}
.sourcing-float-btn:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 10px 32px rgba(211, 47, 47, 0.55);
}
.sourcing-float-icon { font-size: 20px; }

/* 收缩停靠状态 - sourcing 按钮靠左边 */
.sourcing-float-btn.docked {
  left: -2px;
  border-radius: 0 50px 50px 0;
  padding: 14px 16px 14px 10px;
  animation: none;
  box-shadow: 2px 2px 16px rgba(211,47,47,0.4);
  bottom: 160px;
}
.sourcing-float-btn.docked:hover {
  transform: translateX(6px);
  box-shadow: 4px 4px 24px rgba(211,47,47,0.55);
}
.sourcing-float-btn.docked .sourcing-float-text {
  display: none;
}
.sourcing-float-btn.docked .sourcing-float-icon {
  font-size: 22px;
}

@keyframes floatPulse {
  0%, 100% { box-shadow: 0 6px 24px rgba(211,47,47,0.45); }
  50%       { box-shadow: 0 6px 32px rgba(255,111,0,0.6); }
}

/* ─── Hero 按钮 ─────────────────────────────────────── */
.sourcing-hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  margin-left: 12px;
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.7);
  border-radius: 50px;
  padding: 13px 28px;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Segoe UI', sans-serif;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 0.3px;
  backdrop-filter: blur(4px);
}
.sourcing-hero-btn:hover {
  background: rgba(255,255,255,0.15);
  border-color: #fff;
  transform: translateY(-2px);
}

/* ─── 遮罩层 ─────────────────────────────────────────── */
.sourcing-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.sourcing-overlay.active {
  display: flex;
  animation: fadeInOverlay 0.25s ease;
}
@keyframes fadeInOverlay {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ─── 弹窗主体 ───────────────────────────────────────── */
.sourcing-modal {
  position: relative;
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,0.3);
  animation: modalSlideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(40px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0)   scale(1);    }
}

/* ─── 关闭按钮 ───────────────────────────────────────── */
.sourcing-close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: rgba(0,0,0,0.07);
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 10;
}
.sourcing-close:hover { background: rgba(0,0,0,0.14); }

/* ─── 头部 ────────────────────────────────────────────── */
.sourcing-header {
  background: linear-gradient(135deg, #d32f2f 0%, #ff6f00 100%);
  color: #fff;
  text-align: center;
  padding: 36px 30px 28px;
  border-radius: 20px 20px 0 0;
}
.sourcing-header-icon {
  font-size: 42px;
  margin-bottom: 10px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.2));
}
.sourcing-header h2 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}
.sourcing-header p {
  font-size: 13px;
  opacity: 0.85;
  font-style: italic;
}

/* ─── 进度条 ─────────────────────────────────────────── */
.sourcing-progress {
  height: 5px;
  background: #f0f0f0;
  border-radius: 0;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #d32f2f, #ff6f00);
  border-radius: 0 3px 3px 0;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  width: 20%;
}
.sourcing-step-indicator {
  text-align: right;
  font-size: 12px;
  color: #999;
  padding: 8px 20px 0;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ─── 步骤内容区 ──────────────────────────────────────── */
.sourcing-body {
  padding: 24px 28px 30px;
}
.sourcing-step h3 {
  font-size: 17px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 18px;
  line-height: 1.4;
}
.sourcing-step.hidden { display: none; }
.sourcing-step.slide-in {
  animation: stepSlide 0.3s ease;
}
@keyframes stepSlide {
  from { opacity: 0; transform: translateX(18px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ─── 选项按钮 ───────────────────────────────────────── */
.sourcing-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.opt-btn {
  width: 100%;
  text-align: left;
  padding: 14px 18px;
  border: 2px solid #e8e8e8;
  border-radius: 12px;
  background: #fafafa;
  font-size: 15px;
  font-family: 'Segoe UI', sans-serif;
  font-weight: 500;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.3;
}
.opt-btn:hover {
  border-color: #d32f2f;
  background: #fff5f5;
  color: #d32f2f;
  transform: translateX(4px);
}
.opt-btn.selected {
  border-color: #d32f2f;
  background: linear-gradient(135deg, #fff5f5, #fff8f0);
  color: #d32f2f;
  font-weight: 700;
  box-shadow: 0 2px 12px rgba(211,47,47,0.15);
}

/* ─── 文字输入 ───────────────────────────────────────── */
.sourcing-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #e8e8e8;
  border-radius: 12px;
  font-size: 15px;
  font-family: 'Segoe UI', sans-serif;
  color: #333;
  outline: none;
  margin-bottom: 14px;
  transition: border-color 0.2s;
  background: #fafafa;
}
.sourcing-input:focus { border-color: #d32f2f; background: #fff; }
.sourcing-input.error { border-color: #ff1744; }
.sourcing-next-btn {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #d32f2f, #ff6f00);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Segoe UI', sans-serif;
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: 0.3px;
}
.sourcing-next-btn:hover {
  opacity: 0.92;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(211,47,47,0.3);
}

/* ─── Loading ─────────────────────────────────────────── */
.sourcing-loading {
  text-align: center;
  padding: 50px 20px;
}
.loading-spinner {
  width: 52px;
  height: 52px;
  margin: 0 auto 20px;
  border: 4px solid #f0f0f0;
  border-top-color: #d32f2f;
  border-right-color: #ff6f00;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.sourcing-loading p {
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
}
.sourcing-loading small {
  font-size: 13px;
  color: #999;
}

/* ─── 结果卡片 ───────────────────────────────────────── */
.result-card {
  background: linear-gradient(145deg, #fff9f9, #fffbf5);
  border: 1.5px solid #f5d0d0;
  border-radius: 16px;
  padding: 22px 20px;
  margin-bottom: 16px;
}
.result-title {
  font-size: 18px;
  font-weight: 800;
  color: #1a1a1a;
  margin-bottom: 14px;
  letter-spacing: -0.3px;
}
.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.tier-high  { background: linear-gradient(135deg,#fff3cd,#ffe082); color: #7b5800; }
.tier-medium{ background: linear-gradient(135deg,#e3f2fd,#bbdefb); color: #1565c0; }
.tier-low   { background: #f5f5f5; color: #555; }

.result-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  padding: 8px 0;
  border-bottom: 1px solid #f0e8e8;
}
.result-row:last-child { border-bottom: none; }
.result-label { color: #888; font-weight: 500; }
.result-value { color: #1a1a1a; font-weight: 700; }

.result-advice {
  background: #fff8f0;
  border-left: 3px solid #ff6f00;
  border-radius: 0 8px 8px 0;
  padding: 10px 14px;
  font-size: 13px;
  color: #7b4000;
  margin-bottom: 12px;
  line-height: 1.5;
}

.tier-msg {
  border-radius: 10px;
  padding: 11px 15px;
  font-size: 13.5px;
  line-height: 1.5;
  margin-top: 4px;
}
.tier-msg-high   { background: #fffde7; border: 1px solid #ffe082; color: #6d4c00; }
.tier-msg-medium { background: #e8f5e9; border: 1px solid #a5d6a7; color: #1b5e20; }
.tier-msg-low    { background: #f5f5f5; border: 1px solid #ddd;    color: #555; }

/* ─── WhatsApp CTA ───────────────────────────────────── */
.whatsapp-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 800;
  font-family: 'Segoe UI', sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 20px rgba(37,211,102,0.35);
  margin-bottom: 10px;
}
.whatsapp-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(37,211,102,0.45);
  opacity: 0.95;
}
.whatsapp-cta-btn i { font-size: 20px; }

.restart-btn {
  width: 100%;
  padding: 11px;
  background: transparent;
  color: #999;
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  font-size: 14px;
  font-family: 'Segoe UI', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}
.restart-btn:hover { color: #d32f2f; border-color: #d32f2f; background: #fff5f5; }

/* ─── 结果操作行 ─────────────────────────────────────────── */
.result-action-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}
.result-action-row .whatsapp-cta-btn {
  flex: 1;
  margin-bottom: 0;
  font-size: 14px;
  padding: 14px 10px;
}
.share-img-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: 0 0 auto;
  padding: 14px 16px;
  background: linear-gradient(135deg, #1565c0, #1e88e5);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  font-family: 'Segoe UI', sans-serif;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(21,101,192,0.3);
}
.share-img-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(21,101,192,0.42);
  opacity: 0.93;
}
.share-img-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* ─── 分享截图卡片（离屏渲染用）────────────────────────── */
.share-snapshot-card {
  width: 420px;
  background: #fff9f9;
  border-radius: 20px;
  padding: 22px 22px 16px;
  font-family: 'Segoe UI', Arial, sans-serif;
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
}
.snap-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 2px solid #f5d0d0;
}
.snap-logo { font-size: 36px; }
.snap-brand {
  font-size: 16px;
  font-weight: 800;
  color: #d32f2f;
  letter-spacing: -0.3px;
}
.snap-sub {
  font-size: 12px;
  color: #999;
  margin-top: 2px;
}
.snap-footer {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #f0e8e8;
  font-size: 12px;
  color: #aaa;
  text-align: center;
  letter-spacing: 0.3px;
}

/* ─── 滚动条美化 ─────────────────────────────────────── */
.sourcing-modal::-webkit-scrollbar { width: 5px; }
.sourcing-modal::-webkit-scrollbar-track { background: #f9f9f9; }
.sourcing-modal::-webkit-scrollbar-thumb { background: #ddd; border-radius: 10px; }

/* ─── 移动端适配 ─────────────────────────────────────── */
@media (max-width: 520px) {
  .sourcing-modal { border-radius: 16px 16px 0 0; max-height: 95vh; }
  .sourcing-overlay { align-items: flex-end; padding: 0; }
  .sourcing-header { padding: 28px 22px 22px; border-radius: 16px 16px 0 0; }
  .sourcing-body { padding: 20px 18px 26px; }
  .sourcing-header h2 { font-size: 19px; }
  .sourcing-float-btn .sourcing-float-text { display: none; }
  .sourcing-float-btn { padding: 14px 16px; border-radius: 50%; }
  .sourcing-float-icon { font-size: 24px; }
}

