/* ===== 多巴胺配色 + 硬阴影玩具感 ===== */
: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);
}

* { 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%;
}

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: 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;
  padding: 22px clamp(16px, 4vw, 48px) 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 {
  margin: 0;
  line-height: 0;
}
.logo-title svg {
  display: block;
  height: clamp(30px, 4.2vw, 40px);
  width: auto;
}
.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="false"] { opacity: .5; }

/* ===== 舞台布局 ===== */
.stage {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, .85fr);
  gap: clamp(18px, 2.6vw, 34px);
  align-items: start;
  padding: clamp(14px, 2.4vw, 30px) clamp(16px, 4vw, 48px) 60px;
  max-width: 1320px;
  margin: 0 auto;
}

@media (max-width: 980px) {
  .stage { grid-template-columns: 1fr; }
}

/* ===== 照相亭 ===== */
.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);
}

/* 取景：两个上传槽 */
.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: linear-gradient(100deg, rgba(255,255,255,.08) 28%, rgba(255,255,255,.28) 50%, rgba(255,255,255,.08) 72%);
  background-size: 220% 100%;
  animation: shimmer 1.25s linear infinite;
  border-color: rgba(255, 210, 63, .7);
}
@keyframes shimmer {
  from { background-position: 180% 0; }
  to { background-position: -80% 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;
}

.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(4, 1fr);
  gap: 10px;
  margin-top: 16px;
}
.frame-list a {
  display: block;
  border: var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--pop-sm);
  background: #fff;
}
.frame-list img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }

/* ===== 照片墙 ===== */
.wall {
  position: relative;
  z-index: 1;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 48px) 72px;
}

.wall-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.wall-head h2 { margin: 0; font-size: clamp(19px, 2.6vw, 24px); }
.wall-head p {
  margin: 5px 0 0;
  font-size: 12.5px;
  font-weight: 600;
  opacity: .55;
}
.wall-count {
  flex: none;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 13px;
  background: var(--yellow);
  border: var(--line);
  border-radius: 999px;
  box-shadow: var(--pop-sm);
}

.wall-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
  gap: clamp(12px, 1.8vw, 20px);
}

.wall-item {
  display: block;
  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:nth-child(3n) { transform: rotate(-1.1deg); }
.wall-item:nth-child(3n + 2) { transform: rotate(1.2deg); }
.wall-item:hover {
  transform: translateY(-4px) rotate(0);
  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-item .wall-tag {
  position: absolute;
  left: 8px;
  bottom: 8px;
  max-width: calc(100% - 16px);
  font-size: 10.5px;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  border: 2px solid var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wall-item.is-sample .wall-tag { background: var(--ink); color: #fff; }

.wall-empty {
  grid-column: 1 / -1;
  padding: 26px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  opacity: .5;
}
.wall-foot { display: grid; place-items: center; margin-top: 20px; }

.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-tip {
  margin: 0 0 12px;
  font-size: 12.5px;
  line-height: 1.65;
  font-weight: 600;
  opacity: .72;
}
.btn-buy {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  text-align: center;
  background: var(--yellow);
}
.wallet-form { display: flex; gap: 8px; }
.wallet-form input {
  flex: 1;
  min-width: 0;
  font-family: inherit;
  font-size: 14px;
  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; }

/* ===== 控制台 ===== */
.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(auto-fill, minmax(132px, 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 {
  font-family: inherit;
  font-size: 14px;
  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-ring {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255,255,255,.42);
  flex: none;
}
.shutter.busy .shutter-ring { animation: pulse 1s infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(255,255,255,.42); }
  50% { box-shadow: 0 0 0 11px rgba(255,255,255,.18); }
}

.status {
  margin: 0;
  min-height: 22px;
  text-align: center;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}
.status.err { color: #d61f5c; }

.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; }
  .frame-list { grid-template-columns: repeat(2, 1fr); }
  .printout-actions .btn { flex: 1 1 42%; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
