/* 赞助弹窗 / 支持本站 — 禅意精致 · 桌面/手机自适应 */
:root {
  --sp-ink: #1c1914;
  --sp-soft: #4a433a;
  --sp-muted: #7a7164;
  --sp-paper: #f8f4eb;
  --sp-paper2: #f0e8d8;
  --sp-gold: #8a734f;
  --sp-gold2: #c4a574;
  --sp-line: rgba(28, 25, 20, 0.1);
  --sp-mask: rgba(18, 14, 10, 0.52);
  --sp-radius: 18px;
  --sp-serif: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
}

.sp-mask {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: var(--sp-mask);
  backdrop-filter: blur(8px) saturate(1.05);
  -webkit-backdrop-filter: blur(8px) saturate(1.05);
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    max(0.75rem, env(safe-area-inset-top))
    max(0.75rem, env(safe-area-inset-right))
    max(0.75rem, env(safe-area-inset-bottom))
    max(0.75rem, env(safe-area-inset-left));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .3s ease, visibility .3s ease;
}
.sp-mask.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.sp-dialog {
  width: min(100%, 440px);
  max-height: min(88vh, 760px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background:
    radial-gradient(520px 220px at 50% -8%, rgba(196, 165, 116, 0.2), transparent 62%),
    linear-gradient(165deg, var(--sp-paper) 0%, var(--sp-paper2) 100%);
  color: var(--sp-ink);
  border: 1px solid rgba(138, 115, 79, 0.22);
  border-radius: var(--sp-radius);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.55) inset,
    0 28px 64px rgba(18, 14, 10, 0.32);
  font-family: var(--sp-serif);
  transform: translateY(18px) scale(0.985);
  opacity: 0.96;
  transition: transform .34s cubic-bezier(0.22, 1, 0.36, 1), opacity .34s ease;
}
.sp-mask.is-open .sp-dialog {
  transform: none;
  opacity: 1;
}
.sp-dialog--wide { width: min(100%, 500px); }

.sp-dialog-head {
  flex: 0 0 auto;
  padding: 1.35rem 1.35rem 0.85rem;
  text-align: center;
}
.sp-kicker {
  margin: 0 0 0.55rem;
  letter-spacing: 0.32em;
  text-indent: 0.32em;
  color: var(--sp-gold);
  font-size: 0.74rem;
}
.sp-title {
  margin: 0;
  font-size: clamp(1.12rem, 3.4vw, 1.32rem);
  font-weight: 600;
  letter-spacing: 0.05em;
  line-height: 1.5;
  padding: 0 0.25rem;
}
.sp-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin: 0.9rem auto 0;
  color: var(--sp-gold2);
  opacity: 0.85;
}
.sp-ornament::before,
.sp-ornament::after {
  content: "";
  width: 2.6rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(138, 115, 79, 0.55), transparent);
}
.sp-ornament span {
  width: 5px;
  height: 5px;
  border: 1px solid rgba(138, 115, 79, 0.65);
  border-radius: 50%;
  transform: rotate(45deg);
}

.sp-dialog-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0.35rem 1.35rem 0.4rem;
}
.sp-body {
  margin: 0 0 1.1rem;
  color: var(--sp-soft);
  font-size: 0.94rem;
  line-height: 1.82;
  letter-spacing: 0.02em;
  text-align: left;
  word-break: break-word;
}

.sp-plans {
  display: grid;
  gap: 0.7rem;
  margin: 0 0 0.85rem;
}
.sp-plan {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
  width: 100%;
  text-align: left;
  border: 1px solid var(--sp-line);
  background: rgba(255, 255, 255, 0.55);
  border-radius: 12px;
  padding: 0.9rem 0.95rem;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.sp-plan:hover {
  border-color: rgba(138, 115, 79, 0.4);
  background: rgba(255, 255, 255, 0.78);
}
.sp-plan.is-active {
  border-color: rgba(138, 115, 79, 0.7);
  background: rgba(184, 154, 100, 0.14);
  box-shadow: 0 0 0 1px rgba(138, 115, 79, 0.18);
}
.sp-plan-check {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.18rem;
  border-radius: 50%;
  border: 1.5px solid rgba(138, 115, 79, 0.45);
  position: relative;
  flex-shrink: 0;
}
.sp-plan.is-active .sp-plan-check {
  border-color: var(--sp-gold);
  background: var(--sp-gold);
}
.sp-plan.is-active .sp-plan-check::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #fff;
}
.sp-plan-amount {
  display: block;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--sp-ink);
  margin-bottom: 0.28rem;
  line-height: 1.35;
}
.sp-plan-desc {
  display: block;
  font-size: 0.84rem;
  line-height: 1.65;
  color: var(--sp-muted);
}

.sp-pay-panel {
  display: none;
  margin: 0 0 0.35rem;
  padding: 1rem 0.85rem 0.95rem;
  border: 1px solid rgba(138, 115, 79, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.42);
  text-align: center;
}
.sp-pay-panel.is-show { display: block; animation: spFade .28s ease; }
@keyframes spFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.sp-wait {
  margin: 0 0 0.9rem;
  color: var(--sp-gold);
  font-size: 0.88rem;
  letter-spacing: 0.03em;
  line-height: 1.7;
  padding: 0 0.2rem;
}
.sp-qr-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.85rem;
}
.sp-qr-row.is-single .sp-qr-card {
  flex: 0 1 auto;
  width: min(72vw, 210px);
  max-width: 210px;
}
.sp-qr-card {
  flex: 1 1 132px;
  max-width: 176px;
  min-width: 0;
}
.sp-qr-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--sp-line);
  border-radius: 10px;
  display: block;
  box-shadow: 0 8px 20px rgba(28, 25, 20, 0.06);
}
.sp-qr-label {
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  color: var(--sp-muted);
  letter-spacing: 0.14em;
}
.sp-dl-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.sp-dialog-foot {
  flex: 0 0 auto;
  padding: 0.85rem 1.35rem 1.2rem;
  background: linear-gradient(180deg, rgba(248, 244, 235, 0), rgba(248, 244, 235, 0.96) 28%, var(--sp-paper2));
  border-top: 1px solid rgba(28, 25, 20, 0.06);
}
.sp-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.sp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 1.15rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  cursor: pointer;
  transition: .2s ease;
  text-decoration: none;
  box-sizing: border-box;
  max-width: 100%;
  -webkit-tap-highlight-color: transparent;
}
.sp-btn-primary {
  background: var(--sp-ink);
  color: var(--sp-paper);
}
.sp-btn-primary:hover { background: var(--sp-gold); color: #fff; }
.sp-btn-ghost {
  background: rgba(255, 255, 255, 0.35);
  border-color: rgba(138, 115, 79, 0.4);
  color: var(--sp-soft);
  min-height: 2.35rem;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  padding: 0 0.9rem;
}
.sp-btn-ghost:hover {
  background: rgba(138, 115, 79, 0.1);
  color: var(--sp-ink);
}
.sp-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.sp-float {
  position: fixed;
  right: max(0.85rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 8500;
  border: 1px solid rgba(138, 115, 79, 0.38);
  background: rgba(248, 244, 235, 0.94);
  color: var(--sp-ink);
  border-radius: 999px;
  min-height: 2.55rem;
  padding: 0 1.1rem;
  font-family: var(--sp-serif);
  font-size: 0.86rem;
  letter-spacing: 0.14em;
  box-shadow: 0 12px 30px rgba(18, 14, 10, 0.14);
  cursor: pointer;
  transition: opacity .35s ease, transform .35s ease, visibility .35s ease, border-color .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.sp-float:hover {
  border-color: var(--sp-gold);
  color: var(--sp-gold);
}
.sp-float.is-dim {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  pointer-events: none;
}

@media (max-width: 640px) {
  .sp-mask {
    align-items: flex-end;
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 0;
    padding-top: max(0.5rem, env(safe-area-inset-top));
  }
  .sp-dialog,
  .sp-dialog--wide {
    width: 100%;
    max-height: min(92dvh, 92vh);
    border-radius: 18px 18px 0 0;
    border-bottom: 0;
  }
  .sp-dialog-head { padding: 1.15rem 1.1rem 0.7rem; }
  .sp-dialog-scroll { padding: 0.2rem 1.1rem 0.25rem; }
  .sp-dialog-foot {
    padding: 0.75rem 1.1rem calc(0.95rem + env(safe-area-inset-bottom));
  }
  .sp-title { font-size: 1.12rem; }
  .sp-body { font-size: 0.9rem; line-height: 1.78; }
  .sp-qr-row.is-single .sp-qr-card {
    width: min(58vw, 188px);
    max-width: 188px;
  }
  .sp-qr-card {
    flex-basis: calc(50% - 0.5rem);
    max-width: calc(50% - 0.5rem);
  }
  .sp-float {
    font-size: 0.82rem;
    letter-spacing: 0.1em;
    right: max(0.7rem, env(safe-area-inset-right));
    bottom: max(0.85rem, env(safe-area-inset-bottom));
  }
}

@media (min-width: 641px) and (max-height: 720px) {
  .sp-dialog { max-height: 92vh; }
  .sp-dialog-head { padding-top: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .sp-mask, .sp-dialog, .sp-float, .sp-pay-panel.is-show {
    transition: none !important;
    animation: none !important;
  }
}
