body.donation-dialog-open {
  overflow: hidden;
}

.donation-ad {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9997;
  width: 116px;
  height: 116px;
  filter: drop-shadow(0 10px 20px rgba(15, 23, 42, 0.2));
}

.donation-ad-trigger {
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 20px;
  background: transparent;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.donation-ad-trigger:hover {
  transform: translateY(-4px) scale(1.02);
}

.donation-ad-trigger img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.donation-ad-close,
.donation-dialog-close {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: rgba(30, 30, 32, 0.82);
  color: #fff;
  font-family: Arial, sans-serif;
  cursor: pointer;
}

.donation-ad-close {
  position: absolute;
  top: -8px;
  right: -8px;
  z-index: 2;
  width: 26px;
  height: 26px;
  font-size: 18px;
  line-height: 24px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.donation-dialog {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.donation-dialog.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.donation-dialog-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 12, 20, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.donation-dialog-panel {
  position: relative;
  z-index: 1;
  width: min(820px, calc(100vw - 40px));
  max-height: calc(100vh - 50px);
  padding: 24px;
  overflow: auto;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.3);
  text-align: center;
  transform: translateY(14px) scale(0.97);
  transition: transform 0.22s ease;
}

.donation-dialog.is-open .donation-dialog-panel {
  transform: translateY(0) scale(1);
}

.donation-dialog-panel h2 {
  margin: 0 0 18px;
  color: #222;
  font-size: 22px;
}

.donation-dialog-layout {
  display: grid;
  align-items: start;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 24px;
}

.donation-dialog-copy,
.donation-dialog-code {
  min-width: 0;
}

.donation-dialog-code {
  overflow: hidden;
  border-radius: 12px;
  background: #1677ff;
}

.donation-dialog-intro {
  color: #62666d;
  text-align: left;
}

.donation-dialog-intro p {
  margin: 0 0 9px;
  font-size: 13px;
  line-height: 1.75;
}

.donation-dialog-intro strong {
  color: #25a942;
}

.donation-dialog-costs {
  margin: 17px 0;
  padding: 14px 16px;
  border: 1px solid #e7e9ed;
  border-radius: 12px;
  background: #f7f8fa;
  text-align: left;
}

.donation-dialog-costs h3 {
  margin: 0 0 10px;
  color: #333;
  font-size: 14px;
}

.donation-cost-row,
.donation-cost-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 28px;
  color: #666;
  font-size: 13px;
}

.donation-cost-row strong {
  color: #444;
}

.donation-cost-total {
  margin-top: 7px;
  padding-top: 9px;
  border-top: 1px dashed #d8dbe1;
  color: #333;
}

.donation-cost-total strong {
  color: #25a942;
  font-size: 14px;
}

.donation-dialog-hint {
  margin: 0 0 15px;
  color: #777;
  font-size: 12px;
  line-height: 1.7;
  text-align: left;
}

.donation-dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  font-size: 20px;
}

.donation-dialog-qrcode {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
  margin: 0 auto;
  border-radius: 12px;
}

body.theme-dark .donation-dialog-panel,
body.dark .donation-dialog-panel,
[data-theme="dark"] .donation-dialog-panel {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(30, 30, 32, 0.96);
}

body.theme-dark .donation-dialog-panel h2,
body.dark .donation-dialog-panel h2,
[data-theme="dark"] .donation-dialog-panel h2 {
  color: #eee;
}

body.theme-dark .donation-dialog-intro,
body.theme-dark .donation-dialog-hint,
body.dark .donation-dialog-intro,
body.dark .donation-dialog-hint,
[data-theme="dark"] .donation-dialog-intro,
[data-theme="dark"] .donation-dialog-hint {
  color: #bbb;
}

body.theme-dark .donation-dialog-costs,
body.dark .donation-dialog-costs,
[data-theme="dark"] .donation-dialog-costs {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
}

body.theme-dark .donation-dialog-costs h3,
body.theme-dark .donation-cost-total,
body.dark .donation-dialog-costs h3,
body.dark .donation-cost-total,
[data-theme="dark"] .donation-dialog-costs h3,
[data-theme="dark"] .donation-cost-total {
  color: #eee;
}

body.theme-dark .donation-cost-row,
body.dark .donation-cost-row,
[data-theme="dark"] .donation-cost-row {
  color: #bbb;
}

body.theme-dark .donation-cost-row strong,
body.dark .donation-cost-row strong,
[data-theme="dark"] .donation-cost-row strong {
  color: #ddd;
}

@media (prefers-color-scheme: dark) {
  body.auto-theme .donation-dialog-panel {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(30, 30, 32, 0.96);
  }

  body.auto-theme .donation-dialog-panel h2 {
    color: #eee;
  }

  body.auto-theme .donation-dialog-intro,
  body.auto-theme .donation-dialog-hint,
  body.auto-theme .donation-cost-row {
    color: #bbb;
  }

  body.auto-theme .donation-dialog-costs {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
  }

  body.auto-theme .donation-dialog-costs h3,
  body.auto-theme .donation-cost-total {
    color: #eee;
  }

  body.auto-theme .donation-cost-row strong {
    color: #ddd;
  }
}

@media (max-width: 700px) {
  .donation-ad {
    right: 14px;
    bottom: 14px;
    width: 104px;
    height: 104px;
  }

  .donation-dialog-panel {
    padding: 20px 16px 16px;
  }

  .donation-dialog-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .donation-dialog-code {
    max-width: 350px;
    margin: 0 auto;
  }
}
