/* ============================================================
   通用组件样式
   ============================================================ */

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: var(--fs-sm);
  padding: 10px 18px;
  transition: opacity 0.15s ease;
}
.btn:active { opacity: 0.85; }
.btn--green { background: var(--green-800); color: #fff; box-shadow: var(--shadow-btn); }
.btn--orange { background: var(--orange-500); color: #fff; box-shadow: 0 4px 12px rgba(217, 130, 43, 0.25); }
.btn--block { width: 100%; }
.btn--sm { padding: 6px 12px; font-size: var(--fs-xs); border-radius: var(--r-sm); }

/* ---------- 标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: var(--r-sm);
  background: var(--green-100);
  color: var(--green-800);
  font-size: 10px;
  line-height: 1.3;
  white-space: nowrap;
}

/* ---------- 区块卡片 ---------- */
.section-card {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 8px 10px;
  box-shadow: var(--shadow-card);
}
.section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-900);
  margin-bottom: 5px;
}

/* ---------- 顶部导航栏 ---------- */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px calc(14px + env(safe-area-inset-top));
  background: var(--green-800);
  position: sticky;
  top: 0;
  z-index: 30;
}
.navbar--green { background: var(--green-800); }
.navbar-back { width: 32px; height: 32px; color: #fff; display: flex; align-items: center; justify-content: center; }
.navbar-back svg { width: 22px; height: 22px; }
.navbar-back-slot { width: 32px; }
.navbar-title { color: #fff; font-size: var(--fs-lg); font-weight: 700; }

/* 小程序胶囊占位 */
.capsule {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 10px;
  border-radius: var(--r-xl);
  background: rgba(255, 255, 255, 0.18);
}
.capsule-dots { display: inline-flex; gap: 3px; }
.capsule-dots i { width: 5px; height: 5px; border-radius: 50%; background: #fff; }
.capsule-line { width: 1px; height: 16px; background: rgba(255,255,255,0.4); }
.capsule-target { width: 14px; height: 14px; border: 1.6px solid #fff; border-radius: 50%; position: relative; }
.capsule-target::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: #fff; }

/* ---------- 底部 TabBar ---------- */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--container-w);
  background: var(--card);
  border-top: 1px solid var(--line);
  display: flex;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  z-index: 30;
}
.tabbar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--ink-500);
}
.tabbar-icon svg { width: 23px; height: 23px; }
.tabbar-label { font-size: var(--fs-xs); }
.tabbar-item.is-active { color: var(--green-800); font-weight: 600; }

/* ---------- 商品卡 ---------- */
.product-card {
  background: var(--green-50-2);
  border-radius: var(--r-md);
  padding: 5px;
  display: flex;
  gap: 7px;
  text-align: left;
  width: 100%;
  min-width: 0;
}
.product-card-img { width: 40px; flex-shrink: 0; align-self: center; background: var(--green-50); border-radius: var(--r-sm); padding: 3px; }
.product-card-img img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--r-sm); display: block; }
.product-art { width: 100%; height: auto; }
.product-card-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.product-card-name {
  font-size: 12px; font-weight: 700; line-height: 1.25;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.product-card-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.product-card-bottom { margin-top: auto; display: flex; align-items: center; justify-content: space-between; }
.product-price { color: var(--orange-600); font-weight: 700; font-size: 14px; }
.product-cart-btn {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--green-800); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.cart-icon svg { width: 13px; height: 13px; }

/* ---------- 科普卡 ---------- */
.science-card {
  background: var(--green-50);
  border-radius: var(--r-md);
  padding: 5px;
  display: flex; flex-direction: column; gap: 2px;
  text-align: left; height: 100%; min-width: 0;
}
.science-card-title { font-size: 11.5px; font-weight: 700; line-height: 1.3; }
.science-card-desc { font-size: 9.5px; color: var(--ink-500); line-height: 1.3; }
.science-card-art { margin-top: auto; padding-top: 2px; }
.science-card-art img { width: 100%; height: 12px; object-fit: cover; border-radius: 6px; display: block; }
.science-icon svg { width: 16px; height: 16px; color: var(--green-600); }

/* ---------- 任务卡 ---------- */
.task-card {
  background: var(--green-50-2);
  border-radius: var(--r-md);
  padding: 5px 4px;
  display: flex; flex-direction: column; gap: 4px;
  align-items: stretch;
  min-width: 0;
}
.task-card-head { display: flex; align-items: center; gap: 5px; min-width: 0; }
.task-icon { flex: none; }
.task-icon svg { width: 16px; height: 16px; color: var(--green-800); }
.task-card-title {
  min-width: 0; font-size: 11px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.task-card .btn { width: 100%; font-size: 10px; padding: 5px 2px; }

/* ---------- 提示 Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 120px;
  transform: translateX(-50%) translateY(8px);
  background: rgba(31, 45, 40, 0.92);
  color: #fff;
  font-size: var(--fs-sm);
  padding: 10px 18px;
  border-radius: var(--r-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 100;
  max-width: 80%;
  text-align: center;
}
.toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 占位页 ---------- */
.placeholder {
  padding: 96px var(--sp-5);
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-3);
  text-align: center;
}
.placeholder-icon {
  width: 72px; height: 72px; border-radius: var(--r-xl);
  background: var(--green-100); color: var(--green-800);
  display: flex; align-items: center; justify-content: center;
}
.placeholder-icon svg { width: 36px; height: 36px; }
.placeholder-title { font-size: var(--fs-xl); font-weight: 700; }
.placeholder-desc { color: var(--ink-500); font-size: var(--fs-sm); }

/* ---------- 免责声明 ---------- */
.disclaimer {
  margin: var(--sp-4) var(--sp-2) calc(var(--sp-3) + env(safe-area-inset-bottom));
  font-size: var(--fs-xs);
  color: var(--ink-500);
  text-align: center;
  line-height: 1.6;
}

/* ---------- 详情：特点 / 步骤卡 ---------- */
.feature-card {
  background: #FBF6EC;
  border-radius: var(--r-md);
  padding: 10px;
  display: flex; flex-direction: column; gap: 4px;
}
.feature-icon { width: 30px; height: 30px; border-radius: 50%; background: var(--green-800); color: #fff; display: flex; align-items: center; justify-content: center; }
.feature-icon svg { width: 17px; height: 17px; }
.feature-title { font-size: var(--fs-md); font-weight: 700; }
.feature-desc { font-size: var(--fs-xs); color: var(--ink-500); }

.step-card {
  background: var(--green-50);
  border-radius: var(--r-md);
  padding: 10px;
  display: flex; flex-direction: column; gap: 4px;
}
.step-title { font-size: var(--fs-md); font-weight: 700; }
.step-desc { font-size: var(--fs-xs); color: var(--ink-500); }
.step-art { margin-top: auto; padding-top: 6px; }
.step-art img { width: 100%; height: 56px; object-fit: cover; border-radius: 6px; display: block; }
.step-icon svg { width: 30px; height: 30px; color: var(--green-600); }

/* 合规提示条 */
.compliance-strip {
  margin: 12px 12px 0;
  padding: 10px 12px;
  background: var(--card);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  color: var(--ink-700);
  line-height: 1.5;
}

/* 详情底部固定操作栏 */
.detail-actionbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--container-w);
  background: var(--card);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 10px var(--sp-4) calc(10px + env(safe-area-inset-bottom));
  z-index: 30;
}
.actionbar-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--ink-700); font-size: var(--fs-xs); width: 52px;
}
.actionbar-icon svg { width: 22px; height: 22px; }
.actionbar-buy { flex: 1; height: 46px; font-size: var(--fs-lg); border-radius: var(--r-md); }
