/* 大头贴证件照样式：舰队 DESIGN-TOKENS 母版（强调色 #2563eb、版心 1120px）+ 大头贴舞台专属样式。移动端优先。 */
:root {
  --bg: #f7f7f5; --surface: #ffffff; --surface-2: #efefec;
  --text: #1a1d21; --text-2: #5c6470; --text-3: #8a919c;
  --border: #e3e3de; --border-2: #cfcfc8;
  --accent: #2563eb; --accent-hover: #1d4fd0; --accent-soft: #eaf0fe; --on-accent: #ffffff;
  --success: #177245; --danger: #c62f3b; --danger-bg: #fdeeee;
  --focus: #2563eb;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --font-num: ui-monospace, "SF Mono", "Roboto Mono", monospace;
  --fs-h3: 17px; --fs-body: 15.5px; --fs-small: 13.5px; --fs-cap: 12px;
  --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px; --sp-7: 48px;
  --wrap: 1120px;
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px; --r-pill: 999px;
  --shadow-1: 0 1px 2px rgba(26,29,33,.05), 0 1px 6px rgba(26,29,33,.04);
  --shadow-2: 0 8px 28px rgba(26,29,33,.10);
  --booth-accent: #e8321e; --booth-yellow: #ffc800;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: var(--fs-body); line-height: 1.65; overflow-x: hidden; }
h1, h3, h4 { margin: 0; font-weight: 700; line-height: 1.3; }
p { margin: 0; }
button { font-family: var(--font); }
img, video, canvas { max-width: 100%; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } }

/* 页头 */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 38px; height: 38px; flex: none; border-radius: var(--r-md); background: var(--booth-accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 19px; font-weight: 700; }
.brand h1 { font-size: 17px; white-space: nowrap; }
.tagline { font-size: var(--fs-small); color: var(--text-2); line-height: 1.4; }
.header-right { display: flex; align-items: center; gap: 12px; flex: none; }
.local-badge { font-size: var(--fs-cap); color: var(--success); border: 1px solid var(--border-2); border-radius: var(--r-pill); padding: 4px 10px; white-space: nowrap; font-weight: 600; }
.lang-btn { min-height: 40px; padding: 0 14px; border-radius: var(--r-md); border: 1px solid var(--border-2); background: var(--surface); color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; }
.mode-bar { display: flex; align-items: center; gap: 16px; padding-top: 10px; padding-bottom: 12px; flex-wrap: wrap; }
.mode-seg { max-width: 340px; flex: 1 1 220px; }
.privacy-note { font-size: var(--fs-cap); color: var(--text-2); }
@media (max-width: 640px) { .tagline, .local-badge { display: none; } .header-inner { min-height: 54px; } }

main.wrap { padding-top: 20px; padding-bottom: 8px; }

/* 按钮与通用控件 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 18px; border-radius: var(--r-md); font-size: 15px; font-weight: 600; cursor: pointer; border: 1px solid transparent; transition: background .15s, transform .15s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: var(--surface); border-color: var(--border-2); color: var(--text); }
.btn-dark { background: var(--text); color: #fff; }
.btn-danger { background: var(--surface); border-color: var(--border-2); color: var(--danger); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-lg { min-height: 46px; padding: 0 22px; }
.btn-sm { min-height: 40px; padding: 0 13px; font-size: 13.5px; }
.btn-block { width: 100%; }
@media (max-width: 640px) { .btn { min-height: 44px; } }
.seg { display: flex; gap: 4px; background: var(--surface-2); border-radius: var(--r-pill); padding: 4px; }
.seg button { flex: 1; border: 0; background: transparent; border-radius: var(--r-pill); font-size: 14px; font-weight: 700; color: var(--text-2); min-height: 40px; padding: 6px 10px; cursor: pointer; white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.seg-sm button { font-size: 13.5px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-label { font-size: 12.5px; font-weight: 700; color: var(--text-2); }
.row-label.w64 { width: 64px; flex: none; }
.wrap-row { margin-top: 12px; }
.check-label { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; min-height: 40px; }
.check-label input, .switch-row input { width: 20px; height: 20px; accent-color: var(--accent); flex: none; }
input[type="range"] { flex: 1; accent-color: var(--accent); min-height: 36px; min-width: 0; }
input[type="color"] { width: 44px; height: 40px; border: 1.5px solid var(--border-2); border-radius: var(--r-md); background: var(--surface); padding: 2px; cursor: pointer; flex: none; }
.hint { font-size: var(--fs-small); color: var(--text-2); }
.hint.center { text-align: center; margin-top: 10px; }
.val { font-family: var(--font-num); color: var(--accent); font-weight: 700; }
.status-line { font-size: 13.5px; color: var(--text-2); margin-top: 10px; min-height: 22px; line-height: 1.6; }
.status-line.err { color: var(--danger); }

/* 布局与卡片 */
.layout { display: grid; grid-template-columns: minmax(0,1fr) 372px; gap: 18px; align-items: start; }
@media (max-width: 920px) { .layout { grid-template-columns: 1fr; } }
.panel { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow-1); }
.panel .card { margin-bottom: 0; }
.card h3 { font-size: var(--fs-h3); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.card h3 .no { background: var(--text); color: #fff; width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; flex: none; }
.card .desc { font-size: 12.5px; color: var(--text-2); line-height: 1.6; margin-bottom: 12px; }
.card .desc.no-mb { margin-bottom: 0; }
.field { margin-bottom: 12px; }
.field.no-mb { margin-bottom: 0; }
.field label { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 6px; color: var(--text-2); }
.field input[type="text"] { width: 100%; min-height: 42px; border: 1.5px solid var(--border-2); border-radius: var(--r-md); padding: 9px 12px; font-size: 15px; background: var(--surface); color: var(--text); font-family: inherit; }
@media (max-width: 640px) { .card { padding: 16px; } }

/* 大头贴舞台 */
.stage-card { padding: 16px; }
.stage-outer { display: flex; justify-content: center; background: repeating-linear-gradient(45deg, transparent 0 14px, rgba(127,127,127,.05) 14px 28px); border-radius: var(--r-lg); padding: 14px; }
#bStage { position: relative; width: 100%; max-width: 520px; background: var(--frame, #fff); padding: 14px 14px 44px; box-shadow: 0 14px 34px rgba(0,0,0,.28); transition: background .2s; }
#bStage.strip { max-width: 340px; padding: 12px 12px 40px; }
.photo-area { position: relative; background: #000; overflow: hidden; }
.photo-area.ratio-single { aspect-ratio: 4 / 3.4; }
.strip-photos { display: flex; flex-direction: column; gap: 8px; }
.strip-photos .slot { aspect-ratio: 4 / 3; background: #1c1c1c; overflow: hidden; position: relative; }
.slot img, .slot video { width: 100%; height: 100%; object-fit: cover; display: block; }
#bVideo, #bPhoto { width: 100%; height: 100%; object-fit: cover; display: block; }
#bVideo { transform: scaleX(-1); }
.stage-caption { position: absolute; left: 0; right: 0; bottom: 0; height: 44px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; font-weight: 900; font-size: 13px; letter-spacing: .14em; color: var(--frame-ink, #17150f); }
.stage-caption .date { font-weight: 500; letter-spacing: .04em; font-size: 12px; opacity: .75; }
#bStickerLayer { position: absolute; inset: 0; overflow: hidden; touch-action: none; }
.sticker { position: absolute; transform-origin: center; cursor: grab; user-select: none; -webkit-user-select: none; line-height: 1; touch-action: none; }
.sticker:active { cursor: grabbing; }
.sticker.selected { outline: 2px dashed var(--booth-accent); outline-offset: 4px; border-radius: 6px; }
.sticker .em { display: block; pointer-events: none; }
.sticker img { display: block; pointer-events: none; }
.sticker .txt { display: block; pointer-events: none; font-weight: 900; white-space: nowrap; padding: .18em .5em; border-radius: .5em; }
#bCountdown, #idCountdown { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; font-size: 110px; font-weight: 900; color: #fff; text-shadow: 0 6px 30px rgba(0,0,0,.6); z-index: 30; pointer-events: none; }
#bFlash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 31; }
.empty-hint { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center; color: #cfccc2; text-align: center; padding: 20px; font-size: 14px; line-height: 1.7; background: #1c1c1c; }
.empty-hint b { color: #fff; font-size: 16px; }
.stage-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.stage-bar .btn { flex: 1 1 auto; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--border-2); padding: 0; cursor: pointer; flex: none; }
.swatch.on { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--border-2); background: var(--surface-2); color: var(--text); border-radius: var(--r-pill); padding: 7px 13px; font-size: 13px; font-weight: 600; min-height: 40px; cursor: pointer; }
.chip.on { border-color: var(--text); background: var(--text); color: #fff; }
.chip small { font-family: var(--font-num); font-weight: 400; opacity: .75; margin-left: 4px; }
.spec-group-label { font-size: 12.5px; font-weight: 700; color: var(--text-2); margin: 10px 0 6px; }
.spec-group-label:first-child { margin-top: 0; }
.sticker-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.sticker-grid button { border: 1.5px solid transparent; background: var(--surface-2); border-radius: 12px; font-size: 26px; padding: 6px 0; line-height: 1.25; min-height: 48px; cursor: pointer; }
.sticker-grid button:hover { border-color: var(--text); }
.tabs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.tabs button { border: 0; background: var(--surface-2); color: var(--text-2); border-radius: var(--r-pill); padding: 6px 13px; font-size: 12.5px; font-weight: 700; min-height: 36px; cursor: pointer; }
.tabs button.on { background: var(--text); color: #fff; }
.layers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.layers li { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1.5px solid var(--border); border-radius: var(--r-md); padding: 6px 10px; font-size: 13px; cursor: pointer; min-height: 42px; }
.layers li.on { border-color: var(--booth-accent); }
.layers li .thumb { font-size: 19px; width: 26px; text-align: center; flex: none; }
.layers li .thumb img { width: 26px; height: 26px; object-fit: contain; display: block; }
.layers li .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layers li button { border: 0; background: transparent; font-size: 15px; padding: 4px 6px; min-height: 32px; color: var(--text-2); cursor: pointer; }
.empty-note { font-size: 13px; color: var(--text-2); padding: 8px 0; }
.sel-tools { display: none; flex-direction: column; gap: 8px; margin-top: 12px; }
.sel-tools.show { display: flex; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0 12px; font-size: 14.5px; font-weight: 600; }

/* 证件照 */
.id-live-wrap { position: relative; border-radius: var(--r-lg); overflow: hidden; background: #000; margin-bottom: 14px; }
.id-live-wrap video { width: 100%; display: block; transform: scaleX(-1); max-height: 46vh; object-fit: cover; }
.id-frame { position: relative; width: 100%; max-width: 520px; margin: 0 auto; background: #111; border-radius: var(--r-md); overflow: hidden; }
.id-frame canvas { display: block; width: 100%; height: auto; touch-action: none; cursor: grab; }
.id-frame canvas:active { cursor: grabbing; }
.id-guide { position: absolute; inset: 0; pointer-events: none; }
.id-guide svg { width: 100%; height: 100%; display: block; }
.id-empty { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 8px; align-items: center; justify-content: center; color: #cfccc2; text-align: center; padding: 20px; font-size: 14px; line-height: 1.7; background: #1c1c1c; }
.id-empty b { color: #fff; font-size: 16px; }

/* 定价与激活 */
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 860px) { .price-grid { grid-template-columns: 1fr; } }
.price-card { border: 1px solid var(--border-2); border-radius: var(--r-lg); padding: 20px; background: var(--surface); }
.price-card.featured { border-color: var(--accent); box-shadow: var(--shadow-1); }
.price-card h4 { font-size: var(--fs-h3); }
.price { font-size: 30px; font-weight: 700; font-family: var(--font-num); margin: 4px 0 10px; }
.price small { font-size: 13px; color: var(--text-2); font-weight: 400; font-family: var(--font); }
.price-card ul { margin: 0; padding-left: 18px; font-size: 14.5px; line-height: 1.9; color: var(--text-2); }
.buy-box { margin-top: 16px; background: var(--surface-2); border-radius: var(--r-md); padding: 16px; font-size: 14.5px; line-height: 1.7; }
.buy-flex { display: flex; gap: 18px; align-items: flex-start; }
.pay-qr { width: 148px; height: 148px; flex: none; border-radius: var(--r-md); background: #fff; object-fit: contain; border: 1px solid var(--border); }
.buy-text { flex: 1; min-width: 0; }
@media (max-width: 640px) { .buy-flex { flex-direction: column; align-items: center; } .buy-text { width: 100%; } }
.code-row { display: flex; gap: 8px; margin-top: 12px; }
.code-row input { flex: 1; min-height: 42px; padding: 0 12px; border-radius: var(--r-md); border: 1px solid var(--border-2); font-family: var(--font-num); font-size: 14px; min-width: 0; background: var(--surface); color: var(--text); }
.code-msg { margin-top: 8px; font-size: var(--fs-small); min-height: 20px; }
.code-msg.ok { color: var(--success); }
.code-msg.err { color: var(--danger); }
.quota { margin-top: 4px; font-size: var(--fs-small); color: var(--text-2); }
.fineprint { margin-top: 8px; font-size: var(--fs-cap); color: var(--text-3); line-height: 1.6; }

/* 补光灯 */
#lightOverlay { position: fixed; inset: 0; z-index: 200; overflow: hidden; }
#lightOverlay[hidden] { display: none; }
.light-surface { position: absolute; inset: 0; background: #ffffff; transition: background .2s; }
#lightOverlay.ring .light-surface { background: radial-gradient(circle at center, #3a3a3a 0 30%, var(--light-color, #ffffff) 38% 100%); }
.light-window { position: absolute; left: 50%; top: 44%; transform: translate(-50%, -50%); width: min(62vw, 46vh, 420px); aspect-ratio: 1 / 1; border-radius: 50%; overflow: hidden; background: #111; display: flex; align-items: center; justify-content: center; box-shadow: 0 10px 40px rgba(0,0,0,.25); z-index: 2; }
#lightOverlay.square .light-window { border-radius: var(--r-xl); aspect-ratio: 4 / 3.4; }
.light-window video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.light-no-cam { color: #cfccc2; font-size: 13.5px; text-align: center; padding: 16px; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 2; pointer-events: none; }
.light-controls { position: absolute; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(560px, calc(100vw - 24px)); display: flex; flex-direction: column; gap: 10px; z-index: 3; background: rgba(255,255,255,.82); backdrop-filter: blur(8px); border-radius: var(--r-lg); padding: 12px; box-shadow: var(--shadow-2); }
.seg-light { background: rgba(26,29,33,.08); }
.light-bright-row { padding: 0 4px; }
.light-bright-row .row-label { color: var(--text); }

footer { border-top: 1px solid var(--border); padding: var(--sp-5) 0 var(--sp-7); }
footer p { font-size: var(--fs-small); color: var(--text-2); line-height: 1.7; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
