:root {
  --bg: #f6faff;
  --card: rgba(255, 255, 255, .72);
  --line: rgba(34, 42, 68, .12);
  --text: #1f2743;
  --muted: rgba(31, 39, 67, .62);
  --blue: #5b7cfa;
  --pink: #ff5d8f;
  --gold: #f2a94b;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(circle at 8% 10%, rgba(135, 216, 238, .24), transparent 34%),
    radial-gradient(circle at 92% 8%, rgba(198, 194, 255, .20), transparent 36%),
    radial-gradient(circle at 50% 98%, rgba(255, 214, 208, .22), transparent 40%),
    var(--bg);
}

.shell { max-width: 1180px; margin: 0 auto; padding: clamp(38px, 4.5vw, 56px) clamp(16px, 2.2vw, 24px) clamp(54px, 7vw, 80px); transition: padding .35s cubic-bezier(.22,.61,.36,1); }
.hero { text-align: center; margin-bottom: clamp(28px, 4vw, 36px); }
.eyebrow { font-size: clamp(11px, 1vw, 12px); letter-spacing: .4em; color: #4fa8c7; margin: 0 0 clamp(14px, 2vw, 18px); }
h1 { font-size: clamp(38px, 7vw, 82px); line-height: 1; margin: 0; color: var(--text); }
h1 span { display: block; background: linear-gradient(90deg, #79d7c4, #66a7ff 45%, #ff9fae); -webkit-background-clip: text; color: transparent; }
.lead { max-width: min(640px, 100%); margin: clamp(18px, 2.4vw, 22px) auto 0; color: var(--muted); font-size: clamp(15px, 1.4vw, 17px); line-height: 1.8; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(8px, 1.2vw, 12px); max-width: min(560px, 100%); margin: clamp(30px, 4vw, 40px) auto 0; }
.stats > div { padding: clamp(13px, 1.6vw, 16px); border: 1px solid var(--line); border-radius: clamp(15px, 1.8vw, 18px); background: var(--card); backdrop-filter: blur(10px); box-shadow: 0 10px 26px rgba(70, 70, 70, .07); }
.stats strong { display: block; font-size: clamp(20px, 2vw, 24px); }
.stats span { color: var(--muted); font-size: clamp(11px, 1vw, 12px); }

.wall-card { padding: clamp(16px, 2.2vw, 24px); border: 1px solid rgba(255,255,255,.9); border-radius: clamp(24px, 3vw, 32px); background: rgba(255,255,255,.78); box-shadow: 0 18px 50px rgba(70, 70, 70, .08); transition: padding .35s cubic-bezier(.22,.61,.36,1), border-radius .35s cubic-bezier(.22,.61,.36,1); }
.wall-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.wall-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.ghost-button { min-width: 64px; height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: rgba(255,255,255,.8); font-size: 13px; cursor: pointer; }
.ghost-button:hover { border-color: rgba(118,165,255,.55); }
.wall-card:fullscreen { padding: 24px; background: #fff; }
.wall-card:fullscreen .canvas-wrap { width: min(100%, calc(100vh - 140px)); }
.wall-head h2 { margin: 0; font-size: 24px; }
.zoom-actions { display: flex; align-items: center; gap: 8px; }
.canvas-wrap { display: grid; place-items: center; width: 100%; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 20px; background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(235,249,255,.75)); touch-action: none; }
.wall-tooltip {
  position: fixed;
  z-index: 60;
  max-width: min(300px, calc(100vw - 40px));
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 14px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
  background: rgba(255,255,255,.96);
  box-shadow: 0 16px 38px rgba(104,116,160,.18);
  pointer-events: none;
  backdrop-filter: blur(12px);
}
.wall-tooltip-image { width: 100%; max-height: 140px; object-fit: cover; border-radius: 10px; margin-bottom: 8px; }
.wall-tooltip-text { margin: 0; }
#wall { display: block; width: 100%; height: 100%; image-rendering: auto; cursor: pointer; transform-origin: center center; transition: transform .25s cubic-bezier(.22,.61,.36,1); will-change: transform; }

.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(79, 94, 125, .28); backdrop-filter: blur(16px); }
.modal.hidden, .hidden { display: none !important; }
.modal-card { position: relative; width: min(420px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 28px 24px 24px; border: 1px solid rgba(255,255,255,.85); border-radius: 24px; background: #fff; box-shadow: 0 24px 64px rgba(34,42,67,.18); }
.close { position: sticky; top: 0; z-index: 2; display: block; margin: 0 0 8px auto; width: 32px; height: 32px; border: 0; border-radius: 50%; color: #fff; background: rgba(31,39,67,.75); font-size: 20px; cursor: pointer; }
h3 { margin: 0 0 22px; font-size: 22px; }
.field { display: block; margin-bottom: 16px; }
.field span { display: block; margin-bottom: 8px; color: var(--muted); font-size: 13px; }
input { width: 100%; height: 48px; padding: 0 16px; color: var(--text); background: rgba(248,250,255,.9); border: 1px solid var(--line); border-radius: 14px; outline: none; }
input:focus { border-color: rgba(91,124,250,.75); box-shadow: 0 0 0 4px rgba(91,124,250,.14); }
.toolbar { display: flex; gap: 6px; margin-bottom: 8px; }
.toolbar button { min-width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: #fff; cursor: pointer; }
.toolbar button:hover { background: #eef4ff; }
.rich-input { min-height: 150px; max-height: 300px; overflow-y: auto; padding: 14px 16px; color: var(--text); background: rgba(248,250,255,.94); border: 1px solid var(--line); border-radius: 14px; outline: none; line-height: 1.7; }
.rich-input:focus { border-color: rgba(91,124,250,.75); box-shadow: 0 0 0 4px rgba(91,124,250,.14); }
.rich-input:empty::before { color: rgba(31,39,67,.38); content: attr(data-placeholder); }
.rich-input a { color: #3d8bff; }
.rich-input pre, .rich-input code { color: #b96b20; font-family: ui-monospace, SFMono-Regular, monospace; }
.field span small { float: right; color: var(--muted); }
.upload input { display: none; }
.upload-box { display: grid; place-items: center; gap: 5px; min-height: 120px; padding: 20px; border: 1px dashed rgba(90,110,165,.3); border-radius: 18px; background: rgba(244,248,255,.75); cursor: pointer; }
.preview { width: 100%; max-height: 200px; object-fit: cover; border-radius: 16px; margin-bottom: 18px; }
.primary { width: 100%; height: 52px; border: 0; border-radius: 16px; color: #fff; font-size: 16px; font-weight: 700; background: linear-gradient(90deg, #46b7b1, #74a5ff 48%, #ff9db0); box-shadow: 0 14px 30px rgba(114, 165, 255, .22); cursor: pointer; }
.primary:disabled { opacity: .55; cursor: wait; }
.pay-note { display: flex; align-items: center; justify-content: center; gap: 4px; margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.pay-note strong { color: #2a2f4c; font-size: 18px; }
.disclaimer { margin: 12px 0 0; color: rgba(36, 42, 54, .52); font-size: 12px; line-height: 1.6; text-align: center; }
#paidImage { width: 100%; height: 240px; object-fit: cover; border-radius: 20px; }
#paidImage.hidden { display: none; }
#paidMessage { min-height: 48px; margin: 18px 0 10px; font-size: 20px; line-height: 1.5; }
#paidName { margin: 0 0 6px; color: var(--muted); font-size: 14px; }
#payStatus { display: grid; justify-items: center; align-content: center; min-height: 380px; gap: 18px; text-align: center; }
#payStatus p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
#payStatus strong { color: var(--text); font-size: 24px; }
.spinner { width: 32px; height: 32px; margin: 0; border: 3px solid rgba(60,74,105,.14); border-top-color: #1677ff; border-radius: 50%; animation: spin 1s linear infinite; }
.pay-qr { display: block; width: 228px; height: 228px; margin: 0; padding: 10px; box-sizing: border-box; border: 1px solid rgba(34,42,67,.08); border-radius: 16px; background: #fff; box-shadow: 0 12px 34px rgba(34,42,67,.12); }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  .shell { padding: 36px 16px 56px; }
  .stats { gap: 8px; }
  .wall-card { padding: 16px; border-radius: 24px; }
}

.toast {
  position: fixed;
  left: 50%;
  top: 28px;
  z-index: 120;
  max-width: min(420px, calc(100vw - 32px));
  padding: 14px 20px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 18px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  background: rgba(255,255,255,.94);
  color: var(--text);
  box-shadow: 0 18px 50px rgba(104,116,160,.24);
  backdrop-filter: blur(18px);
  opacity: 0;
  transform: translate(-50%, -12px) scale(.96);
  pointer-events: none;
  transition: opacity .28s ease, transform .28s cubic-bezier(.2,.8,.2,1);
}
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
