/* 支持作者：浏览一分钟后的提示卡、收款码弹窗、支持页。配色沿用 site.css 的变量。 */

/* ---------- 底部提示卡 ---------- */
.cnm-sponsor-card {
  position: fixed;
  z-index: 70;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  max-width: 440px;
  margin: 0 auto;
  padding: 16px 16px 14px;
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 14px 44px rgba(23, 25, 31, 0.2);
  animation: cnm-sponsor-in 0.4s cubic-bezier(0.22, 0.7, 0.3, 1);
}
@keyframes cnm-sponsor-in {
  from { opacity: 0; transform: translateY(18px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cnm-sponsor-card, .cnm-qr-modal { animation: none; }
}
@media (min-width: 960px) {
  .cnm-sponsor-card {
    left: auto;
    right: 24px;
    bottom: 24px;
    margin: 0;
    width: 360px;
    max-width: 360px;
  }
}

.cnm-sponsor-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 34px;
  height: 34px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}
.cnm-sponsor-close:hover { background: var(--bg-muted); color: var(--text); }

.cnm-sponsor-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 30px;
  margin-bottom: 6px;
}
.cnm-sponsor-ico { width: 20px; height: 20px; flex: none; color: var(--brand); }
.cnm-sponsor-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.cnm-sponsor-text {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}
.cnm-sponsor-actions { display: flex; gap: 8px; }
.cnm-sponsor-actions button { flex: 1 1 0; }

/* ---------- 收款码弹窗 ---------- */
.cnm-qr-wrap {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px calc(16px + env(safe-area-inset-left, 0px)) calc(16px + env(safe-area-inset-bottom, 0px));
  background: rgba(10, 14, 20, 0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.cnm-qr-modal {
  position: relative;
  width: min(400px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  padding: 20px 18px 16px;
  background: var(--bg-elev);
  color: var(--text);
  border-radius: 18px;
  box-shadow: 0 18px 60px rgba(10, 14, 20, 0.35);
  animation: cnm-qr-pop 0.3s cubic-bezier(0.22, 0.7, 0.3, 1);
}
@keyframes cnm-qr-pop {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.cnm-qr-modal:focus { outline: none; }
.cnm-qr-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.cnm-qr-close:hover { background: var(--bg-muted); color: var(--text); }

.cnm-qr-title {
  margin: 0 24px 6px 0;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}
.cnm-qr-lead { margin: 0 0 14px; color: var(--muted); font-size: 0.92rem; line-height: 1.6; }

.cnm-qr-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 14px;
  background: var(--bg-muted);
  border-radius: 999px;
}
.cnm-qr-tab {
  flex: 1 1 0;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
  cursor: pointer;
}
.cnm-qr-tab:hover { background: transparent; color: var(--text); }
.cnm-qr-tab[aria-selected="true"] {
  background: var(--bg-elev);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(23, 25, 31, 0.12);
}
.cnm-qr-tab[aria-selected="true"]:hover { background: var(--bg-elev); }

.cnm-qr-fig {
  margin: 0;
  text-align: center;
}
.cnm-qr-fig img {
  display: block;
  width: 100%;
  max-width: 264px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.cnm-qr-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}
.cnm-qr-foot {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cnm-qr-foot button { width: 100%; }
.cnm-qr-note {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.84rem;
}

.cnm-scroll-lock { overflow: hidden; }
/* 提示卡露出来时，先把「添加到桌面」提示条让开，避免两块叠在一起 */
body.cnm-sponsor-open .pwa-bar { display: none; }

/* ---------- 支持页 ---------- */
.sponsor-page {
  max-width: 860px;
  margin: 0 auto;
  padding: 28px 18px 56px;
}
.sponsor-page h1 { margin: 0 0 10px; font-size: clamp(1.6rem, 4vw, 2.1rem); letter-spacing: -0.02em; }
.sponsor-page .sponsor-lede { margin: 0 0 24px; color: var(--muted); font-size: 1rem; line-height: 1.7; max-width: 62ch; }
.sponsor-page h2 { margin: 0 0 10px; font-size: 1.12rem; }

/* 先把话说清楚：免费、无需付款、赞赏不影响功能 */
.sponsor-free {
  padding: 16px 18px;
  margin: 0 0 28px;
  background: var(--brand-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.sponsor-free h2 { margin: 0 0 10px; font-size: 1.02rem; color: var(--brand-strong); }
.sponsor-free ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.sponsor-free li {
  position: relative;
  padding-left: 22px;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.6;
}
.sponsor-free li b { display: inline-block; margin-right: 6px; color: var(--brand-strong); }
.sponsor-free li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 10px;
  height: 6px;
  border-left: 2px solid var(--brand);
  border-bottom: 2px solid var(--brand);
  transform: rotate(-45deg);
}
.sponsor-free > p {
  margin: 12px 0 0;
  color: var(--brand-strong);
  font-size: 0.92rem;
  font-weight: 650;
}
/* 「赞赏解锁」这类词不拆行，换行只发生在词与词之间 */
.sponsor-free > p span { white-space: nowrap; }

.sponsor-uses {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.sponsor-uses li {
  padding: 14px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}
.sponsor-uses b { display: block; margin-bottom: 2px; color: var(--text); font-size: 0.98rem; }
@media (max-width: 639px) {
  .sponsor-uses { grid-template-columns: 1fr; }
}

.sponsor-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-bottom: 20px;
}
/* 只有一张收款码时居中，不要让卡片被拉成一整行 */
.sponsor-grid.is-single {
  grid-template-columns: minmax(0, 320px);
  justify-content: center;
}
.sponsor-pay {
  padding: 16px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
  box-shadow: var(--shadow);
}
.sponsor-pay h3 {
  margin: 0 0 10px;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sponsor-pay img {
  display: block;
  width: 100%;
  max-width: 240px;
  aspect-ratio: 520 / 600;
  object-fit: contain;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.sponsor-pay p { margin: 10px 0 0; color: var(--muted); font-size: 0.88rem; line-height: 1.55; }

.sponsor-note {
  padding: 14px 16px;
  background: var(--brand-soft);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.65;
}
.sponsor-note b { color: var(--brand-strong); }

@media print {
  .cnm-sponsor-card, .cnm-qr-wrap { display: none !important; }
}
