/* ======================================
   关投强 - 文章详情页底部「点赞 / 分享」
   用于 news-detail.html / news-guide.html / news-api.html
   --------------------------------------------------
   ⚠ 为什么独立成文件，而不是追加进 news.css：
      news.css 由 tools/_retheme.py 生成，直接改它会在重跑该脚本时丢失。
      本文件是**手写真源**，不被任何生成器覆盖。
   ⚠ 颜色一律走 common.css 的 --c-* 令牌，**不写内联色**
      （news-detail.html 会被 _retheme.py 扫内联色替换）。
   ⚠ 图标在 HTML 里是内联 SVG + currentColor，**不要换回 emoji**。
   ⚠ 浅色区块的对比度没有核验脚本兜底（_verify_dark 只扫深色块），
      改动配色后请按 WCAG 手算一遍：#0052D9 on #FFFFFF ≈ 5.4:1（达 AA 正文 4.5:1）。
   ====================================== */

/* ---------- 操作条 ---------- */
.article-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--c-line);
}

.aa-label {
  font-size: 13px;
  color: var(--c-text-mute);
}

.aa-sep {
  width: 1px;
  height: 20px;
  background: var(--c-line);
  margin: 0 4px;
}

.aa-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--c-line);
  border-radius: 999px;
  background: #fff;
  color: var(--c-text-sub);
  font-family: inherit;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color .18s, border-color .18s, background-color .18s;
}

.aa-btn svg {
  width: 17px;
  height: 17px;
  flex: none;
  display: block;
}

.aa-btn:hover {
  color: var(--c-primary);
  border-color: var(--c-primary);
  background: var(--c-primary-light);
}

.aa-btn:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

/* 点赞激活态：品牌蓝 + 图标转实心。⚠ 不显示任何数量（无后端，显示数字等于伪造数据） */
.aa-btn-like[aria-pressed="true"] {
  color: var(--c-primary);
  border-color: var(--c-primary);
  background: var(--c-primary-light);
}

.aa-btn-like[aria-pressed="true"] svg {
  fill: currentColor;
}

/* ---------- 轻提示 ---------- */
.aa-toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  z-index: 99999;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(10, 26, 54, .92);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  opacity: 0;
  transform: translateX(-50%) translateY(8px);
  pointer-events: none;
  transition: opacity .22s, transform .22s;
}

.aa-toast.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- 分享弹窗 ---------- */
.aa-modal {
  position: fixed;
  inset: 0;
  z-index: 99998;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(10, 26, 54, .58);
}

.aa-modal.is-open {
  display: flex;
}

.aa-card {
  width: 100%;
  max-width: 340px;
  padding: 26px 24px 20px;
  border-radius: 18px;
  background: #fff;
  text-align: center;
  box-shadow: 0 20px 60px rgba(10, 26, 54, .3);
  animation: aa-pop .22s ease-out;
}

@keyframes aa-pop {
  from { opacity: 0; transform: scale(.94); }
  to   { opacity: 1; transform: scale(1); }
}

.aa-card h3 {
  margin-bottom: 6px;
  font-size: 17px;
  color: var(--c-text);
}

.aa-card .aa-hint {
  font-size: 13px;
  color: var(--c-text-sub);
  line-height: 1.7;
}

.aa-card .aa-hint b {
  color: var(--c-primary);
}

.aa-qr {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 178px;
  height: 178px;
  margin: 16px auto 12px;
  padding: 6px;
  border: 1px solid var(--c-line);
  border-radius: var(--radius-md);
  background: #fff;
}

.aa-qr[hidden] {
  display: none;
}

.aa-qr canvas {
  display: block;
  /* ⚠⚠ 必须按 canvas 自身像素显示（auto），**绝不能写 width:100%**。
     容器内容区是 164px，而 canvas 是 148px（37 模块 × 4px），
     写 100% 会把 148 拉到 164 —— 1.108 倍**非整数缩放**，
     模块边界被重采样成 1px / 2px 不等宽：图案看着完全正常，**扫码器却解不出来**
     （实测 zxing-cpp 识别失败，是这个组件最隐蔽的坑）。
     别指望 image-rendering:pixelated 兜底 —— 它只保证"不插值"，不保证"等宽"。 */
  width: auto;
  height: auto;
  image-rendering: pixelated;
}

.aa-url {
  margin-top: 4px;
  font-size: 12px;
  color: var(--c-text-mute);
  word-break: break-all;
}

.aa-close {
  width: 100%;
  height: 42px;
  margin-top: 16px;
  border: 0;
  border-radius: 999px;
  background: var(--c-bg-soft);
  color: var(--c-text-sub);
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
  transition: background-color .18s, color .18s;
}

.aa-close:hover {
  background: var(--c-primary-light);
  color: var(--c-primary);
}

/* ---------- 窄屏 ---------- */
@media (max-width: 480px) {
  .article-actions {
    gap: 8px;
    margin-top: 32px;
    padding-top: 22px;
  }

  .aa-btn {
    height: 36px;
    padding: 0 13px;
    font-size: 13px;
  }

  .aa-sep {
    display: none;
  }

  .aa-label {
    width: 100%;
    margin-bottom: 2px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .aa-card { animation: none; }
  .aa-btn, .aa-toast, .aa-close { transition: none; }
}
