:root {
  --bg: #f7f1ea;
  --card: #fffdfa;
  --card-soft: #fff9f2;
  --ink: #241c16;
  --muted: #6f6257;
  --brand: #c2673f;
  --brand-deep: #7a3b22;
  --cta: #2f5d50;
  --line: #f3e7da;
  --mint: #a8d5ba;
  --lilac: #d9cff0;
  --radius: 26px;
  --shadow-card: inset 0 -8px 16px rgba(255, 255, 255, .75),
    inset 0 4px 10px rgba(160, 120, 90, .05),
    0 12px 26px rgba(122, 84, 56, .12);
  --shadow-soft: inset 0 -4px 10px rgba(255, 255, 255, .85),
    inset 0 3px 8px rgba(160, 120, 90, .06),
    0 6px 14px rgba(122, 84, 56, .1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

[hidden] { display: none !important; }

html, body { margin: 0; }

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC",
    "Microsoft YaHei", system-ui, sans-serif;
  overflow-x: hidden;
  touch-action: manipulation;
}

h1, h2, h3, p, figure { margin: 0; }
button, a { font: inherit; touch-action: manipulation; }
button { border: 0; background: none; color: inherit; cursor: pointer; }
a { color: inherit; }
img { display: block; max-width: 100%; }

/* 平面 SVG 图标尺寸规范 */
.ico-xs { width: 14px; height: 14px; flex: none; vertical-align: -2px; }
.ico-sm { width: 16px; height: 16px; flex: none; vertical-align: -3px; }
.ico-md { width: 24px; height: 24px; flex: none; }
.ico-lg { width: 28px; height: 28px; flex: none; }

.blobs { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.blobs i { position: absolute; display: block; border-radius: 50%; filter: blur(50px); opacity: .55; }
.blobs i:nth-child(1) { width: 260px; height: 260px; top: -80px; right: -60px; background: #f6d9c4; }
.blobs i:nth-child(2) { width: 220px; height: 220px; bottom: 120px; left: -90px; background: #dfe9df; }
.blobs i:nth-child(3) { width: 180px; height: 180px; top: 40%; right: -70px; background: #eae1f6; }

.app {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
  padding: 14px 16px calc(20px + env(safe-area-inset-bottom));
}

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 2px 14px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 46px; height: 46px; flex: none;
  display: grid; place-items: center;
  border-radius: 16px;
  background: linear-gradient(180deg, #fbe4d3, #f4cfb6);
  border: 3px solid #fdf1e6;
  color: var(--brand-deep);
  box-shadow: var(--shadow-soft);
}
.brand-ico { width: 24px; height: 24px; display: block; }
.brand h1 { font-size: 20px; letter-spacing: .01em; line-height: 1.25; }
.brand p { font-size: 12px; color: var(--muted); letter-spacing: .04em; }

.quota-pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 999px;
  background: #fffdfa;
  border: 2px solid var(--line);
  box-shadow: var(--shadow-soft);
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.quota-pill .ico-xs { color: var(--brand); }
.quota-pill.is-empty { color: var(--brand-deep); border-color: #f3cdb6; background: #fdf0e6; }

.screen { display: none; }
.screen.is-active { display: block; animation: rise .32s cubic-bezier(.22, .8, .3, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.lede { color: var(--muted); font-size: 13.5px; padding: 0 4px 12px; line-height: 1.65; }

.showcase {
  background: linear-gradient(180deg, #fffdfa, #fcf4ea);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 13px 14px 14px;
  margin-bottom: 14px;
}
.showcase-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.showcase-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fce8d8, #f7d6be);
  border: 1.5px solid #fdf3ea;
  color: var(--brand-deep);
  font-size: 12px;
  font-weight: 700;
  box-shadow: inset 0 -2px 4px rgba(255, 255, 255, .7), 0 3px 8px rgba(160, 110, 75, .1);
}
.showcase-try {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--cta);
  padding: 5px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, #eff7f3, #dfeee7);
  border: 1.5px solid #cde0d8;
  box-shadow: inset 0 -2px 5px rgba(255, 255, 255, .8), 0 3px 8px rgba(47, 93, 80, .1);
  transition: transform .15s ease, background .15s ease;
}
.showcase-try:active { transform: scale(.96); }
.showcase-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1.08fr;
  align-items: center;
  gap: 6px;
}
.showcase-item {
  text-align: center;
  min-width: 0;
}
.showcase-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 18px;
  border: 3px solid var(--line);
  background: #f4ece3;
  box-shadow: var(--shadow-soft);
}
.showcase-item.is-result img {
  border-color: #df9e76;
  box-shadow: 0 6px 14px rgba(194, 103, 63, .2);
}
.showcase-item figcaption {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.showcase-item.is-result figcaption {
  color: var(--brand-deep);
  font-weight: 600;
}
.showcase-op {
  color: #c9b19c;
  font-size: 15px;
  font-weight: 700;
  padding-bottom: 18px;
  user-select: none;
}

.card {
  background: linear-gradient(180deg, var(--card), var(--card-soft));
  border: 3px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 16px;
  margin-bottom: 14px;
}
.card-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.card-title-wrap { min-width: 0; flex: 1; }
.card-head h2 { font-size: 16px; line-height: 1.35; }
.card-tips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
}
.tip-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #f6ece1;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}
.tip-pill .ico-xs { color: var(--brand); }
.step-dot {
  width: 30px; height: 30px; flex: none; margin-top: 1px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #fce7d6, #f5ceb0);
  border: 2px solid #fdf3ea;
  color: var(--brand-deep);
  font-size: 13px; font-weight: 700;
  box-shadow: inset 0 -3px 6px rgba(255, 255, 255, .7), 0 4px 8px rgba(160, 110, 75, .14);
}

.drop {
  position: relative;
  display: block;
  border: 3px dashed #e9d8c8;
  border-radius: 22px;
  background: #fefaf4;
  min-height: 188px;
  transition: border-color .2s ease, background .2s ease, transform .16s ease;
  cursor: pointer;
}
.drop:active { transform: scale(.99); }
.drop.is-filled { border-style: solid; border-color: var(--line); padding: 8px; background: #fffdfa; }
.drop-inner {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: var(--muted); font-size: 12.5px;
}
.drop-inner b { color: var(--ink); font-size: 14.5px; font-weight: 600; }
.drop-ico-badge {
  width: 54px; height: 54px;
  display: grid; place-items: center;
  border-radius: 18px;
  background: linear-gradient(180deg, #fce8d8, #f5d2b8);
  border: 2px solid #fdf3ea;
  color: var(--brand-deep);
  box-shadow: var(--shadow-soft);
  margin-bottom: 2px;
}
.drop-ico-badge.is-sm {
  width: 46px; height: 46px;
  border-radius: 16px;
  margin-bottom: 0;
}
.drop-sub-pills {
  display: inline-flex;
  gap: 8px;
  margin-top: 2px;
}
.drop-sub-pills i {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-style: normal;
  padding: 3px 10px;
  border-radius: 999px;
  background: #f5ebe0;
  font-size: 11.5px;
  color: var(--muted);
}
.drop-sub-pills i .ico-xs { color: var(--brand); }
.drop-preview { width: 100%; height: 188px; object-fit: cover; border-radius: 16px; }
.drop-clear {
  position: absolute; top: 10px; right: 10px;
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: #fffdfa; border: 2px solid var(--line);
  color: var(--muted);
  box-shadow: 0 4px 10px rgba(122, 84, 56, .16);
}

.thumbs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.thumbs.is-empty { grid-template-columns: 1fr; }
.thumbs.is-empty .thumb-add {
  aspect-ratio: auto;
  min-height: 108px;
  flex-direction: row;
  gap: 12px;
  padding: 12px 18px;
}
.thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 20px;
  overflow: hidden;
  border: 3px solid var(--line);
  background: #f4ece3;
  box-shadow: var(--shadow-soft);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-tag {
  position: absolute; left: 8px; bottom: 8px;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(36, 28, 22, .65);
  color: #fff; font-size: 11px;
  backdrop-filter: blur(4px);
}
.thumb-remove {
  position: absolute; top: 6px; right: 6px;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255, 253, 250, .92);
  color: var(--muted); font-size: 15px; line-height: 1;
  display: grid; place-items: center;
  box-shadow: 0 3px 8px rgba(60, 40, 25, .2);
}
.thumb-add {
  aspect-ratio: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border: 3px dashed #e9d8c8;
  border-radius: 22px;
  background: #fefaf4;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: transform .16s ease;
}
.thumb-add:active { transform: scale(.98); }
.thumb-add-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.thumbs.is-empty .thumb-add-text { align-items: flex-start; }
.thumb-add-text b { color: var(--ink); font-size: 14px; font-weight: 600; }
.thumb-add-text em { font-style: normal; font-size: 12px; color: var(--muted); }
.hint { margin-top: 10px; font-size: 12px; color: var(--brand-deep); }

.field { margin-top: 14px; }
.field:first-of-type { margin-top: 0; }
.field-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 8px;
}
.field-label .ico-xs { color: var(--brand); }
.field-tip { font-style: normal; color: var(--brand); margin-left: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 15px;
  border-radius: 999px;
  background: #f6ece1;
  border: 2px solid transparent;
  color: var(--muted);
  font-size: 13.5px;
  box-shadow: inset 0 -3px 6px rgba(255, 255, 255, .75), inset 0 2px 5px rgba(160, 120, 90, .08);
  transition: transform .16s ease, background .16s ease, color .16s ease, border-color .16s ease;
}
.chip:active { transform: scale(.95); }
.chip-svg { width: 15px; height: 15px; flex: none; opacity: .82; }
.chip[aria-pressed="true"], .chip[aria-checked="true"] {
  background: linear-gradient(180deg, #fbe3d2, #f7d4bb);
  border-color: #e8a982;
  color: var(--brand-deep);
  font-weight: 600;
  box-shadow: inset 0 -3px 6px rgba(255, 255, 255, .6), 0 4px 10px rgba(194, 103, 63, .14);
}
.chip[aria-pressed="true"] .chip-svg, .chip[aria-checked="true"] .chip-svg { opacity: 1; }

.cta-bar { padding: 8px 0 4px; margin: 4px 0 6px; }
.btn-cta {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 56px;
  border-radius: 999px;
  background: linear-gradient(180deg, #3b6e60, var(--cta));
  border: 3px solid rgba(255, 255, 255, .18);
  color: #fff;
  font-size: 16.5px; font-weight: 700; letter-spacing: .04em;
  text-decoration: none;
  box-shadow: inset 0 -6px 12px rgba(0, 0, 0, .18), inset 0 4px 10px rgba(255, 255, 255, .16),
    0 14px 26px rgba(47, 93, 80, .3);
  transition: transform .16s ease, box-shadow .16s ease;
}
.btn-cta:active { transform: scale(.98); box-shadow: inset 0 6px 14px rgba(0, 0, 0, .22), 0 8px 16px rgba(47, 93, 80, .26); }
.btn-cta[disabled] {
  background: #e8dbcd;
  color: #a4917f;
  border-color: rgba(255, 255, 255, .5);
  box-shadow: inset 0 -4px 10px rgba(255, 255, 255, .6), inset 0 3px 8px rgba(160, 120, 90, .08);
}
.btn-ico { width: 19px; height: 19px; flex: none; }
.cta-hint { text-align: center; font-size: 12px; color: var(--muted); margin-top: 8px; min-height: 18px; }

.btn-clay {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  height: 50px; padding: 0 24px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fffdfa, #f7ece0);
  border: 3px solid var(--line);
  color: var(--brand-deep);
  font-weight: 600;
  box-shadow: var(--shadow-soft);
}
.btn-clay:active { transform: scale(.98); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 10px 22px; border-radius: 999px;
  color: var(--muted); font-size: 13px;
  border: 2px solid var(--line); background: #fffdfa;
  box-shadow: var(--shadow-soft);
}
.link-btn {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--muted); font-size: 12.5px;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #d8c6b6;
}
.link-btn.center { display: flex; width: fit-content; margin: 14px auto 0; }

.history { padding: 4px 2px 8px; }
.history-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.history-head h2 { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.history-head h2 .ico-sm { color: var(--brand); }
.history-rail { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.history-rail::-webkit-scrollbar { display: none; }
.history-item { position: relative; width: 86px; flex: none; }
.history-item img { width: 86px; height: 86px; object-fit: cover; border-radius: 20px; border: 3px solid var(--line); background: #f4ece3; box-shadow: var(--shadow-soft); }
.history-item .thumb-remove { top: -4px; right: -4px; width: 24px; height: 24px; font-size: 13px; }
.history-note {
  display: flex; align-items: center; gap: 4px;
  font-size: 11.5px; color: #a0917f; margin-top: 4px;
}

.stage { padding: 36px 12px 20px; text-align: center; }
.orb {
  position: relative;
  width: 128px; height: 128px; margin: 0 auto 26px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #fff7ee, #f6d3ba 62%, #eab396);
  border: 4px solid #fdf1e6;
  color: var(--brand-deep);
  box-shadow: inset -8px -10px 20px rgba(190, 130, 95, .25), inset 8px 10px 18px rgba(255, 255, 255, .8),
    0 16px 30px rgba(160, 110, 78, .24);
  animation: breathe 2.6s ease-in-out infinite;
}
.orb-ico { width: 48px; height: 48px; display: block; }
.orb span {
  position: absolute; inset: -14px;
  border-radius: 50%;
  border: 3px dashed rgba(194, 103, 63, .35);
  animation: spin 9s linear infinite;
}
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes spin { to { transform: rotate(360deg); } }

.stage h2 { font-size: 18px; }
.stage-sub {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  color: var(--muted); font-size: 12.5px; margin-top: 6px;
}
.pairs { display: flex; gap: 10px; justify-content: center; margin: 22px 0 18px; }
.pairs img { width: 68px; height: 68px; object-fit: cover; border-radius: 18px; border: 3px solid var(--line); box-shadow: var(--shadow-soft); background: #f4ece3; }
.progress { height: 8px; border-radius: 999px; background: #eadfd2; overflow: hidden; max-width: 300px; margin: 0 auto 22px; box-shadow: inset 0 2px 4px rgba(140, 100, 70, .14); }
.progress i { display: block; height: 100%; width: 6%; border-radius: 999px; background: linear-gradient(90deg, #e0a077, var(--brand)); transition: width .5s ease; }

.result-head { text-align: center; padding: 8px 0 16px; }
.result-head h2 { font-size: 19px; }
.result-head p { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.result-frame {
  background: #fffdfa;
  border: 3px solid var(--line);
  border-radius: 28px;
  padding: 10px;
  box-shadow: var(--shadow-card);
}
.result-frame img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 20px; background: #f1e7dc; }
.result-actions { display: flex; gap: 10px; margin-top: 16px; }
.result-actions .btn-cta { flex: 1.35; }
.result-actions .btn-clay { flex: 1; height: 56px; }

.site-foot { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 22px 4px 10px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.foot-link { display: inline-flex; align-items: center; gap: 4px; padding: 0; }
.site-foot .dot { color: #cdbba9; }
.reward-btn {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--brand-deep);
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: #ecc4ac;
}

.modal { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(36, 28, 22, .48); backdrop-filter: blur(3px); }
.modal-card {
  position: relative;
  width: min(360px, 100%);
  background: linear-gradient(180deg, #fffdfa, #fff7ee);
  border: 3px solid #fff;
  border-radius: 28px;
  padding: 22px;
  text-align: center;
  box-shadow: 0 24px 50px rgba(60, 40, 25, .34);
  animation: pop .24s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
.modal-mascot {
  width: 48px; height: 48px;
  margin: 0 auto 8px;
  display: grid; place-items: center;
  border-radius: 16px;
  background: linear-gradient(180deg, #fbe4d3, #f4cfb6);
  border: 3px solid #fdf1e6;
  color: var(--brand-deep);
  box-shadow: var(--shadow-soft);
}
.modal-card h3 { font-size: 17px; }
.modal-card > p { color: var(--muted); font-size: 12.5px; margin: 6px 0 16px; }
.qr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.qr-grid figure { position: relative; aspect-ratio: 1; border-radius: 18px; background: #f7efe6; border: 3px solid var(--line); display: grid; place-items: center; overflow: hidden; }
.qr-grid img { width: 100%; height: 100%; object-fit: contain; }
.qr-fallback { display: none; color: #a4917f; font-size: 12px; line-height: 1.5; }
.qr-missing img { display: none; }
.qr-missing .qr-fallback { display: block; }
.qr-grid figcaption { position: absolute; bottom: 0; left: 0; right: 0; padding: 4px 0; background: rgba(255, 253, 250, .86); font-size: 11px; color: var(--muted); }
.modal-card .btn-clay { width: 100%; }

.toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: 86vw;
  padding: 11px 20px;
  border-radius: 999px;
  background: rgba(36, 28, 22, .92);
  color: #fff; font-size: 13px;
  box-shadow: 0 12px 24px rgba(36, 28, 22, .28);
  z-index: 40;
  animation: rise .2s ease-out;
}
.toast[hidden] { display: none; }

:focus-visible { outline: 3px solid #d99b74; outline-offset: 2px; }

@media (min-width: 640px) {
  .app { padding-top: 26px; }
  .card { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
