:root {
  --bg: #0f0f12; --card: #1a1a20; --line: #2c2c36; --text: #f3f3f5; --dim: #a0a0ad;
  --accent: #ff5c8a; --accent-ink: #1a0810; --danger: #ff7a7a;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; }
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top));
}
.lang-switch { margin-left: 10px; margin-right: auto; background: none; border: 1px solid var(--line); color: var(--dim); border-radius: 999px; padding: 3px 10px; font: inherit; font-size: 13px; cursor: pointer; }
.brand { font-weight: 800; font-size: 18px; text-decoration: none; letter-spacing: -0.02em; }
.credits {
  background: var(--card); color: var(--text); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px; font-size: 14px;
}
main { max-width: 480px; margin: 0 auto; padding: 8px 16px 24px; }
h1 { font-size: 34px; line-height: 1.1; letter-spacing: -0.03em; margin: 16px 0 12px; }
h1 em { color: var(--accent); font-style: normal; }
.lead { color: var(--dim); margin: 0 0 20px; }

button, .secondary { font: inherit; cursor: pointer; }
.primary, .secondary {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 20px; border-radius: 14px; font-weight: 700; text-decoration: none;
}
.primary { background: var(--accent); color: var(--accent-ink); border: 0; }
.primary:disabled { opacity: 0.45; cursor: not-allowed; }
.secondary { background: var(--card); color: var(--text); border: 1px solid var(--line); }
.big { width: 100%; min-height: 56px; font-size: 18px; }
.link { background: none; border: 0; color: var(--dim); text-decoration: underline; padding: 12px; }
.danger { color: var(--danger); }
.link.inline { padding: 0; font: inherit; color: inherit; }
.row { display: flex; gap: 10px; margin: 12px 0; }
.row > * { flex: 1; }

.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--dim); margin-bottom: 14px; }
.consent input { width: 22px; height: 22px; flex: none; margin: 0; accent-color: var(--accent); }
.msg { min-height: 1.5em; margin: 8px 0; color: var(--danger); font-size: 14px; }
.msg.ok { color: var(--dim); }
.tips { list-style: none; padding: 0; margin: 20px 0 12px; display: grid; gap: 6px; color: var(--dim); font-size: 14px; }
.tips li::before { content: "✓ "; color: var(--accent); }
.fine { color: var(--dim); font-size: 13px; }

.demo { margin: 0 0 20px; }
.demo-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.demo-row div { position: relative; border-radius: 12px; overflow: hidden; background: var(--card); }
.demo-row img { display: block; width: 100%; height: auto; }
.demo-row span {
  position: absolute; left: 6px; bottom: 6px; padding: 2px 8px; border-radius: 999px;
  background: rgba(0, 0, 0, 0.7); font-size: 12px; font-weight: 700;
}
.demo-row div:not(:first-child) span { background: var(--accent); color: var(--accent-ink); }
.demo figcaption { margin-top: 6px; color: var(--dim); font-size: 12px; }
.steps { margin: 24px 0 12px; padding-left: 22px; display: grid; gap: 10px; color: var(--dim); font-size: 15px; }
.steps strong { color: var(--text); }

.stage {
  position: relative; width: 100%; aspect-ratio: 3 / 4; border-radius: 18px; overflow: hidden;
  background: var(--card); touch-action: pan-y;
}
.stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
#afterImg, .demo-after { clip-path: inset(0 0 0 var(--split, 50%)); }
.divider { position: absolute; top: 0; bottom: 0; left: var(--split, 50%); width: 2px; margin-left: -1px; background: #fff; pointer-events: none; }
.divider::after {
  content: "‹ ›"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: #fff; color: #111; border-radius: 999px; padding: 4px 10px; font-weight: 700; white-space: nowrap;
}
.slider { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.watermark {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
  font-size: 44px; font-weight: 900; letter-spacing: 0.2em; color: rgba(255, 255, 255, 0.28); transform: rotate(-24deg);
}
.spinner { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; background: rgba(0, 0, 0, 0.55); }
.spinner .spin { width: 44px; height: 44px; border-radius: 50%; border: 4px solid rgba(255, 255, 255, 0.25); border-top-color: #fff; animation: spin 0.9s linear infinite; }
.spinner p { margin: 0; font-weight: 600; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner .spin { animation-duration: 3s; } }

.groups { display: flex; gap: 8px; margin: 16px 0 10px; overflow-x: auto; }
.groups button, .styles button {
  background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 14px; white-space: nowrap; min-height: 40px;
}
.groups button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.styles { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.styles button { border-radius: 12px; }
.styles button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }

.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0 4px; }
.gallery button { padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: var(--card); aspect-ratio: 3 / 4; }
.gallery button[aria-pressed="true"] { border-color: var(--accent); }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }

footer { max-width: 480px; margin: 0 auto; padding: 16px 16px max(24px, env(safe-area-inset-bottom)); color: var(--dim); font-size: 13px; }

dialog {
  width: min(92vw, 420px); border: 1px solid var(--line); border-radius: 20px;
  background: var(--card); color: var(--text); padding: 20px;
}
dialog::backdrop { background: rgba(0, 0, 0, 0.7); }
dialog h2 { margin: 0 0 6px; }
dialog p { color: var(--dim); margin: 0 0 14px; font-size: 14px; }
.packs { display: grid; gap: 10px; }
.packs button {
  display: flex; justify-content: space-between; align-items: center; width: 100%;
  background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; font-weight: 700; font-size: 17px;
}
.packs button span:last-child { color: var(--accent); }

.poll { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.poll-card {
  position: relative; display: block; padding: 0; overflow: hidden; text-align: left;
  background: var(--card); color: var(--text); border: 2px solid var(--line); border-radius: 16px;
}
button.poll-card:active { border-color: var(--accent); }
.poll-card.picked { border-color: var(--accent); }
.poll-card img { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.poll-label { display: block; padding: 8px 10px 2px; font-weight: 700; font-size: 14px; }
.poll-bar { display: block; height: 6px; margin: 6px 10px 0; border-radius: 3px; background: var(--line); overflow: hidden; }
.poll-bar::after { content: ""; display: block; height: 100%; width: var(--pct, 0%); background: var(--accent); }
.poll-num { display: block; padding: 4px 10px 10px; font-size: 13px; color: var(--dim); }
.poll-card:not(:has(.poll-num)) .poll-label { padding-bottom: 10px; }
.cta { margin-top: 24px; text-align: center; color: var(--dim); }

.share { margin: 4px 0 12px; }
.share .fine { margin: 6px 0 0; text-align: center; }

.card-img { display: block; width: 100%; border-radius: 12px; background: var(--bg); min-height: 120px; }
dialog .row { margin-bottom: 0; }

.pay { text-align: center; }
.pay h1 { font-size: 28px; }
.code-line { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 4px 8px; margin: 0 0 10px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 12px; color: var(--dim); font-size: 13px; }
.code-line b { font: 700 18px/1.2 ui-monospace, Consolas, monospace; letter-spacing: 0.12em; color: var(--text); }
.pay-brand { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 4px 0 8px; color: #4096ff; font-weight: 700; }
.pay-brand > span:first-child { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: #1677ff; color: #fff; font-size: 13px; }
.pay-box { padding: 10px 12px 12px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.pay-label { margin: 0; font-weight: 700; }
.pay-label b { color: #ffc53d; }
.pay-amount { margin: 2px 0; font-size: 54px; font-weight: 800; line-height: 1.1; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.pay-amount small { font-size: 0.5em; margin-right: 2px; }
.pay-amount mark { padding: 0 0.08em; border-radius: 0.15em; background: #ffe58f; color: #d4380d; box-shadow: 0 3px 0 #f5c542; }
.pay-countdown { margin: 0 0 8px; color: var(--dim); font-size: 13px; }
.pay-countdown b { color: var(--text); font-variant-numeric: tabular-nums; }
.pay-only { margin: 0; padding: 7px 10px; border-radius: 10px; background: rgba(250, 140, 22, 0.16); color: #ffa940; font-size: 14px; font-weight: 700; }
.qr { position: relative; width: 220px; max-width: 70vw; margin: 12px auto 4px; }
.pay-qr { display: block; width: 100%; height: auto; border-radius: 12px; background: #fff; transition: filter 0.2s; }
.qr-toggle { position: absolute; opacity: 0; pointer-events: none; }
.qr-toggle:not(:checked) ~ .pay-qr { filter: blur(8px); }
.qr-toggle:checked ~ .qr-cover { display: none; }
.qr-toggle:focus-visible ~ .qr-cover .qr-cover-btn { outline: 3px solid #91caff; }
.qr-cover { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.55); color: #222; font-size: 14px; cursor: pointer; }
.qr-cover b { color: #d4380d; font-size: 20px; }
.qr-cover-btn { padding: 9px 18px; border-radius: 999px; background: #1677ff; color: #fff; font-weight: 700; box-shadow: 0 6px 16px rgba(22, 119, 255, 0.35); }
.pay-steps { margin: 10px 0 0; padding: 8px 10px 8px 28px; border-radius: 12px; background: var(--card); color: var(--dim); font-size: 13px; line-height: 1.7; text-align: left; }
.pay-steps b { color: var(--text); }
.pay-must { display: grid; gap: 2px; margin: 12px 0 0; padding: 9px 10px; border: 2px solid var(--danger); border-radius: 12px; background: rgba(255, 122, 122, 0.1); color: var(--danger); font-size: 14px; }
.pay-must span { color: var(--dim); font-size: 13px; }
.pay-must.wait { border-color: var(--accent); color: var(--text); }
.pay .big { margin-top: 10px; }
.pay .secondary.big { width: 100%; }
.spinner-inline { display: grid; place-items: center; margin: 24px 0; }
.spinner-inline div { width: 44px; height: 44px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
.packs .alipay span:first-child::after { content: " · Alipay 支付宝"; font-weight: 400; color: var(--dim); font-size: 14px; }
.recover-line { margin-top: 14px; font-size: 13px; color: var(--dim); }
.recover-line .mono { font-family: ui-monospace, Consolas, monospace; letter-spacing: 0.1em; color: var(--text); }

.doc { max-width: 680px; margin: 0 auto; padding: 16px; }
.doc h1 { font-size: 28px; }
.doc h2 { font-size: 18px; margin-top: 28px; }
.doc p, .doc li { color: #d0d0d8; }

/* 首页示例：一根分割线左右滑动对比前后 */
.demo-stage { position: relative; width: min(100%, 290px); margin: 0 auto; aspect-ratio: 4 / 5; border-radius: 18px; overflow: hidden; background: var(--card); touch-action: pan-y; }
.demo-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 20%; user-select: none; -webkit-user-drag: none; }
.demo-tag { position: absolute; top: 10px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; pointer-events: none; }
.demo-tag.left { left: 10px; background: rgba(0, 0, 0, 0.7); }
.demo-tag.right { right: 10px; background: var(--accent); color: var(--accent-ink); }
.demo-picks { display: flex; gap: 8px; justify-content: center; margin-top: 10px; }
.demo-picks button { background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 14px; min-height: 36px; }
.demo-picks button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.demo figcaption { text-align: center; }

/* 价格提示条 */
.price-strip { display: flex; align-items: center; gap: 12px; margin: 4px 0 8px; padding: 10px 12px; border: 1px solid rgba(255, 92, 138, 0.45); border-radius: 14px; background: rgba(255, 92, 138, 0.08); }
.price-strip div { flex: 1; display: grid; font-size: 14px; }
.price-strip div span { color: var(--dim); font-size: 13px; }
.price-strip button { flex: none; min-height: 40px; padding: 0 16px; border-radius: 12px; }
.credits b { margin-left: 6px; color: var(--accent); }

/* 出图进度条 */
.progress { width: 220px; max-width: 70vw; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.25); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 4px; transition: width 0.4s linear; }
.progress-pct { margin: 0; font-size: 13px; font-weight: 600; opacity: 0.85; font-variant-numeric: tabular-nums; }

/* 付款正在确认 / 还没付款的订单提示 */
.order-notice { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin: 0 0 14px; padding: 10px 12px; border: 1px solid var(--accent); border-radius: 12px; background: rgba(255, 92, 138, 0.1); font-size: 14px; }
.order-notice[hidden] { display: none; }
.order-notice a { color: var(--accent); font-weight: 700; white-space: nowrap; }
dialog .order-notice { margin: 0 0 12px; }

/* 到账提示 */
.toast { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; width: min(92vw, 420px); margin: 0; padding: 12px 14px; border-radius: 12px; background: #1f3a2a; border: 1px solid #3fbf74; color: var(--text); font-size: 14px; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45); }
.toast[hidden] { display: none; }

/* 到账后提示客人点这个按钮 */
.pulse { animation: pulse 1.4s ease-in-out 4; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 92, 138, 0.7); } 50% { box-shadow: 0 0 0 10px rgba(255, 92, 138, 0); } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; outline: 3px solid var(--accent); outline-offset: 2px; } }
