/* ============ 收藏按钮（商品/资讯/AI工具详情页通用） ============ */
.fav-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  line-height: 1;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #d6dde6;
  background: #fff;
  color: #5a6677;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s ease;
  user-select: none;
  vertical-align: middle;
}
.fav-btn:hover {
  border-color: #f59e0b;
  color: #b45309;
}
.fav-btn .fav-ico {
  font-size: 16px;
  line-height: 1;
  color: #c0c9d4;
  transition: color .15s ease;
  font-style: normal;
}
.fav-btn .fav-txt { font-size: 13px; }
/* 已收藏态 */
.fav-btn.on {
  border-color: #fbbf24;
  background: #fffbeb;
  color: #b45309;
}
.fav-btn.on .fav-ico {
  color: #f59e0b;
}
/* 加载中 / 禁用 */
.fav-btn.loading { opacity: .6; pointer-events: none; }

/* ---------- 嵌入场景适配 ---------- */
/* 详情页标题行 / 资讯 meta 行：紧凑版 */
.fav-btn.fav-inline { padding: 6px 12px; font-size: 12px; }
/* 已收藏（星标高亮） */
.fav-btn.on .fav-ico { color: #f59e0b; }
.fav-btn .fav-ico { font-style: normal; }
/* 商品详情页：收藏按钮行（紧跟库存行） */
.fav-holder { margin: -4px 0 14px; }
.fav-holder .fav-btn { padding: 6px 14px; font-size: 13px; }

/* ---------- 详情页操作按钮：复制 / 微信二维码 ---------- */
/* 复用 .fav-btn 外观，但 hover 走蓝色调，区分收藏 toggle */
.fav-btn.fav-act {
  border-color: #d6dde6;
  color: #5a6677;
}
.fav-btn.fav-act:hover {
  border-color: #93c5fd;
  color: #1d4ed8;
  background: #eff6ff;
}
.fav-btn.fav-act .fav-ico { color: #94a3b8; }
.fav-btn.fav-act:hover .fav-ico { color: #1d4ed8; }
/* 复制成功瞬时态 */
.fav-btn.fav-act.ok {
  border-color: #86efac;
  color: #15803d;
  background: #f0fdf4;
}
.fav-btn.fav-act.ok .fav-ico { color: #15803d; }

/* 操作按钮容器（横排时与收藏按钮一行；窄屏允许换行） */
.fav-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* ---------- 微信二维码弹层（详情页通用，与收藏页一致） ---------- */
.fav-qr-modal {
  position: fixed;
  left: 0; top: 0; right: 0; bottom: 0;
  z-index: 2147483000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.fav-qr-modal.is-open { display: flex; }
.fav-qr-mask {
  position: absolute;
  left: 0; top: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, .55);
}
.fav-qr-box {
  position: relative;
  width: min(360px, 100%);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(8, 18, 48, .4);
  overflow: hidden;
}
.fav-qr-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #eef2f7;
}
.fav-qr-title { font-size: 15px; font-weight: 600; color: #0f172a; }
.fav-qr-x {
  width: 30px; height: 30px; padding: 0; line-height: 1;
  background: transparent; border: 0; border-radius: 6px;
  font-size: 22px; color: #94a3b8; cursor: pointer;
  transition: background .15s, color .15s;
}
.fav-qr-x:hover { background: #f1f5f9; color: #0f172a; }
.fav-qr-body { padding: 22px 20px 20px; text-align: center; }
.fav-qr-img {
  width: 168px; height: 168px;
  margin: 0 auto 14px;
  padding: 10px;
  border: 1px solid #eef2f7;
  border-radius: 10px;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
}
.fav-qr-img img, .fav-qr-img canvas { display: block; }
.fav-qr-name {
  font-size: 14px; font-weight: 600; color: #0f172a;
  line-height: 1.5; word-break: break-all;
}
.fav-qr-tip { margin-top: 8px; font-size: 12px; color: #94a3b8; line-height: 1.7; }
.fav-qr-link {
  display: inline-block;
  margin-top: 10px;
  max-width: 100%;
  font-size: 12px;
  color: #2563eb;
  text-decoration: none;
  word-break: break-all;
  line-height: 1.6;
}
.fav-qr-link:hover { text-decoration: underline; }

/* ---------- 复制成功轻提示 ---------- */
.fav-toast {
  position: fixed;
  left: 50%; bottom: 60px;
  transform: translateX(-50%) translateY(8px);
  z-index: 2147483001;
  padding: 9px 18px;
  border-radius: 8px;
  background: rgba(15, 23, 42, .88);
  color: #fff;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  max-width: 80vw;
}
.fav-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 窄屏适配 ---------- */
@media (max-width: 640px) {
  .fav-actions { gap: 4px; }
  .fav-actions .fav-btn { padding: 6px 10px; font-size: 12px; }
  .fav-actions .fav-btn .fav-txt { display: none; }
}

/* ============ 三图标横排（新设计 fav.png） ============ */
.fav-icons {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin: -2px 0 12px;
  padding: 2px 0;
}
.fav-icon-btn {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 8px;
  margin: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  color: #5a6677;
  border-radius: 10px;
  transition: color .15s, background .15s, transform .1s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.fav-icon-btn:hover {
  color: #2563eb;
  background: rgba(37, 99, 235, .08);
}
.fav-icon-btn:active { transform: scale(.92); }
.fav-icon-btn:focus { outline: none; }
.fav-icon-btn:focus-visible {
  outline: 2px solid rgba(245, 158, 11, .35);
  outline-offset: 2px;
}
.fav-icon-btn svg {
  width: 30px;
  height: 30px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: fill .15s, stroke .15s;
}
/* 已收藏态（CSS 控制 svg fill，不动 innerHTML） */
.fav-icon-btn.fav-btn-icon.on {
  color: #d97706;
}
.fav-icon-btn.fav-btn-icon.on svg {
  fill: #fbbf24;
  stroke: #d97706;
}
/* 复制成功瞬时态 */
.fav-icon-btn.fav-act.ok {
  color: #15803d;
  background: rgba(21, 128, 61, .08);
}
.fav-icon-btn.fav-act.ok svg { stroke: #15803d; fill: #15803d; }
/* 中间竖线分隔 */
.fav-icons .fav-icon-sep {
  display: inline-block;
  width: 1px;
  height: 30px;
  background: #d6dde6;
  margin: 0 2px;
  flex: 0 0 auto;
}

/* 紧凑版（资讯 meta 行内嵌） */
.fav-icons.fav-icons-inline {
  margin: 0 0 0 4px;
}
.fav-icons.fav-icons-inline .fav-icon-btn {
  width: 38px; height: 38px; padding: 6px;
}
.fav-icons.fav-icons-inline .fav-icon-btn svg { width: 22px; height: 22px; }
.fav-icons.fav-icons-inline .fav-icon-sep { height: 22px; }

/* 窄屏适配（新设计） */
@media (max-width: 640px) {
  .fav-icons .fav-icon-btn { width: 44px; height: 44px; padding: 6px; }
  .fav-icons .fav-icon-btn svg { width: 26px; height: 26px; }
  .fav-icons .fav-icon-sep { height: 24px; }
}
