
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0a0a0f;
  --card-bg: rgba(255,255,255,0.04);
  --card-border: rgba(255,255,255,0.08);
  --text: #e4e4e7;
  --text-dim: #71717a;
  --text-muted: #52525b;
  --accent: #a78bfa;
  --accent2: #f472b6;
  --accent3: #38bdf8;
  --danger: #f43f5e;
  --success: #34d399;
  --radius: 20px;
  --radius-sm: 12px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  min-height: 100vh;
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

#bgCanvas {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}

.orb {
  position: fixed; border-radius: 50%; filter: blur(100px);
  opacity: 0.35; z-index: 0; pointer-events: none;
  animation: float 20s ease-in-out infinite;
}
.orb-1 { width: 500px; height: 500px; background: var(--accent); top: -10%; left: -10%; }
.orb-2 { width: 400px; height: 400px; background: var(--accent2); bottom: -10%; right: -10%; animation-delay: -7s; }
.orb-3 { width: 300px; height: 300px; background: var(--accent3); top: 50%; left: 50%; animation-delay: -13s; }

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(60px, -40px) scale(1.05); }
  66% { transform: translate(-30px, 50px) scale(0.95); }
}

.container {
  position: relative; z-index: 1;
  max-width: 960px; margin: 0 auto;
  padding: 40px 16px 60px;
}

.layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}

.col-left, .col-right { min-width: 0; }

.col-right { position: relative; }

.col-right .wall-card {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 16px;
  margin-bottom: 0;
  display: flex; flex-direction: column;
}

.wall-card #donationWall {
  position: relative;
  flex: 1;
  overflow-y: auto;
}

header { text-align: center; margin-bottom: 32px; }

.logo { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 12px; }

.logo-icon {
  width: 44px; height: 44px; border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 4px 24px rgba(167,139,250,0.3);
}

.title {
  font-size: 40px; font-weight: 900; letter-spacing: -1px;
  background: linear-gradient(135deg, #fff 0%, var(--accent) 50%, var(--accent2) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle { color: var(--text-dim); font-size: 14px; font-weight: 500; }

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 16px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  transition: border-color 0.3s, box-shadow 0.3s;
}

.card:hover {
  border-color: rgba(255,255,255,0.12);
  box-shadow: 0 8px 40px rgba(0,0,0,0.2);
}

.section-label {
  font-size: 18px; font-weight: 800; color: var(--text);
  text-align: center; letter-spacing: 1px;
  display: block; margin-bottom: 35px;
}

.amount-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-bottom: 14px;
}

.amount-btn {
  padding: 12px 6px 10px; border: 1.5px solid var(--card-border);
  border-radius: var(--radius-sm); background: transparent;
  cursor: pointer; transition: all 0.25s;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  position: relative; overflow: hidden;
}

.tier-chip {
  width: 42px; height: 42px; border-radius: 10px;
  background: transparent; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.tier-chip img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tier-chip.emoji { font-size: 24px; line-height: 1; }
.tier-name { font-size: 12px; font-weight: 600; color: var(--text); letter-spacing: 0.5px; }
.tier-price {
  position: absolute; top: 7px; right: 7px;
  font-size: 11px; font-weight: 700; color: #fff; line-height: 1;
  padding: 3px 8px; border-radius: 999px;
  background: linear-gradient(135deg, #f472b6, #e11d48);
}
.tier-price.free { background: linear-gradient(135deg, #fb923c, #e11d48); }

.amount-btn:hover {
  border-color: var(--accent);
  background: rgba(167,139,250,0.08);
  transform: translateY(-1px);
}

.amount-btn.active {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(167,139,250,0.2), rgba(244,114,182,0.2));
  color: #fff;
  box-shadow: 0 0 20px rgba(167,139,250,0.15);
}

.info-section { margin: 20px 0; display: flex; flex-direction: column; gap: 10px; }

.input-wrap {
  display: flex; align-items: center;
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-sm);
  overflow: hidden; transition: all 0.25s;
  background: rgba(255,255,255,0.02);
}

.input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(167,139,250,0.12);
}

.input-icon {
  flex-shrink: 0; padding: 0 0 0 14px; color: var(--text-muted);
}

.input-wrap input {
  flex: 1; border: none; outline: none; background: transparent;
  padding: 13px 14px; font-size: 14px; color: var(--text);
  font-family: inherit;
}

.input-wrap input::placeholder { color: var(--text-muted); }

.pay-btn {
  width: 100%; padding: 16px 24px; border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff; font-size: 16px; font-weight: 700;
  font-family: inherit; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all 0.3s; position: relative; overflow: hidden;
}

.pay-btn::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--accent2), var(--accent3));
  opacity: 0; transition: opacity 0.4s;
}

.pay-btn:hover::before { opacity: 1; }

.pay-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 30px rgba(167,139,250,0.35);
}

.pay-btn:active { transform: translateY(0) scale(0.98); }

.pay-btn-text, .pay-btn-arrow { position: relative; z-index: 1; }
.pay-btn-arrow { transition: transform 0.3s; }
.pay-btn:hover .pay-btn-arrow { transform: translateX(4px); }

.qr-header {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; margin-bottom: 20px;
  font-size: 15px; font-weight: 600; color: var(--text);
}

.status-dot {
  width: 10px; height: 10px; border-radius: 50%;
  display: inline-block;
}

.status-dot.pending {
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: pulse 1.5s ease-in-out infinite;
}

.status-dot.success {
  background: var(--success);
  box-shadow: 0 0 12px var(--success);
}

@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 12px var(--accent); }
  50% { opacity: 0.5; box-shadow: 0 0 4px var(--accent); }
}

.qr-body { position: relative; display: flex; justify-content: center; }

.qr-glow {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 200px; height: 200px; border-radius: 50%;
  background: radial-gradient(circle, rgba(167,139,250,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.qr-wrapper {
  background: #fff; border-radius: 16px; padding: 12px;
  box-shadow: 0 0 40px rgba(167,139,250,0.12);
  position: relative;
}

.qr-wrapper img { width: 200px; height: 200px; border-radius: 8px; display: block; }

.qr-amount {
  text-align: center; font-size: 32px; font-weight: 900;
  background: linear-gradient(135deg, var(--accent2), var(--danger));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin: 20px 0 4px;
}

.qr-hint {
  text-align: center; color: var(--text-dim); font-size: 13px;
}

.alipay-link {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 14px; color: var(--accent3); font-size: 14px;
  text-decoration: none; font-weight: 600; transition: color 0.2s;
}
.alipay-link:hover { color: var(--accent); }

.cancel-btn {
  width: 100%; padding: 12px; margin-top: 16px;
  border: 1.5px solid var(--card-border); border-radius: var(--radius-sm);
  background: transparent; color: var(--text-dim);
  font-size: 14px; font-family: inherit; cursor: pointer;
  transition: all 0.25s;
}
.cancel-btn:hover { border-color: rgba(255,255,255,0.2); color: var(--text); }

.success-card { text-align: center; }

.success-icon {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--success), #059669);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 20px; color: #fff;
  box-shadow: 0 0 40px rgba(52,211,153,0.25);
  animation: successPop 0.5s cubic-bezier(0.175,0.885,0.32,1.275);
}

@keyframes successPop {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

.success-card h2 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }

.success-amount {
  font-size: 36px; font-weight: 900;
  background: linear-gradient(135deg, var(--success), var(--accent));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin: 12px 0;
}

.success-msg { color: var(--text-dim); margin-bottom: 20px; font-size: 14px; }

.error-card { text-align: center; }

.error-icon {
  width: 56px; height: 56px;
  background: rgba(244,63,94,0.15); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px; color: var(--danger);
}

.error-text { color: var(--danger); margin-bottom: 20px; font-size: 14px; }

.wall-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 26px; color: var(--accent);
}
.wall-header h2 { font-size: 18px; font-weight: 800; color: var(--text); }

.donation-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  animation: fadeSlideIn 0.4s ease-out;
}

.donation-item:last-child { border-bottom: none; }

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.donation-item .left { display: flex; flex-direction: column; gap: 8px; }

.donation-item .name {
  font-weight: 600; font-size: 14px; color: var(--text);
}

.donation-item .msg {
  font-size: 12px; color: var(--text-dim);
}

.donation-item .right-col { text-align: right; }

.d-icon {
  width: 30px; height: 30px; object-fit: contain;
  display: block; margin: 0 auto;
}
.d-icon.emoji {
  font-size: 26px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}

.donation-item .time {
  font-size: 11px; color: var(--text-muted); margin-top: 6px;
}

.empty-hint {
  text-align: center; color: var(--text-muted);
  padding: 28px 0; font-size: 14px;
}

.history-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 35px; color: var(--accent);
}

.history-header h2 { font-size: 18px; font-weight: 800; color: var(--text); }

.history-count {
  margin-left: auto;
  font-size: 12px; color: #fff;
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(220, 38, 38, 0.3);
  padding: 4px 10px; border-radius: 999px;
}

.history-count b { color: #ef4444; font-size: 14px; font-weight: 800; }

.history-list {
  display: flex; flex-wrap: wrap; gap: 8px;
  
  max-height: 480px;
  overflow-y: auto;
}

.history-chip {
  font-size: 12px; color: #fff;
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(220, 38, 38, 0.28);
  padding: 6px 12px; border-radius: 999px;
  animation: fadeSlideIn 0.4s ease-out;
}

.history-empty {
  color: var(--text-muted); font-size: 13px; padding: 8px 0;
}

.history-more-wrap {
  flex-basis: 100%;
  display: flex; justify-content: center;
  margin-top: 24px;
}

.history-more {
  font-size: 13px; color: #ef4444; font-weight: 600;
  background: rgba(220, 38, 38, 0.12);
  border: 1px dashed rgba(220, 38, 38, 0.4);
  padding: 10px 32px; border-radius: 999px;
  cursor: pointer; transition: background 0.2s, border-color 0.2s;
}

.history-more:hover {
  background: rgba(220, 38, 38, 0.25);
  border-color: rgba(220, 38, 38, 0.7);
}

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(10,10,15,0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  z-index: 900; padding: 16px;
  animation: modalFade 0.25s ease-out;
}

@keyframes modalFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  width: 100%; max-width: 380px;
  animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-content .card { margin-bottom: 0; }

@media (min-width: 769px) {
  .modal-overlay {
    align-items: flex-start;
    padding-top: 250px;
    overflow-y: auto;
  }
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.9) translateY(16px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(10,10,15,0.7);
  backdrop-filter: blur(8px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 999; color: var(--text);
}

.spinner {
  width: 44px; height: 44px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin { to { transform: rotate(360deg); } }

footer {
  text-align: center; color: var(--text-muted);
  font-size: 12px; margin-top: 32px;
}

@media (max-width: 480px) {
  .container { padding: 24px 12px 40px; }
  .title { font-size: 34px; }
  .amount-grid { gap: 8px; }
  .amount-btn { padding: 10px 4px 8px; }
  .tier-chip { width: 34px; height: 34px; border-radius: 8px; }
  .tier-chip.emoji { font-size: 20px; }
  .tier-name { font-size: 11px; }
  .tier-price { font-size: 10px; top: 5px; right: 5px; padding: 2px 6px; }
  .card { padding: 22px; }
}

@media (max-width: 768px) {
  .layout { grid-template-columns: 1fr; }
  .col-right { position: static; }
  .col-right .wall-card { position: static; bottom: auto; margin-bottom: 16px; }
  .wall-card #donationWall { max-height: none; }
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

.pay-tabs {
  display: flex; gap: 8px; margin-bottom: 18px;
}
.pay-tab {
  flex: 1; padding: 10px 6px; font-size: 13px; font-weight: 600;
  color: var(--text-dim); background: rgba(255,255,255,0.04);
  border: 1px solid var(--card-border); border-radius: 10px;
  cursor: pointer; transition: all .2s ease; font-family: inherit;
}
.pay-tab:hover { color: var(--text); background: rgba(255,255,255,0.08); }
.pay-tab.active {
  color: #fff; background: linear-gradient(135deg, #ef4444, #e11d48);
  border-color: transparent;
}

.qr-wrapper.static img {
  width: 230px; height: 230px; object-fit: contain;
  background: #fff; border-radius: var(--radius-sm);
}
.qr-note {
  font-size: 12px; color: var(--text-muted);
  margin-top: 8px; margin-bottom: 14px;
  text-align: center;
}
