/* ============================================================
   微信礼包模块 —— games.94wan.cc
   配色沿用本站变量体系（--bg / --paper / --ink / --wine / --muted）
   ============================================================ */

/* ---------- 首屏 CTA：米金底 + 朱红跑马灯 ---------- */
.gift-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 20px;
  padding: 15px 20px;
  border-radius: 12px;
  text-decoration: none;
  --ant: #a8342a;
  background: #f4e7cd;
  position: relative;
  isolation: isolate;
  transition: background .18s;
}
.gift-cta:hover { background: #f0dfbe; }

/* 跑马灯蚂蚁线
   border-style:dashed 是离散值，浏览器无法做动画。
   用伪元素 + padding-box mask 抠出 2px 环，
   环里四向 repeating-linear-gradient 拼虚线，
   动画 background-position 推着虚线绕圈跑。
   坑：这个伪元素写 z-index:-1 会被 .gift-cta 自身背景整个盖住，
   必须 z-index:0 再把内容抬到 1（ht 那站已踩过同一个坑）。 */
.gift-cta::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 14px;
  padding: 2px;
  --seg: 9px;
  --gap: 7px;
  background:
    repeating-linear-gradient(90deg, var(--ant) 0 var(--seg), transparent var(--seg) calc(var(--seg) + var(--gap))),
    repeating-linear-gradient(90deg, var(--ant) 0 var(--seg), transparent var(--seg) calc(var(--seg) + var(--gap))),
    repeating-linear-gradient(0deg,  var(--ant) 0 var(--seg), transparent var(--seg) calc(var(--seg) + var(--gap))),
    repeating-linear-gradient(0deg,  var(--ant) 0 var(--seg), transparent var(--seg) calc(var(--seg) + var(--gap)));
  background-size: 100% 2px, 100% 2px, 2px 100%, 2px 100%;
  background-position: 0 0, 0 100%, 0 0, 100% 0;
  background-repeat: no-repeat;
  animation: giftAnts .9s linear infinite;
  pointer-events: none;
  z-index: 0;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask-composite: exclude;
}
@keyframes giftAnts {
  to { background-position: 16px 0, -16px 100%, 0 -16px, 100% 16px; }
}
.gift-cta > * { position: relative; z-index: 1; }

/* 不支持 mask 的老浏览器退回静态虚线，别让边框整个消失 */
@supports not ((mask: linear-gradient(#000 0 0)) or (-webkit-mask: linear-gradient(#000 0 0))) {
  .gift-cta { border: 2px dashed #a8342a; }
  .gift-cta::before { display: none; }
}

.gift-cta__ico {
  flex: none;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: #a8342a;
  color: #fff;
}
.gift-cta__ico svg { width: 27px; height: 27px; }
.gift-cta__text { min-width: 0; }
.gift-cta__title {
  display: block;
  font-size: 15px; font-weight: 700;
  color: #5a3a1a;
  line-height: 1.4;
}
.gift-cta__sub {
  display: block;
  font-size: 11.5px;
  color: #8a7350;
  margin-top: 2px;
}
.gift-cta__go {
  margin-left: auto; flex: none;
  display: flex; align-items: center; gap: 5px;
  color: #8f2a1f;
  font-size: 12px; font-weight: 600;
  white-space: nowrap;
}
.gift-cta__go svg { width: 15px; height: 15px; }

/* ---------- 底部二维码区 ---------- */
.gift-section {
  margin-top: 20px;
  margin-bottom: 90px;
  padding: 34px 32px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  /* 本站 header 不是 sticky，但仍留出余量，标题不被顶栏压住 */
  scroll-margin-top: 24px;
}
.gift-section__kick {
  font-size: 10.5px;
  letter-spacing: 2.4px;
  font-weight: 800;
  color: var(--wine);
  margin-bottom: 9px;
}
.gift-section__title {
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  font-size: 29px;
  line-height: 1.35;
  letter-spacing: 1px;
  margin: 0 0 10px;
  color: var(--ink);
}
.gift-section__title em { font-style: normal; color: var(--wine); }
.gift-section__lead {
  font-size: 14px;
  color: #5f5749;
  max-width: 620px;
  margin-bottom: 26px;
}
.gift-section__body {
  display: flex;
  gap: 32px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.gift-qr { flex: none; }
.gift-qr__frame {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px;
}
.gift-qr__press {
  position: relative;
  cursor: pointer;
  -webkit-touch-callout: default;
  -webkit-user-select: auto;
          user-select: auto;
  -webkit-tap-highlight-color: rgba(168, 52, 42, .1);
  touch-action: manipulation;
}
.gift-qr__img {
  display: block;
  width: 206px; height: 206px;
  /* 源图仅 130x130，像素化放大保住码点边缘，否则平滑插值会糊掉 */
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.gift-qr__hint {
  position: absolute;
  left: 50%; bottom: 7px;
  transform: translateX(-50%);
  font-size: 10.5px;
  color: var(--muted);
  background: rgba(255, 255, 255, .9);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 2px 9px;
  white-space: nowrap;
  pointer-events: none;
}
.gift-qr__note {
  margin-top: 12px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #5f5749;
}
.gift-steps {
  flex: 1;
  min-width: 250px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.gift-step { display: flex; gap: 13px; align-items: flex-start; }
.gift-step__no {
  flex: none;
  width: 25px; height: 25px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--wine);
  color: #fff;
  font-size: 12px; font-weight: 800;
  display: grid; place-items: center;
}
.gift-step__t { font-size: 14.5px; font-weight: 700; margin: 0 0 3px; color: var(--ink); }
.gift-step__d { font-size: 13px; color: var(--muted); line-height: 1.75; margin: 0; }
.gift-notes {
  margin-top: 26px;
  padding: 15px 19px;
  background: #f7f1e6;
  border-left: 3px solid var(--wine);
  border-radius: 0 8px 8px 0;
}
.gift-notes__t {
  font-family: "Songti SC", "STSong", serif;
  font-size: 15.5px;
  margin: 0 0 8px;
  color: var(--ink);
}
.gift-notes ul { margin: 0; padding-left: 18px; }
.gift-notes li { font-size: 12.5px; color: #5f5749; margin: 4px 0; }

/* ---------- 长按放大弹层 ---------- */
.gift-qr__mask {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 16, 12, .74);
  padding: 20px;
  animation: giftMaskIn .18s ease-out;
}
.gift-qr__mask[hidden] { display: none; }
@keyframes giftMaskIn { from { opacity: 0 } to { opacity: 1 } }
.gift-qr__panel {
  background: var(--paper);
  border-radius: 16px;
  padding: 26px 22px 20px;
  text-align: center;
  max-width: 100%;
  max-height: 92vh;
  overflow: auto;
}
.gift-qr__big {
  display: block;
  width: min(320px, 74vw);
  height: auto;
  margin: 0 auto 16px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 8px;
  /* 大图也保留原生长按菜单，微信里可直接识别 */
  -webkit-touch-callout: default;
  -webkit-user-select: auto;
          user-select: auto;
}
.gift-qr__tip {
  font-size: 13px;
  color: #5f5749;
  line-height: 1.75;
  margin: 0 0 14px;
}
.gift-qr__close {
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  background: var(--wine);
  border: 0;
  border-radius: 8px;
  padding: 9px 30px;
  cursor: pointer;
}
.gift-qr__close:hover { background: #8f2a1f; }

/* ---------- 下载说明分两层 ----------
   原来「怎么下」和「核对版号」挤在同一行同色，
   var(--muted) #767d79 on var(--paper) 只有 4.3:1，手机户外看不清。
   拆开：操作说明放大加深（关键动作标红），合规声明单独一行、更小更淡。 */
.dl-note-box { margin-top: 14px; }
.dl-note {
  font-size: 13.5px;
  line-height: 1.9;
  color: #3a3228;
  margin: 0;
  letter-spacing: .1px;
}
.dl-note b { font-weight: 700; color: #8f2a1f; }
.dl-legal {
  margin: 7px 0 0;
  display: flex;
  align-items: flex-start;
  gap: 5px;
  font-size: 11.5px;
  line-height: 1.75;
  color: #8a8074;
}
.dl-legal svg { flex: none; width: 12px; height: 12px; margin-top: 3px; }

/* ---------- 响应式 ---------- */
@media (max-width: 800px) {
  .gift-cta { align-items: flex-start; gap: 12px; padding: 14px 15px; }
  .gift-cta__title { font-size: 14px; }
  .gift-cta__gotext { display: none; }
  .gift-section { padding: 26px 20px; margin-bottom: 64px; }
  .gift-section__title { font-size: 23px; }
  .gift-section__body { gap: 22px; }
  .gift-qr__img { width: 180px; height: 180px; }
}

/* 减弱动态：蚂蚁线停住（虚线保留），弹层不淡入 */
@media (prefers-reduced-motion: reduce) {
  .gift-cta::before {
    animation: none;
    background-position: 0 0, 0 100%, 0 0, 100% 0;
  }
  .gift-qr__mask { animation: none; }
}
