/* 全屏支付小票 v14 — 收银台流程：3D打印机 → 小票倒序打印 → 盖章 → 完成 */
.rc14 {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #0a0d13;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.rc14.rc14-in { opacity: 1; }

/* 场景 */
.rc14-scene {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 12vh;
  overflow: hidden;
}

/* 打印机 */
.rc14-printer {
  position: relative;
  width: 300px;
  background: linear-gradient(180deg, #2c333d, #1b212a);
  border-radius: 16px 16px 6px 6px;
  padding: 12px 18px;
  box-shadow: 0 18px 36px rgba(0,0,0,0.5);
  z-index: 2;
  display: flex;
  align-items: center;
}
.rc14-printerTop {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
}
.rc14-led {
  width: 7px; height: 7px; border-radius: 50%;
  background: #43d17c;
  box-shadow: 0 0 7px #43d17c;
  animation: rc14Led 0.8s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes rc14Led { 0%,100% { opacity: 1; } 50% { opacity: 0.2; } }
.rc14-status { font-size: 11px; color: #9aa3ad; letter-spacing: 1.5px; }
.rc14-model { margin-left: auto; font-size: 10px; color: #5d6672; letter-spacing: 1px; }
.rc14-closeRow {
  width: 26px; height: 26px;
  margin-left: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.1);
  color: #cdd5df;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.rc14-closeRow:active { background: rgba(255,255,255,0.22); }
.rc14-slot {
  height: 7px;
  margin: 10px -6px -12px;
  background: #05070a;
  border-radius: 0 0 6px 6px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.95);
}
.rc14.rc14-printing .rc14-printer { animation: rc14Shake 0.18s linear infinite; }
.rc14.rc14-done .rc14-printer { animation: none; }
.rc14.rc14-done .rc14-led { animation: none; background: #57c785; }
@keyframes rc14Shake {
  0% { transform: translateY(0); }
  50% { transform: translateY(0.6px); }
  100% { transform: translateY(0); }
}

/* 出纸窗口：从出纸口向下生长，纸底边跟随 → 内容自下而上显现 */
.rc14-window {
  width: 300px;
  height: 0;
  overflow: hidden;
  transition: height 3s cubic-bezier(0.25, 0.9, 0.3, 1);
  position: relative;
  z-index: 1;
}
.rc14-scan {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 4px;
  background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,0.14));
  opacity: 0;
  pointer-events: none;
  z-index: 5;
}
.rc14.rc14-printing .rc14-scan { opacity: 1; }
.rc14.rc14-done .rc14-scan { opacity: 0; }

/* 纸张：底边锚定在窗口底部 */
.rc14-paper {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, #fffdf8, #fbf7ee);
  color: #33322e;
  padding: 18px 16px 10px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, "Courier New", monospace;
  font-size: 12.5px;
  line-height: 1.8;
  box-shadow: 0 14px 28px rgba(0,0,0,0.35);
  transform-origin: top center;
}
.rc14.rc14-printing .rc14-paper { animation: rc14Sway 1.6s ease-in-out infinite alternate; }
.rc14.rc14-done .rc14-paper { animation: none; }
@keyframes rc14Sway {
  from { transform: rotate(-0.4deg); }
  to { transform: rotate(0.4deg); }
}

/* 行：自下而上阶梯出现（JS 按倒序赋 delay） */
.rc14-line { opacity: 0; transform: translateY(4px); }
.rc14.rc14-printing .rc14-line { animation: rc14LineIn 0.3s ease-out forwards; }
@keyframes rc14LineIn { to { opacity: 1; transform: translateY(0); } }

.rc14-center { text-align: center; }
.rc14-shopLogo { display: block; max-width: 70%; height: auto; margin: 0 auto 2px; }
.rc14-sub { font-size: 10.5px; color: #8a8478; letter-spacing: 2px; }
.rc14-dash { border-top: 1.5px dashed #c3bcae; margin: 8px 0; height: 0; }
.rc14-row { display: flex; justify-content: space-between; gap: 10px; }
.rc14-total { font-weight: 700; font-size: 14px; }
.rc14-codebox {
  position: relative;
  background: #f5f1e7;
  border: 1.5px dashed #c9c2b0;
  border-radius: 6px;
  padding: 6px 8px;
  margin: 8px 0 2px;
}
.rc14-code { text-align: center; font-weight: 700; letter-spacing: 0.5px; word-break: break-all; padding-right: 52px; }
.rc14-copy {
  position: absolute;
  top: 50%; right: 6px;
  transform: translateY(-50%);
  border: none;
  background: #e8e2d2;
  color: #6b6353;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
}
.rc14-copy.rc14-copied { background: #43d17c; color: #fff; }
.rc14-thanks { margin-top: 6px; }

/* 纸张：底边为 JS 生成的锯齿 clip-path */

/* 条形码 */
.rc14-qrLine { display: flex; justify-content: center; margin: 8px 0 2px; }
.rc14-bcImg { width: 190px; height: auto; display: block; }

/* 红色已支付印章 v2（盖在条形码上）：对准-一顿-猛盖 + 落影 + 墨点 + 波纹 */
.rc14-stampWrap {
  position: absolute;
  right: 0;
  left: auto;
  bottom: 116px;
  width: 96px;
  height: 96px;
  perspective: 340px;
  pointer-events: none;
}
.rc14-stamp {
  width: 100%;
  height: 100%;
  opacity: 0;
  transform-origin: center 62%;
  transform: translateY(-96px) scale(1.45) rotateX(60deg) rotate(-18deg);
  will-change: transform;
}
.rc14.rc14-stamped .rc14-stamp { animation: rc14Stamp3d 0.9s cubic-bezier(0.2, 0.75, 0.3, 1) forwards; }
@keyframes rc14Stamp3d {
  0%   { opacity: 0; transform: translateY(-96px) scale(1.45) rotateX(60deg) rotate(-18deg); }
  36%  { opacity: 1; transform: translateY(-14px) scale(1.03) rotateX(14deg) rotate(-12deg); }
  50%  { transform: translateY(-30px) scale(1.07) rotateX(24deg) rotate(-14deg); }
  66%  { transform: translateY(0) scale(0.9) rotateX(2deg) rotate(-9deg); }
  78%  { transform: translateY(0) scale(1.05) rotateX(-2deg) rotate(-11.5deg); }
  100% { opacity: 0.94; transform: translateY(0) scale(1) rotateX(0deg) rotate(-10deg); }
}
/* 落影 */
.rc14-stampShadow {
  position: absolute;
  right: 4px;
  left: auto;
  bottom: 108px;
  width: 86px;
  height: 15px;
  background: radial-gradient(ellipse at center, rgba(22, 12, 6, 0.45), transparent 70%);
  border-radius: 50%;
  opacity: 0;
  transform: translateY(-60px) scaleX(1.8);
  pointer-events: none;
}
.rc14.rc14-stamped .rc14-stampShadow { animation: rc14Shadow 0.9s ease-out forwards; }
@keyframes rc14Shadow {
  0%   { opacity: 0; transform: translateY(-60px) scaleX(1.8); }
  36%  { opacity: 0.3; transform: translateY(-10px) scaleX(1.12); }
  50%  { opacity: 0.16; transform: translateY(-22px) scaleX(1.3); }
  66%  { opacity: 0.5; transform: translateY(0) scaleX(1); }
  100% { opacity: 0.3; transform: translateY(0) scaleX(1); }
}
/* 油墨波纹 */
.rc14-inkRipple {
  position: absolute;
  right: -10px;
  left: auto;
  bottom: 100px;
  width: 112px;
  height: 112px;
  border: 2px solid rgba(207, 47, 40, 0.55);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}
.rc14.rc14-stamped .rc14-inkRipple { animation: rc14Ink 0.7s 0.6s ease-out forwards; }
@keyframes rc14Ink {
  0% { opacity: 0.75; transform: scale(0.5); }
  100% { opacity: 0; transform: scale(1.3); }
}
/* 墨点飞溅 */
.rc14-splat {
  position: absolute;
  border-radius: 50%;
  background: #cf2f28;
  opacity: 0;
  pointer-events: none;
}
.rc14.rc14-stamped .rc14-splat { animation: rc14Splat 0.55s ease-out forwards; }
@keyframes rc14Splat {
  0% { opacity: 0.95; transform: scale(0.2); }
  45% { opacity: 0.9; transform: scale(1); }
  100% { opacity: 0.5; transform: scale(1); }
}
/* 纸张受压微瘪 */
.rc14.rc14-stamped .rc14-paperHit { animation: rc14Hit 0.45s 0.58s ease-out; }
@keyframes rc14Hit {
  0% { transform: translateY(0) scale(1, 1); }
  30% { transform: translateY(2.5px) scale(1.006, 0.988); }
  60% { transform: translateY(-1px) scale(0.998, 1.004); }
  100% { transform: translateY(0) scale(1, 1); }
}

@media (max-width: 360px) {
  .rc14-printer, .rc14-window { width: 280px; }
}
/* 撕下 → 揉团 → 抛走 */
.rc14.rc14-done .rc14-paper.rc14-paperPull { animation: rc14Pull 0.15s ease-out forwards; }
@keyframes rc14Pull {
  to { transform: translateY(9px); }
}
.rc14.rc14-done .rc14-paper.rc14-crumpling { animation: rc14Crumple 0.34s cubic-bezier(0.6, 0.05, 0.7, 0.4) forwards; }
@keyframes rc14Crumple {
  0% { transform: translateY(9px) scale(1, 1) rotate(0deg); border-radius: 0; }
  55% { transform: translateY(16px) scale(0.5, 0.42) rotate(6deg); border-radius: 18px; }
  100% { transform: translateY(20px) scale(0.3) rotate(14deg); border-radius: 50%; opacity: 0.98; }
}
.rc14.rc14-done .rc14-paper.rc14-tossing { animation: rc14Toss 0.68s cubic-bezier(0.3, 0.6, 0.4, 1) forwards; }
@keyframes rc14Toss {
  0% { transform: translateY(20px) scale(0.3) rotate(14deg); opacity: 0.98; }
  35% { transform: translate(70px, -90px) scale(0.3) rotate(160deg); opacity: 1; }
  70% { transform: translate(190px, -30px) scale(0.3) rotate(300deg); opacity: 1; }
  100% { transform: translate(330px, 210px) scale(0.28) rotate(430deg); opacity: 0; }
}
.rc14.rc14-shredding .rc14-printer { animation: rc14Jolt2 0.3s 0.15s ease-out; }
@keyframes rc14Jolt2 {
  0% { transform: translateY(0); }
  30% { transform: translateY(-3px); }
  65% { transform: translateY(1.2px); }
  100% { transform: translateY(0); }
}
.rc14.rc14-shredding .rc14-led { animation: rc14LedFast2 0.14s linear 4; }
@keyframes rc14LedFast2 { 0%, 100% { opacity: 1; } 50% { opacity: 0.15; } }
.rc14.rc14-out { opacity: 0; transition: opacity 0.45s ease; pointer-events: none; }