/* ===== 多巴胺配色 + 硬阴影玩具感 ===== */
:root {
  --pink: #ff4d9d;
  --pink-soft: #ffd9e9;
  --yellow: #ffd23f;
  --cyan: #23d3f2;
  --green: #3ce8a0;
  --purple: #8a5cff;
  --ink: #33204a;
  --paper: #fffaf7;
  --line: 3px solid var(--ink);
  --pop: 0 6px 0 var(--ink);
  --pop-sm: 0 4px 0 var(--ink);
  --radius: 26px;
  --theme: var(--pink);
  --theme-soft: var(--pink-soft);
  --page-width: 800px;
  --page-gutter: clamp(16px, 4vw, 32px);
}

* { box-sizing: border-box; }

/* 下面几个块都显式设了 display，需要让 hidden 属性仍然生效 */
[hidden] { display: none !important; }

/* 给读屏用的文字：标题是 SVG 描出来的，得留一份真文本 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}
html { overflow-x: clip; scrollbar-gutter: stable; }

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(120% 90% at 12% 0%, #fff3c4 0%, transparent 55%),
    radial-gradient(110% 90% at 92% 8%, #cdf4ff 0%, transparent 52%),
    linear-gradient(160deg, #ffe9f3 0%, #fef6ff 46%, #e9fff6 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
body.is-shooting { overflow-anchor: none; }
body.modal-open { overflow: hidden; }

.bg-dots {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(rgba(51, 32, 74, 0.09) 2px, transparent 2px);
  background-size: 26px 26px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.55), transparent 78%);
  -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,.55), transparent 78%);
}

/* ===== 闪光灯 ===== */
.flash {
  position: fixed;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 999;
}
.flash.fire { animation: flash .42s ease-out; }
@keyframes flash {
  0% { opacity: 0; }
  12% { opacity: .95; }
  100% { opacity: 0; }
}

/* ===== 顶栏 ===== */
.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 22px var(--page-gutter) 6px;
}

.logo { display: flex; align-items: center; gap: 14px; }

.logo-badge {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  font-size: 28px;
  background: var(--yellow);
  border: var(--line);
  border-radius: 18px;
  box-shadow: var(--pop-sm);
  transform: rotate(-6deg);
}

/* 标题是字体轮廓转的 SVG，不依赖本机字体，各端长得都一样 */
.logo-title {
  position: relative;
  margin: 0;
  line-height: 0;
}
.logo-title::before {
  content: "";
  position: absolute;
  inset: -12px -10px -8px;
  background: radial-gradient(ellipse, rgba(255, 117, 187, .28), transparent 70%);
  pointer-events: none;
  animation: title-glow 6s ease-in-out infinite alternate;
}
.title-sparkle {
  position: absolute;
  top: -6px;
  right: -10px;
  color: #d78a23;
  font-size: 13px;
  line-height: 1;
  animation: title-sparkle 6s ease-in-out infinite;
}
.logo-title svg {
  display: block;
  height: clamp(30px, 4.2vw, 40px);
  width: auto;
  overflow: visible;
  filter: drop-shadow(0 0 5px rgba(255, 77, 157, .16));
  animation: title-float 6s ease-in-out infinite;
}
.title-pink { animation: title-pink 12s ease-in-out infinite alternate; }
.title-lilac { animation: title-lilac 12s ease-in-out infinite alternate; }
.title-purple { animation: title-purple 12s ease-in-out infinite alternate; }
@keyframes title-float { 0%, 100% { transform: translateY(0) rotate(-.3deg); } 50% { transform: translateY(-2px) rotate(.3deg); } }
@keyframes title-glow { from { opacity: .4; } to { opacity: 1; } }
@keyframes title-sparkle { 0%, 100% { transform: scale(.85) rotate(-8deg); opacity: .45; } 50% { transform: scale(1.08) rotate(8deg); opacity: .9; } }
@keyframes title-pink { to { stop-color: #ff79a8; } }
@keyframes title-lilac { to { stop-color: #ed7abe; } }
@keyframes title-purple { to { stop-color: #a377ef; } }
.logo p {
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 600;
  opacity: .62;
}

.sound-toggle {
  width: 46px;
  height: 46px;
  font-size: 19px;
  background: #fff;
  border: var(--line);
  border-radius: 14px;
  box-shadow: var(--pop-sm);
  cursor: pointer;
  transition: transform .12s, box-shadow .12s;
}
.sound-toggle:active { transform: translateY(4px); box-shadow: none; }
.sound-toggle[aria-pressed="true"] { background: var(--yellow); }
.sound-toggle.is-muted { opacity: .65; }

/* ===== 舞台布局 ===== */
.stage {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(22px, 3vw, 32px);
  align-items: start;
  padding: clamp(14px, 2.4vw, 26px) var(--page-gutter) 60px;
  max-width: var(--page-width);
  margin: 0 auto;
}

.stage > * { min-width: 0; }

/* ===== 照相亭 ===== */
.booth {
  background: linear-gradient(180deg, #fff 0%, #fff6fb 100%);
  border: var(--line);
  border-radius: 34px;
  box-shadow: 0 10px 0 var(--ink), 0 26px 44px -22px rgba(51, 32, 74, .5);
  overflow: hidden;
}

.booth-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  background: linear-gradient(90deg, var(--pink), var(--purple) 52%, var(--cyan));
  border-bottom: var(--line);
}

.bulbs { display: flex; gap: 9px; }
.bulbs i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff8cf;
  border: 2px solid rgba(51, 32, 74, .55);
  box-shadow: 0 0 0 rgba(255, 245, 190, 0);
}
.bulbs.run i { animation: bulb .72s infinite; }
.bulbs.run i:nth-child(2) { animation-delay: .1s; }
.bulbs.run i:nth-child(3) { animation-delay: .2s; }
.bulbs.run i:nth-child(4) { animation-delay: .3s; }
.bulbs.run i:nth-child(5) { animation-delay: .4s; }
@keyframes bulb {
  0%, 100% { background: #fff8cf; box-shadow: 0 0 0 rgba(255,245,190,0); }
  50% { background: #fff; box-shadow: 0 0 14px 5px rgba(255, 230, 120, .95); }
}

.booth-brand {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .22em;
  color: #fff;
  text-shadow: 0 2px 0 rgba(51, 32, 74, .4);
}

.booth-body {
  position: relative;
  padding: clamp(16px, 2.6vw, 26px);
}

/* 帘子 */
.curtain {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 54%;
  z-index: 6;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, #e5327f 0 14px, #ff5ba5 14px 30px, #d92b74 30px 44px);
  border-right: var(--line);
  box-shadow: inset -14px 0 24px rgba(0,0,0,.28);
  transform: translateX(-102%);
  transition: transform .62s cubic-bezier(.65,.02,.32,1);
}
.curtain-r {
  left: auto;
  right: 0;
  border-right: none;
  border-left: var(--line);
  box-shadow: inset 14px 0 24px rgba(0,0,0,.28);
  transform: translateX(102%);
}
.curtain-l { left: 0; }
.booth-body.closed .curtain { transform: translateX(0); }

/* 屏幕 */
.screen {
  position: relative;
  border: var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, #2a1b3d 0%, #3a2455 100%);
  box-shadow: inset 0 6px 22px rgba(0, 0, 0, .55);
  padding: clamp(14px, 2.2vw, 22px);
  min-height: 330px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  overflow: hidden;
}

.screen::after {
  /* 扫描线，营造取景屏质感 */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, rgba(255,255,255,.045) 0 2px, transparent 2px 5px);
}

.screen:focus-visible { outline: 3px solid var(--cyan); outline-offset: 4px; }

/* 取景：两个上传槽 */
.viewfinder {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: clamp(8px, 1.6vw, 16px);
}

.slot {
  position: relative;
  aspect-ratio: 1;
  border: 3px dashed rgba(255, 255, 255, .5);
  border-radius: 22px;
  background: rgba(255, 255, 255, .07);
  cursor: pointer;
  overflow: hidden;
  transition: transform .18s, border-color .18s, background .18s;
  outline: none;
}
.slot:hover, .slot:focus-visible { transform: translateY(-3px) rotate(-1deg); border-color: var(--yellow); }
.slot.filled { border-style: solid; border-color: #fff; background: #000; }
.slot.drag { border-color: var(--green); background: rgba(60, 232, 160, .18); }

.slot-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #fff;
  text-align: center;
  padding: 8px;
}
.slot-emoji { font-size: clamp(30px, 5vw, 44px); }
.slot-empty strong { font-size: clamp(13px, 1.5vw, 15px); }
.slot-empty small { font-size: 11px; opacity: .66; }
.slot.filled .slot-empty { display: none; }

.slot-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
.slot.filled .slot-img { display: block; }

.slot-clear {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 26px;
  height: 26px;
  display: none;
  place-items: center;
  font-size: 12px;
  color: #fff;
  background: rgba(51, 32, 74, .82);
  border: 2px solid #fff;
  border-radius: 50%;
  cursor: pointer;
}
.slot.filled .slot-clear { display: grid; }

.slot-link {
  font-size: clamp(20px, 3vw, 30px);
  font-weight: 800;
  color: var(--yellow);
  text-shadow: 0 2px 0 rgba(0,0,0,.35);
}

/* 四格取景 */
.grid-live {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(8px, 1.4vw, 14px);
}

.cell {
  position: relative;
  aspect-ratio: 1;
  border-radius: 18px;
  border: 3px solid rgba(255,255,255,.34);
  background: rgba(255,255,255,.08);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.cell > span {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 800;
  color: rgba(255,255,255,.3);
}
.cell.waiting {
  background: rgba(255,255,255,.08);
  border-color: rgba(255, 210, 63, .7);
}
.cell.waiting::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 12%, rgba(255,255,255,.04) 30%,
              rgba(255,255,255,.22) 50%, rgba(255,255,255,.04) 70%, transparent 88%);
  transform: translate3d(-120%, 0, 0);
  animation: shimmer 2.2s linear infinite;
  will-change: transform;
  pointer-events: none;
}
@keyframes shimmer {
  from { transform: translate3d(-120%, 0, 0); }
  to { transform: translate3d(120%, 0, 0); }
}
.cell img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cell.done { border-color: #fff; animation: popIn .48s cubic-bezier(.2,1.5,.4,1); }
.cell.done > span { display: none; }
@keyframes popIn {
  0% { transform: scale(.6) rotate(-7deg); opacity: 0; filter: blur(6px); }
  100% { transform: scale(1) rotate(0); opacity: 1; filter: blur(0); }
}

/* 倒计时 */
.countdown {
  position: absolute;
  inset: 0;
  z-index: 7;
  display: grid;
  place-items: center;
  font-size: clamp(76px, 15vw, 150px);
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 34px rgba(255, 90, 165, .95), 0 8px 0 rgba(51,32,74,.45);
  background: rgba(42, 27, 61, .42);
  backdrop-filter: blur(2px);
}
.countdown b { animation: tick .82s ease-out; display: block; }
@keyframes tick {
  0% { transform: scale(2.2); opacity: 0; }
  30% { transform: scale(1); opacity: 1; }
  100% { transform: scale(.82); opacity: .15; }
}

.screen-hint {
  text-align: center;
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255,255,255,.82);
  letter-spacing: .02em;
}

/* 出片口 */
.booth-slot-out {
  margin: 18px clamp(16px, 2.6vw, 26px) 0;
  padding-bottom: 16px;
  display: grid;
  place-items: center;
}
.booth-slot-out span {
  display: block;
  width: min(74%, 420px);
  height: 14px;
  border-radius: 10px;
  background: linear-gradient(180deg, #1d1129, #3a2455);
  border: var(--line);
  box-shadow: inset 0 4px 8px rgba(0,0,0,.7);
}

/* 相纸 */
.printout {
  border-top: var(--line);
  background: repeating-linear-gradient(45deg, #fff 0 18px, #fff6fb 18px 36px);
  padding: clamp(18px, 2.6vw, 28px);
  animation: slideOut .8s cubic-bezier(.16,.9,.24,1);
}
@keyframes slideOut {
  0% { transform: translateY(-46px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

.printout > img {
  display: block;
  width: min(100%, 420px);
  margin: 0 auto;
  border: var(--line);
  border-radius: 18px;
  box-shadow: var(--pop), 0 22px 36px -20px rgba(51,32,74,.6);
}

.printout-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}
.printout-actions .btn { flex: 1 1 42%; text-align: center; }

.btn {
  appearance: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  padding: 12px 18px;
  border: var(--line);
  border-radius: 16px;
  box-shadow: var(--pop-sm);
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
  background: #fff;
  transition: transform .12s, box-shadow .12s;
}
.btn:active { transform: translateY(4px); box-shadow: none; }
.btn-main { background: var(--yellow); }
.btn-ghost { background: #fff; }

.frame-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.frame-list a {
  display: block;
  min-width: 0;
  border: var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--pop-sm);
  background: #fff;
}
.frame-list img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.frame-list a:focus-visible { outline: 3px solid var(--pink); outline-offset: 4px; }

/* ===== 照片墙 ===== */
.wall {
  position: relative;
  z-index: 1;
  width: 100%;
  margin: 0;
  padding: 14px 14px 8px;
  border: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--pop);
  background: linear-gradient(145deg, #fff, #fff9e9);
}

.wall-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.wall-heading { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wall-head h2 { margin: 0; font-size: clamp(17px, 2.4vw, 21px); white-space: nowrap; }
.wall-count {
  flex: none;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 6px;
  background: #fff0ba;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
}
.wall-nav { display: flex; flex: none; gap: 6px; }
.wall-nav button {
  display: grid; place-items: center;
  width: 30px; height: 30px; padding: 0;
  border: 2px solid var(--ink); border-radius: 10px;
  background: #fff; color: var(--ink); font: inherit; font-weight: 800; cursor: pointer;
}
.wall-nav button:disabled { opacity: .3; cursor: default; }
.wall-nav button:not(:disabled):hover { background: var(--yellow); }
.wall-nav button:focus-visible, .wall-grid:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; }

.wall-grid {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: #d8bbdc transparent;
  padding: 5px 2px 10px;
  min-width: 0;
}

.wall-item {
  display: block;
  flex: 0 0 clamp(116px, 30vw, 154px);
  scroll-snap-align: start;
  position: relative;
  border: var(--line);
  border-radius: 16px;
  box-shadow: var(--pop-sm);
  background: #fff;
  overflow: hidden;
  transition: transform .16s, box-shadow .16s;
}
.wall-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--pop), 0 18px 28px -18px rgba(51, 32, 74, .6);
}
.wall-item img { display: block; width: 100%; aspect-ratio: 108 / 128; object-fit: cover; }
.wall-empty {
  flex: 1 0 100%;
  margin: 0;
  padding: 12px 8px;
  text-align: center;
  font-size: 13px;
  line-height: 1.6;
  font-weight: 700;
  color: #776880;
}
.wall-more {
  flex: 0 0 94px;
  align-self: stretch;
  border: 2px dashed #b397bb; border-radius: 16px;
  background: #fffaf3; color: var(--ink);
  font: inherit; font-size: 12px; font-weight: 700;
  cursor: pointer; scroll-snap-align: end;
}
.wall-more:disabled { opacity: .5; cursor: wait; }

.btn-wall { background: var(--green); }
.btn-wall:disabled { opacity: .6; cursor: default; }

/* ===== 拍摄额度 ===== */
.wallet-has {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: var(--line);
  border-radius: 18px;
  background: linear-gradient(120deg, var(--green), var(--cyan));
  box-shadow: var(--pop-sm);
}
.wallet-count { display: flex; align-items: baseline; gap: 6px; }
.wallet-count b { font-size: 30px; font-weight: 900; line-height: 1; }
.wallet-count small { font-size: 12.5px; font-weight: 800; }
.wallet-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.wallet-side code {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  padding: 3px 7px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .62);
}
.wallet-swap {
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--ink);
  padding: 4px 10px;
  background: #fff;
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  cursor: pointer;
}
.wallet-swap:active { transform: translateY(2px); }
.wallet-swap:disabled { opacity: .55; cursor: wait; }

.wallet-tip {
  margin: 0 0 12px;
  font-size: 12.5px;
  line-height: 1.65;
  font-weight: 600;
  opacity: .72;
}
.btn-buy {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  text-align: center;
  background: var(--ink);
  color: #fff;
}
.btn-buy:hover { background: #49305f; }
.xianyu-icon { display: block; width: 30px; height: 30px; flex: 0 0 30px; object-fit: contain; }
.purchase-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}
.copy-status, .purchase-return {
  margin: 10px 0;
  font-size: 12px;
  line-height: 1.7;
}
.copy-status { opacity: .72; }
.purchase-return { font-weight: 700; }
.copy-fallback {
  margin: 12px 0;
  padding: 12px;
  border: 2px dashed var(--ink);
  border-radius: 14px;
  background: #fff9e9;
}
.copy-fallback label { display: block; font-size: 12px; line-height: 1.6; }
.copy-fallback textarea {
  display: block;
  width: 100%;
  min-height: 96px;
  margin-top: 8px;
  padding: 10px;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  resize: vertical;
  user-select: text;
}
.wallet-form { display: flex; gap: 8px; }
.wallet-form input {
  flex: 1;
  min-width: 0;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 12px 14px;
  color: var(--ink);
  background: #fffdf9;
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  outline: none;
}
.wallet-form input:focus { border-color: var(--pink); background: #fff; }
.wallet-form input::placeholder { letter-spacing: normal; text-transform: none; color: rgba(51, 32, 74, .38); }
.wallet-go {
  flex: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  padding: 0 18px;
  color: #fff;
  background: var(--ink);
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  cursor: pointer;
}
.wallet-go:active { transform: translateY(3px); }
.wallet-go:disabled { opacity: .55; cursor: wait; }
.code-status { margin: 8px 2px 0; font-size: 12px; line-height: 1.5; color: #766383; }
.code-status.err { color: #b62050; }

/* ===== 控制台 ===== */
.console { display: flex; flex-direction: column; gap: 16px; }

.panel {
  background: #fff;
  border: var(--line);
  border-radius: var(--radius);
  box-shadow: var(--pop);
  padding: 18px;
}

.panel h2 {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 14px;
  font-size: 16px;
}
.panel h2 > span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  font-size: 14px;
  color: #fff;
  background: var(--ink);
  border-radius: 9px;
}
.panel h2 em {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  opacity: .42;
}

.chips { display: flex; flex-wrap: wrap; gap: 9px; }

.chip {
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  padding: 10px 15px;
  background: #fff;
  border: var(--line);
  border-radius: 14px;
  box-shadow: var(--pop-sm);
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, background .16s;
}
.chip:active { transform: translateY(4px); box-shadow: none; }
.chip[aria-pressed="true"] { background: var(--cyan); }

.themes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.theme-card {
  position: relative;
  font-family: inherit;
  text-align: left;
  padding: 13px 13px 12px;
  border: var(--line);
  border-radius: 18px;
  box-shadow: var(--pop-sm);
  cursor: pointer;
  color: var(--ink);
  background: #fff;
  overflow: hidden;
  transition: transform .14s, box-shadow .14s;
}
.theme-card:active { transform: translateY(4px); box-shadow: none; }
.theme-card > i {
  position: absolute;
  inset: 0;
  opacity: .22;
  background: linear-gradient(140deg, var(--c1), var(--c2));
}
.theme-card[aria-pressed="true"] > i { opacity: 1; }
.theme-card span, .theme-card strong, .theme-card small { position: relative; }
.theme-card span { font-size: 22px; }
.theme-card strong { display: block; margin-top: 4px; font-size: 15px; }
.theme-card small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.45;
  opacity: .72;
}
.theme-card[aria-pressed="true"] { transform: rotate(-1.2deg); }
.theme-card[aria-pressed="true"] small { opacity: .85; }

.fields { display: flex; flex-direction: column; gap: 9px; }
.fields input {
  width: 100%;
  min-width: 0;
  font-family: inherit;
  font-size: 16px;
  padding: 12px 14px;
  color: var(--ink);
  background: #fffdf9;
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  outline: none;
}
.fields input:focus { border-color: var(--pink); background: #fff; }
.fields input::placeholder { color: rgba(51, 32, 74, .38); }

/* 快门按钮 */
.shutter {
  position: relative;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 19px 22px;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: .04em;
  color: #fff;
  background: linear-gradient(120deg, var(--pink), var(--purple));
  border: var(--line);
  border-radius: 22px;
  box-shadow: var(--pop), 0 18px 30px -16px rgba(255, 77, 157, .85);
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, filter .2s;
}
.shutter:not(:disabled):hover { filter: brightness(1.06); }
.shutter:not(:disabled):active { transform: translateY(6px); box-shadow: 0 0 0 var(--ink); }
.shutter:disabled { cursor: not-allowed; filter: grayscale(.72) brightness(.94); box-shadow: var(--pop); }

.shutter-icon {
  font-size: 28px;
  line-height: 1;
  flex: none;
}
.shutter.busy .shutter-icon { animation: camera-breathe 2s ease-in-out infinite; }
@keyframes camera-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }

.shoot-shortcut {
  position: fixed;
  z-index: 20;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 12px 16px;
  border: 2.5px solid var(--ink); border-radius: 18px;
  background: var(--yellow); color: var(--ink);
  box-shadow: 0 4px 0 var(--ink), 0 8px 24px #33204a24;
  font: inherit; font-size: 14px; font-weight: 800;
  cursor: pointer;
}
.shoot-shortcut:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.shoot-shortcut:focus-visible { outline: 3px solid var(--pink); outline-offset: 4px; }
.resume-note {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 18px; background: #fff0bf; border-bottom: 2px solid var(--ink);
  font-size: 12px; font-weight: 700; line-height: 1.6;
}
.resume-note button { flex: none; border: 2px solid var(--ink); border-radius: 10px; padding: 6px 10px; background: #fff; color: var(--ink); font: inherit; cursor: pointer; }

.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  padding: 20px;
  overflow-y: auto;
  background: rgba(42, 24, 59, .55);
  backdrop-filter: blur(6px);
}
.wall-dialog {
  position: relative; width: min(100%, 430px);
  max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px);
  overflow-y: auto; padding: 24px; text-align: center;
  background: linear-gradient(160deg, #fffdf6, #fff1f8);
  border: var(--line); border-radius: 28px; box-shadow: 0 8px 0 var(--ink), 0 20px 70px #20102c55;
  animation: dialog-in .2s ease-out;
}
@keyframes dialog-in { from { transform: translateY(10px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.dialog-close { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; background: #fff; border: 2px solid var(--ink); border-radius: 12px; cursor: pointer; color: var(--ink); }
.dialog-photo { width: 108px; margin: 0 auto 20px; padding: 5px; background: #fff; border: 2px solid var(--ink); border-radius: 10px; box-shadow: 3px 4px 0 #e4bcd6; transform: rotate(-4deg); }
.dialog-photo img { display: block; width: 100%; border-radius: 5px; }
.dialog-kicker { font-size: 10px; letter-spacing: .15em; font-weight: 800; color: #a84986; }
.wall-dialog h2 { margin: 10px 0; font-size: 22px; line-height: 1.5; }
.wall-dialog p { margin: 10px 0; font-size: 14px; line-height: 1.7; }
.wall-dialog .wall-consent { margin: 16px 0; padding: 10px 12px; border-radius: 12px; background: #ffffffa8; color: #776880; font-size: 12px; text-align: left; }
.dialog-actions { display: grid; gap: 12px; margin-top: 18px; padding-bottom: 5px; }
.dialog-actions .btn { padding: 12px 18px; font-size: 15px; }
.dialog-error { color: #bc2458; }
.wall-dialog button:disabled { opacity: .55; cursor: wait; }
.wall-dialog :focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; }

.save-backdrop { padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom)); }
.save-dialog {
  position: relative;
  width: min(100%, 520px);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px 18px 18px;
  background: linear-gradient(160deg, #fffdf6, #fff1f8);
  border: var(--line);
  border-radius: 26px;
  box-shadow: 0 7px 0 var(--ink), 0 20px 70px #20102c55;
  text-align: center;
  animation: dialog-in .2s ease-out;
}
.save-dialog .dialog-kicker { display: block; padding: 0 28px; }
.save-dialog h2 { margin: 10px 24px 8px; font-size: 21px; }
.save-hint { margin: 0 0 16px; font-size: 14px; font-weight: 800; line-height: 1.6; }
.save-photo-wrap {
  min-height: 100px;
  background: #f0e8ed;
  border: 2px solid var(--ink);
  border-radius: 12px;
  overflow: hidden;
}
.save-photo-wrap img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(58vh, 580px);
  object-fit: contain;
  /* 保留系统长按图片菜单，不用 canvas / 背景图 / 覆盖层拦截。 */
  -webkit-touch-callout: default;
  user-select: auto;
  -webkit-user-select: auto;
}
.save-status { margin: 10px 0; min-height: 18px; color: #776880; font-size: 12px; line-height: 1.5; }
.save-status.err { color: #b62050; }
.save-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.save-actions .btn { flex: 1 1 40%; padding: 11px 14px; font-size: 14px; }
.save-note { margin: 14px 0 0; color: #776880; font-size: 12px; line-height: 1.6; text-align: left; }
.save-dialog :focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; }

.status {
  margin: 0;
  min-height: 22px;
  text-align: center;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}
.status.err { color: #d61f5c; }
.diagnostics { padding: 12px 14px; border: 2px dashed #bea6c8; border-radius: 16px; background: #fffaf3; }
.diagnostics p { margin: 0 0 10px; font-size: 13px; line-height: 1.6; }
.diagnostics .btn { padding: 8px 12px; font-size: 12px; }
.diagnostics small { display: block; margin-top: 10px; font-size: 11px; line-height: 1.6; color: #776880; }
.diagnostics textarea { width: 100%; margin-top: 12px; border: 2px solid #bea6c8; border-radius: 10px; padding: 8px; font-size: 14px; }

.tips {
  margin: 0;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.6;
  opacity: .5;
}

@media (max-width: 560px) {
  .booth { border-radius: 26px; }
  .screen { min-height: 280px; }
}

@media (max-width: 380px) {
  .booth-top { padding: 10px 14px; gap: 10px; }
  .bulbs { gap: 6px; }
  .bulbs i { width: 11px; height: 11px; }
  .booth-brand { font-size: 10px; letter-spacing: .15em; white-space: nowrap; }
}

/* 桌面沿用手机的单列和双格结构，只放大可读性、间距和触控区域。 */
@media (min-width: 800px) {
  .logo-title svg { height: 48px; }
  .logo-badge { width: 64px; height: 64px; font-size: 34px; }
  .logo p { font-size: 15px; }
  .sound-toggle { width: 54px; height: 54px; font-size: 23px; }
  .booth-top { padding: 16px 24px; }
  .booth-brand { font-size: 14px; }
  .slot-emoji { font-size: 54px; }
  .slot-empty strong { font-size: 20px; }
  .slot-empty small { font-size: 14px; }
  .screen-hint { font-size: 16px; line-height: 1.6; }
  .cell > span { font-size: 48px; }
  .console { gap: 22px; }
  .panel { padding: 26px; }
  .panel h2 { font-size: 21px; gap: 12px; margin-bottom: 18px; }
  .panel h2 > span { width: 32px; height: 32px; font-size: 17px; }
  .panel h2 em { font-size: 14px; }
  .chips { gap: 12px; }
  .chip { padding: 14px 20px; font-size: 18px; }
  .themes { gap: 14px; }
  .theme-card { padding: 20px; }
  .theme-card span { font-size: 30px; }
  .theme-card strong { font-size: 20px; }
  .theme-card small { font-size: 14px; }
  .fields { gap: 12px; }
  .fields input, .wallet-form input { padding: 16px 18px; font-size: 18px; }
  .btn { padding: 16px 22px; font-size: 18px; }
  .btn-buy { gap: 12px; }
  .xianyu-icon { width: 38px; height: 38px; flex-basis: 38px; }
  .wallet-go { padding: 0 22px; font-size: 18px; }
  .wallet-has { padding: 20px; }
  .wallet-count b { font-size: 40px; }
  .wallet-count small, .wallet-swap { font-size: 15px; }
  .wallet-side code { font-size: 14px; }
  .wallet-tip { font-size: 16px; }
  .copy-status, .purchase-return, .copy-fallback label { font-size: 15px; }
  .purchase-actions { gap: 12px; }
  .wall { padding: 18px 18px 10px; }
  .shutter { padding: 25px 28px; font-size: 24px; }
  .shutter-icon { font-size: 34px; }
  .code-status, .resume-note { font-size: 14px; }
  .status { font-size: 17px; }
  .tips { font-size: 14px; }
  .printout > img { width: min(100%, 560px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
