/* ==========================================================================
   AI 换脸短视频一体机 / 手机 H5 —— 设计稿 576x1024 竖屏还原
   注意：一体机 WebView 为 Android 5.1（Chromium 39/40），
   不支持 CSS 变量 / flex gap / aspect-ratio / inset / 多位置渐变停点，
   本文件全部使用字面值与 margin 兼容写法，勿再引入上述特性。
   ========================================================================== */

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

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #120d0b;
  color: #ffffff;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font-family: inherit;
  border: 0;
  outline: 0;
  cursor: pointer;
  background: none;
  color: inherit;
}

/* ------------------------------- 舞台 ------------------------------- */

#stage {
  position: absolute;
  width: 576px;
  height: 1024px;
  display: flex;
  flex-direction: column;
  transform-origin: top left;
  background: #2b211c url("../img/1index_bg1.jpg") center / cover no-repeat;
  overflow: hidden;
}

#stage::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(180deg,
      rgba(18, 12, 10, 0.1) 0%,
      rgba(18, 12, 10, 0.18) 38%,
      rgba(58, 38, 29, 0.86) 66%,
      rgba(28, 20, 17, 0.97) 100%);
  pointer-events: none;
  z-index: 0;
}

/* ------------------------------- Hero ------------------------------- */

.hero {
  position: relative;
  flex: none;
  height: 236px;
  z-index: 1;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
}

.hero-fade {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.12) 0%, rgba(0, 0, 0, 0) 45%, rgba(43, 33, 28, 0.9) 100%);
}

/* --------------------------- 模板横滑轮播 --------------------------- */

.tpl-strip {
  position: relative;
  z-index: 2;
  flex: none;
  height: 164px;
  display: flex;
  padding: 0 0 0 16px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.tpl-strip::-webkit-scrollbar {
  display: none;
}

.tpl-strip > .tpl-card + .tpl-card {
  margin-left: 12px;
}

.tpl-card {
  position: relative;
  flex: none;
  width: 152px;
  height: 152px;
  border-radius: 16px;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.28);
  transition: transform 0.18s ease, border-color 0.18s ease;
  background: #3b2d26;
}

.tpl-card.active {
  border-color: #4ae3c6;
  transform: translateY(-4px);
  box-shadow: 0 10px 22px rgba(20, 200, 170, 0.32);
}

.tpl-card .cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tpl-card .cover-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  text-align: center;
  background: linear-gradient(155deg, #4b3a30, #2b221e 70%);
}

.tpl-card .cover-fallback > * + * {
  margin-top: 6px;
}

.tpl-card .cover-fallback .nm {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1.25;
}

.tpl-card .cover-fallback .pr {
  font-size: 11px;
  line-height: 1.35;
  color: #f2c884;
  max-height: 46px;
  overflow: hidden;
  word-break: break-all;
}

.tpl-card .badge-free {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 7px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.45);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.72);
}

/* ------------------------------- 内容区 ------------------------------ */

.main {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  padding: 4px 18px 8px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.main::-webkit-scrollbar {
  display: none;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.block-title {
  display: flex;
  align-items: center;
  margin: 14px 0 8px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.block-title > * + * {
  margin-left: 10px;
}

.block-title .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(160deg, #f2c884, #dc9f4e);
  color: #5a3410;
  font-size: 16px;
  font-weight: 800;
}

.block-desc {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.72);
}

/* ------------------------------ 角色卡 ------------------------------ */

.role-card {
  position: relative;
  display: flex;
  padding: 16px;
  border-radius: 20px;
  background: rgba(62, 47, 41, 0.82);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

.role-card > .role-media + .role-media,
.role-card > .role-side {
  margin-left: 12px;
}

.role-badge {
  position: absolute;
  top: -9px;
  left: 14px;
  padding: 2px 10px;
  border-radius: 9px;
  background: linear-gradient(160deg, #4ae3c6, #10c2a2);
  color: #063a31;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
}

.role-media {
  position: relative;
  flex: none;
  width: 132px;
  height: 158px;
  border-radius: 12px;
  overflow: hidden;
  background: #2a221f;
}

.role-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.role-media .tag {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 5px 0;
  text-align: center;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.55);
}

.role-media .placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.5);
  border: 2px dashed rgba(255, 255, 255, 0.28);
  border-radius: 12px;
}

.role-media .placeholder svg {
  width: 52px;
  height: 52px;
  opacity: 0.85;
  margin-bottom: 8px;
}

.role-media .placeholder span {
  font-size: 12px;
}

.role-side {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.role-side > * + * {
  margin-top: 8px;
}

.role-name-row {
  display: flex;
  align-items: center;
  font-size: 15px;
  font-weight: 700;
}

.role-name-row > * + * {
  margin-left: 8px;
}

.role-state {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: #4ae3c6;
}

.role-state.wait {
  color: rgba(255, 255, 255, 0.5);
}

.role-state img {
  width: 14px;
  height: 14px;
  margin-right: 4px;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border-radius: 22px;
  font-size: 15px;
  font-weight: 700;
  transition: filter 0.15s ease, transform 0.1s ease;
}

.btn:active {
  transform: scale(0.97);
  filter: brightness(0.94);
}

.btn > svg {
  width: 19px;
  height: 19px;
  margin-right: 7px;
}

.btn-gold {
  background: linear-gradient(160deg, #f2c884, #dc9f4e);
  color: #4a2e12;
  box-shadow: 0 6px 14px rgba(220, 159, 78, 0.32);
}

.btn-teal {
  background: linear-gradient(160deg, #4ae3c6, #10c2a2);
  color: #053a32;
  box-shadow: 0 6px 14px rgba(24, 200, 168, 0.28);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.btn[disabled] {
  opacity: 0.45;
  pointer-events: none;
  box-shadow: none;
}

/* ------------------------------ 底部已选栏 ---------------------------- */

.bottom-bar {
  position: relative;
  z-index: 3;
  flex: none;
  margin: 8px 16px 0;
  height: 84px;
  display: flex;
  align-items: center;
  padding: 10px 10px 10px 14px;
  border-radius: 42px;
  background: rgba(46, 34, 29, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

.bottom-bar > * + * {
  margin-left: 12px;
}

.bottom-thumb {
  position: relative;
  flex: none;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  overflow: hidden;
  background: #3a2d27;
}

.bottom-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bottom-thumb .chk {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 200, 168, 0.82);
}

.bottom-thumb .chk svg {
  width: 22px;
  height: 22px;
}

.bottom-info {
  flex: 1;
  min-width: 0;
}

.bottom-info .nm {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bottom-info .sub {
  margin-top: 3px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
}

.bottom-info .sub b {
  color: #f2c884;
}

.pay-btn {
  flex: none;
  width: 150px;
  height: 62px;
  border-radius: 31px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(140deg, #4ae3c6, #0fb99c);
  color: #053a32;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(16, 194, 162, 0.35);
}

.pay-btn .amount {
  font-size: 19px;
  line-height: 1;
  margin-bottom: 1px;
}

.pay-btn .label {
  font-size: 13px;
  line-height: 1.2;
  opacity: 0.86;
}

.pay-btn[disabled] {
  opacity: 0.42;
  pointer-events: none;
}

.footer-note {
  position: relative;
  z-index: 2;
  flex: none;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.42);
  letter-spacing: 0.5px;
}

/* ------------------------------- 浮层 -------------------------------- */

.overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: none;
  flex-direction: column;
  background: rgba(12, 8, 6, 0.86);
}

.overlay.active {
  display: flex;
}

.overlay .ov-head {
  flex: none;
  padding: 26px 22px 12px;
  text-align: center;
}

.overlay .ov-head .t1 {
  font-size: 19px;
  font-weight: 800;
}

.overlay .ov-head .t2 {
  margin-top: 6px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.6;
}

.overlay .ov-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 22px;
}

.overlay .ov-foot {
  flex: none;
  display: flex;
  padding: 14px 20px 22px;
}

.overlay .ov-foot > .btn + .btn {
  margin-left: 12px;
}

.overlay .ov-foot .btn {
  flex: 1;
  height: 56px;
  border-radius: 28px;
  font-size: 16px;
}

/* 拍摄 */

.cam-frame {
  position: relative;
  width: 100%;
  max-width: 430px;
  height: 570px;
  border-radius: 26px;
  overflow: hidden;
  background: #1d1714;
  border: 2px solid rgba(255, 255, 255, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cam-frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.cam-guide {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.cam-guide svg {
  width: 84%;
  height: 92%;
  fill: none;
}

.cam-guide .g-bust-fill {
  fill: rgba(255, 255, 255, 0.05);
}

.cam-guide .g-bust-line {
  stroke: rgba(255, 255, 255, 0.82);
  stroke-width: 3;
  stroke-dasharray: 10 8;
  stroke-linecap: round;
}

.cam-error {
  position: absolute;
  left: 14px;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 18px 16px;
  border-radius: 16px;
  background: rgba(30, 20, 18, 0.92);
  text-align: center;
}

.cam-error.show {
  display: flex;
}

.cam-error > * + * {
  margin-top: 10px;
}

.cam-error .ic {
  width: 40px;
  height: 40px;
}

.cam-error .e1 {
  font-size: 15px;
  font-weight: 700;
  color: #ff7a6b;
}

.cam-error .e2 {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.6;
}

.cam-error .btn {
  width: 100%;
  height: 46px;
  border-radius: 23px;
  font-size: 14px;
}

/* 扫码弹窗 */

.dialog {
  width: 100%;
  max-width: 430px;
  border-radius: 22px;
  background: rgba(38, 30, 27, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.dialog .dh {
  padding: 16px 18px 12px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dialog .dh .st {
  font-size: 17px;
  font-weight: 800;
}

.dialog .dh .ss {
  margin-top: 5px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
}

.dialog .db {
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dialog .db > * + * {
  margin-top: 12px;
}

.qr-box {
  width: 230px;
  height: 230px;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.qr-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.qr-tip {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.72);
  text-align: center;
  line-height: 1.65;
}

.wait-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.72);
}

.wait-pill > .dot-pulse {
  margin-right: 8px;
}

.dot-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ae3c6;
  animation: pulse 1.1s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% { opacity: 0.25; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.15); }
}

/* 支付浮层 */

.pay-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 24px 20px;
  background: #141010;
  overflow: auto;
}

.pay-body > * + * {
  margin-top: 16px;
}

.pay-topbar {
  flex: none;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: #1b1411;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.pay-topbar .pt {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.72);
}

/* 一体机在屏上展示支付二维码 */
.pay-qr {
  flex: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.pay-qr > * + * {
  margin-top: 14px;
}

.pay-qr img {
  width: 300px;
  height: 300px;
  border-radius: 16px;
  background: #fff;
  padding: 14px;
  box-sizing: border-box;
}

.pay-qr-tip {
  font-size: 17px;
  font-weight: 600;
  color: #fff;
}

.pay-qr-sub {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
}

/* ---------------------------- 收银台浮层 ----------------------------- */

.pc-label {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.72);
}

.pc-amount {
  margin: 6px 0 2px;
  font-size: 46px;
  font-weight: 800;
  letter-spacing: -1px;
  color: #ffffff;
}

.pc-amount small {
  font-size: 22px;
}

.channels {
  width: 100%;
  display: flex;
}

.channels > .channel + .channel {
  margin-left: 10px;
}

.channel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.72);
}

.channel.on {
  border-color: #4ae3c6;
  background: rgba(74, 227, 198, 0.12);
  color: #fff;
}

.channel .ci {
  width: 20px;
  height: 20px;
  margin-right: 8px;
}

.pay-actions {
  width: 100%;
  display: flex;
}

.pay-actions > .btn + .btn {
  margin-left: 12px;
}

.pay-actions .btn {
  flex: 1;
  height: 56px;
  border-radius: 28px;
  font-size: 16px;
}

/* ---------------------------- 生成 / 已生成 --------------------------- */

.result-card {
  border-radius: 20px;
  background: rgba(38, 30, 27, 0.9);
  border: 1px solid rgba(74, 227, 198, 0.18);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  padding: 20px 18px 18px;
  text-align: center;
}

.result-icon {
  width: 62px;
  height: 62px;
  margin: 0 auto 10px;
}

.result-title {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.result-title em {
  font-style: normal;
  color: #4ae3c6;
}

.result-sub {
  margin-top: 7px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.6;
}

.meta-list {
  margin: 14px auto 10px;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.72);
}

.meta-list > .row + .row {
  margin-top: 6px;
}

.meta-list .row {
  display: flex;
  justify-content: center;
}

.meta-list .row > * + * {
  margin-left: 10px;
}

.meta-list .row b {
  color: rgba(255, 255, 255, 0.92);
  font-weight: 600;
}

.progress {
  position: relative;
  height: 11px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  overflow: hidden;
  margin: 14px 6px 8px;
}

.progress .bar {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 0;
  border-radius: 6px;
  background: repeating-linear-gradient(120deg,
      rgba(74, 227, 198, 0.95) 0px,
      rgba(74, 227, 198, 0.95) 10px,
      rgba(74, 227, 198, 0.6) 10px,
      rgba(74, 227, 198, 0.6) 20px);
  background-size: 40px 100%;
  transition: width 0.6s ease;
  animation: stripes 1.2s linear infinite;
}

@keyframes stripes {
  from { background-position: 0 0; }
  to { background-position: 40px 0; }
}

.progress.done .bar {
  background: linear-gradient(90deg, #4ae3c6, #0fb99c);
  animation: none;
}

.progress.fail .bar {
  background: linear-gradient(90deg, #ff8a7a, #e2503c);
  animation: none;
}

.progress-tip {
  font-size: 12.5px;
  color: #4ae3c6;
}

.progress-tip.fail {
  color: #ff8a7a;
}

.media-box {
  position: relative;
  margin: 14px 0 4px;
  border-radius: 14px;
  overflow: hidden;
  background: #10100f;
  height: 315px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.media-box video,
.media-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-box .play-mask {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.18);
}

.media-box .play-mask img {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.media-box .ph {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: rgba(255, 255, 255, 0.4);
  font-size: 12.5px;
}

.media-box .ph > * + * {
  margin-top: 10px;
}

.media-box .ph img {
  width: 84px;
  height: 84px;
  object-fit: contain;
}

/* 出片后：媒体区改为取片二维码（不再内嵌播放器，避免老内核黑屏） */
.media-box.qr-mode {
  height: auto;
  padding: 6px 0 0;
  background: transparent;
  overflow: visible;
  flex-direction: column;
}

.media-box.qr-mode > * + * {
  margin-top: 10px;
}

.qr-plate {
  width: 240px;
  height: 240px;
  padding: 12px;
  border-radius: 14px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.38);
}

.media-box .qr-plate img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.qr-loading {
  padding: 0 10px;
  font-size: 12px;
  line-height: 1.5;
  color: #5b5b5b;
  text-align: center;
}

.qr-cap {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #4ae3c6;
}

.result-qr {
  margin: 12px auto 0;
  width: 190px;
  height: 190px;
  padding: 10px;
  border-radius: 12px;
  background: #fff;
}

.result-qr img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.result-qr-tip {
  margin-top: 8px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.72);
}

.result-actions {
  display: flex;
  margin-top: 16px;
}

.result-actions > .btn + .btn {
  margin-left: 12px;
}

.result-actions .btn {
  flex: 1;
  height: 54px;
  border-radius: 27px;
  font-size: 15.5px;
}

/* ------------------------------- 设置 ------------------------------- */

.settings {
  width: 100%;
  max-width: 430px;
  border-radius: 20px;
  background: rgba(32, 25, 22, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 18px;
}

.settings h3 {
  margin: 0 0 14px;
  font-size: 16px;
}

.field {
  margin-bottom: 12px;
}

.field label {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
}

.field input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 13px;
  outline: none;
}

.field input:focus {
  border-color: #4ae3c6;
}

.settings .sf-foot {
  display: flex;
  margin-top: 16px;
}

.settings .sf-foot > .btn + .btn {
  margin-left: 10px;
}

/* 一体机首次配置用亮色卡片：深色卡片在深色背景上容易被现场当成“黑屏” */
.settings {
  background: #f7f4ef;
  color: #2b2320;
  border-color: rgba(0, 0, 0, 0.08);
}

.settings h3 {
  color: #1f1a17;
}

.settings .field label {
  color: rgba(0, 0, 0, 0.62);
}

.settings .field input {
  border-color: rgba(0, 0, 0, 0.16);
  background: #fff;
  color: #1f1a17;
}

/* ---------------------- 非微信/支付宝环境整页提示 ---------------------- */

.env-block {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 90;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 32px;
  background: #120d0b url("../img/1index_bg1.jpg") center / cover no-repeat;
  text-align: center;
}

.env-block.active {
  display: flex;
}

.env-block .env-ic {
  width: 64px;
  height: 64px;
  color: #4ae3c6;
}

.env-block .env-ic svg {
  width: 100%;
  height: 100%;
}

.env-block .env-t {
  margin-top: 24px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.env-block .env-s {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.66);
}

/* -------------------------------- Toast ------------------------------ */

.toast {
  position: absolute;
  left: 50%;
  bottom: 150px;
  z-index: 60;
  transform: translate(-50%, 20px);
  max-width: 420px;
  padding: 12px 20px;
  border-radius: 12px;
  background: rgba(24, 18, 16, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ==========================================================================
   手机 H5（750 设计宽，按 vw 自适应）
   ========================================================================== */

.h5-body {
  min-height: 100vh;
  height: auto;
  overflow-y: auto;
  background: #2b211c url("../img/5phone_bg.jpg") center / cover fixed no-repeat;
  display: flex;
  flex-direction: column;
  -webkit-user-select: auto;
  user-select: auto;
}

.h5-body::before {
  content: "";
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(180deg, rgba(10, 8, 7, 0.12) 0%, rgba(20, 16, 14, 0.42) 55%, rgba(10, 8, 7, 0.72) 100%);
  pointer-events: none;
}

.h5-top {
  position: relative;
  z-index: 2;
  flex: none;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.94);
  color: #1c1c1c;
}

.h5-top .x {
  width: 26px;
  height: 26px;
  color: #1c1c1c;
}

.h5-top .title {
  font-size: 16px;
  font-weight: 600;
}

.h5-top .more {
  font-size: 20px;
  letter-spacing: 2px;
  color: #1c1c1c;
}

.h5-wrap {
  position: relative;
  z-index: 2;
  flex: 1;
  padding: 14px 16px 30px;
  display: flex;
  flex-direction: column;
}

.h5-wrap > * + * {
  margin-top: 12px;
}

.h5-meta {
  font-size: 13.5px;
  line-height: 1.85;
  color: rgba(255, 255, 255, 0.8);
  padding: 0 4px;
}

.h5-meta b {
  color: #fff;
  font-weight: 600;
}

.h5-card {
  border-radius: 20px;
  padding: 20px 16px;
  background: rgba(38, 30, 27, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
  text-align: center;
}

.h5-card .ic {
  width: 62px;
  height: 62px;
  margin: 0 auto 10px;
}

.h5-card .t {
  font-size: 20px;
  font-weight: 800;
}

.h5-card .t em {
  font-style: normal;
  color: #4ae3c6;
}

.h5-card .s {
  margin-top: 6px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
}

.h5-video {
  margin-top: 16px;
  width: 100%;
  min-height: 240px;
  border-radius: 12px;
  overflow: hidden;
  background: #0d0d0c;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.h5-video video,
.h5-video img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.h5-video .ph {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: rgba(255, 255, 255, 0.42);
  font-size: 13px;
}

.h5-video .ph img {
  width: 78px;
  height: 78px;
  object-fit: contain;
  margin-bottom: 10px;
}

/* 成片封面：放在页面最上方，尺寸收小并在上方留白；点击后原位播放 */
.h5-hero {
  display: flex;
  justify-content: center;
  padding: 22px 0 4px;
}

.h5-hero-media {
  position: relative;
  width: 64%;
  max-width: 238px;
  height: 0;
  /* 默认 3:4，视频元数据就绪后由脚本按真实长宽比改写 */
  padding-top: 133.33%;
  border-radius: 14px;
  overflow: hidden;
  background: #0d0d0c;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.42);
}

.h5-hero-media video,
.h5-hero-media img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.h5-hero-play {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.16) 0%, rgba(0, 0, 0, 0.52) 100%);
  color: #fff;
  font-size: 13px;
  letter-spacing: 1px;
}

.h5-hero-play svg {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  border: 2px solid rgba(255, 255, 255, 0.7);
}

.h5-hero-play span {
  margin-top: 10px;
}

.h5-btn {
  margin-top: 16px;
  width: 100%;
  height: 52px;
  border-radius: 26px;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.h5-btn .ci {
  width: 20px;
  height: 20px;
  margin-right: 8px;
}

/* 微信/支付宝内置浏览器不支持直接下载，点按钮时给出保存提示 */
.h5-save-tip {
  display: none;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  line-height: 1.6;
  text-align: left;
}

/* 微信里长按视频可保存，禁掉触摸回调屏蔽 */
.h5-hero-media video {
  -webkit-touch-callout: default;
}

/* 出片后：下载按钮紧跟视频下方 */
.h5-cta {
  margin: 4px 0 16px;
}

.h5-cta .h5-btn {
  margin-top: 0;
}

.h5-note {
  position: relative;
  z-index: 2;
  flex: none;
  padding: 26px 0 30px;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}

/* H5 上传 */

.h5-upload-slot {
  width: 100%;
  min-height: 200px;
  border-radius: 16px;
  border: 2px dashed rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13.5px;
}

.h5-upload-slot > * + * {
  margin-top: 10px;
}

.h5-upload-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.h5-upload-slot svg {
  width: 46px;
  height: 46px;
  opacity: 0.7;
}

.h5-upload-actions {
  display: flex;
  margin-top: 14px;
}

.h5-upload-actions > .h5-btn + .h5-btn {
  margin-left: 10px;
}

.h5-upload-actions .h5-btn {
  margin-top: 0;
  flex: 1;
}

/* 视觉隐藏（不能用 display:none，iOS 微信下会导致 input 无法被点击唤起） */
.h5-file {
  position: absolute;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.h5-hint {
  margin-top: 12px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.7;
  text-align: center;
}

/* H5 我的订单 */

.h5-orders {
  display: flex;
  flex-direction: column;
}

.h5-orders > * + * {
  margin-top: 12px;
}

.h5-order-item {
  display: flex;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  background: rgba(38, 30, 27, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
  color: #fff;
  text-decoration: none;
}

.h5-order-item .thumb {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.h5-order-item .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.h5-order-item .info {
  flex: 1;
  min-width: 0;
  margin-left: 12px;
}

.h5-order-item .name {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.h5-order-item .sub {
  margin-top: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

.h5-order-item .right {
  flex: none;
  margin-left: 10px;
  text-align: right;
}

.h5-order-item .amt {
  font-size: 15px;
  font-weight: 700;
  color: #f2c884;
}

.h5-order-item .st {
  margin-top: 6px;
  font-size: 12px;
}

.h5-order-item .st.ok { color: #4ae3c6; }
.h5-order-item .st.warn { color: #f2c884; }
.h5-order-item .st.muted { color: rgba(255, 255, 255, 0.55); }

/* H5 支付页金额与「我的订单」入口 */

.h5-pay-amount {
  margin-top: 14px;
  font-size: 34px;
  font-weight: 800;
  color: #f2c884;
}

.h5-me-link {
  text-align: right;
  font-size: 13px;
}

.h5-me-link a {
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
}

