/* ============================================================
   扭扭机前台样式 v4 —— 紫色梦幻 / 3D 立体 / 毛玻璃 / 扭蛋动画
   设计要点：多层渐变模拟体积、强高光与内阴影、椭圆地面投影
   ============================================================ */
:root {
  --purple: #7a5cff;
  --purple-deep: #5b3fd6;
  --violet: #8b5cf6;
  --magenta: #d946ef;
  --pink: #ec4899;
  --pink-soft: #f9a8d4;
  --indigo: #6366f1;
  --gold: #fbbf24;
  --gold-light: #fde68a;
  --text-dark: #211d33;   /* 近黑色，替代浅黄文字，提升对比度 */
  --ink: #4c2f8f;
  --muted: #a99fd0;
  --white: #ffffff;
  --night-1: #2e1065;
  --night-2: #3b1678;
  --night-3: #4c1d95;
  --glass-bg: rgba(255, 255, 255, .16);
  --glass-line: rgba(255, 255, 255, .42);
  --card-bg: linear-gradient(160deg, rgba(76, 29, 149, .42), rgba(46, 16, 101, .30));
  --radius: 20px;
  --shadow: 0 14px 34px rgba(46, 16, 101, .28);
  --ease: cubic-bezier(.22, .68, .28, 1);

  /* 粉色卡通扭蛋机配色（v5） */
  --candy: #ffb9d6;
  --candy-deep: #ff8fbb;
  --candy-light: #ffd9e8;
  --candy-soft: #ffeef5;
  --candy-shade: #f47fae;
  --candy-knob: #b6a0ee;
  --candy-knob-deep: #9a82dd;
  --candy-cream: #f7e6c4;
  --candy-cream-line: #e3c99a;

  /* 手绘奶油风配色（v5.4） */
  --hd-cream: #fbf3e4;      /* 机身奶油米白 */
  --hd-cream-2: #f4e7d2;    /* 略深奶油 */
  --hd-line: #8a5a3b;       /* 深棕手绘描边 */
  --hd-line-soft: #b08a6c;  /* 浅棕描边 */
  --hd-pink: #f8bdc9;       /* 手绘粉 */
  --hd-pink-deep: #ef93a8;
  --hd-yellow: #f8da8c;     /* 手绘黄 */
  --hd-purple: #ccbcf0;     /* 手绘紫 */
  --hd-orange: #f5bb8c;     /* 手绘橙 */
  --hd-mint: #bfe3d2;       /* 手绘薄荷 */
  --hd-shadow: rgba(120, 80, 50, .16);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { min-height: 100%; }
body {
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 4%, rgba(232, 191, 255, .95), transparent 44%),
    radial-gradient(circle at 88% 10%, rgba(165, 180, 252, .92), transparent 42%),
    radial-gradient(circle at 50% 98%, rgba(244, 172, 232, .85), transparent 52%),
    linear-gradient(160deg, #b9a7f5 0%, #cdb4fb 40%, #ecaef7 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
img { display: block; }
button { font-family: inherit; }

.page { position: relative; max-width: 480px; margin: 0 auto; padding: 14px 16px 40px; z-index: 2; }

/* ============ 毛玻璃 ============ */
.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid var(--glass-line);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .5);
}

/* ============ 背景装饰 ============ */
.bg-decor { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.bubble {
  position: absolute; bottom: -60px; border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, rgba(255, 255, 255, .85), rgba(255, 255, 255, .12));
  border: 1px solid rgba(255, 255, 255, .4);
  will-change: transform;
  animation: rise linear infinite;
}
.b1 { left: 8%;  width: 26px; height: 26px; animation-duration: 13s; }
.b2 { left: 24%; width: 14px; height: 14px; animation-duration: 9s;  animation-delay: 2s; }
.b3 { left: 46%; width: 34px; height: 34px; animation-duration: 16s; animation-delay: 1s; }
.b4 { left: 66%; width: 18px; height: 18px; animation-duration: 11s; animation-delay: 3s; }
.b5 { left: 80%; width: 28px; height: 28px; animation-duration: 14s; animation-delay: 0s; }
.b6 { left: 92%; width: 12px; height: 12px; animation-duration: 8s;  animation-delay: 4s; }
@keyframes rise {
  0% { transform: translateY(0) scale(1); opacity: 0; }
  12% { opacity: .9; }
  100% { transform: translateY(-110vh) scale(1.15); opacity: 0; }
}
.spark {
  position: absolute; width: 14px; height: 14px;
  background: radial-gradient(circle, #fff 0%, rgba(255, 255, 255, .2) 70%, transparent);
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  animation: twinkle 2.6s ease-in-out infinite;
}
.s1 { left: 16%; top: 12%; }
.s2 { left: 82%; top: 24%; animation-delay: .8s; }
.s3 { left: 30%; top: 60%; animation-delay: 1.4s; }
.s4 { left: 72%; top: 68%; animation-delay: 2s; }
@keyframes twinkle { 0%, 100% { opacity: .25; transform: scale(.7); } 50% { opacity: 1; transform: scale(1.15); } }

/* ============ 顶部导航 ============ */
.top-nav {
  display: flex; align-items: center; justify-content: space-between;
  border-radius: 16px; padding: 10px 14px; margin-bottom: 18px;
}
.nav-brand { display: flex; align-items: center; gap: 9px; }
.nav-logo {
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  font-size: 17px; font-weight: 900; color: #fff;
  background: linear-gradient(145deg, #9b7cff, var(--night-3));
  box-shadow: inset 0 1px 2px rgba(255,255,255,.6), 0 4px 10px rgba(46,16,101,.4);
}
.nav-name { font-size: 15px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px rgba(46,16,101,.5); }
.nav-user { display: flex; gap: 8px; }
.nav-link {
  font-size: 13px; font-weight: 800; color: #fff; padding: 7px 13px; border-radius: 10px;
  background: rgba(122, 92, 255, .55); border: 1px solid rgba(255, 255, 255, .38);
}
.nav-link.ghost { background: rgba(255, 255, 255, .22); }

/* ============ 扭扭机切换器 ============ */
.machine-switch {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid var(--glass-line); border-radius: 14px; padding: 8px 10px;
}
.ms-label { font-size: 12px; font-weight: 900; color: #fff; text-shadow: 0 1px 2px rgba(46,16,101,.5); flex-shrink: 0; }
.ms-scroll { display: flex; gap: 8px; overflow-x: auto; flex: 1; padding-bottom: 2px; }
.ms-scroll::-webkit-scrollbar { height: 4px; }
.ms-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.5); border-radius: 4px; }
.ms-pill {
  flex-shrink: 0; padding: 7px 16px; border-radius: 999px; font-size: 13px; font-weight: 900;
  color: #fff; background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.35);
  text-shadow: 0 1px 2px rgba(46,16,101,.5); transition: transform .15s var(--ease), background .15s;
}
.ms-pill:active { transform: scale(.95); }
.ms-pill.on {
  background: linear-gradient(120deg, var(--magenta), var(--purple));
  border-color: rgba(255,255,255,.6);
  box-shadow: 0 6px 16px rgba(122,92,255,.45);
}

/* ============ 子页面标题（查单 / 登录 / 订单；首页不使用） ============ */
.hero { text-align: center; margin: 6px 0 18px; }
.hero-title {
  font-weight: 900; line-height: 1.2; color: #fff;
  text-shadow: 0 2px 5px rgba(46, 16, 101, .55), 0 1px 0 rgba(255, 255, 255, .28);
}
.hero-sub {
  margin-top: 7px; font-size: 13px; font-weight: 700; color: #f1e9ff;
  text-shadow: 0 1px 2px rgba(46, 16, 101, .5);
}

/* ============ 立式自动售货机（v5.3：奶油色机身 / 左商品橱窗 / 右套餐按钮） ============ */
.machine-stage {
  display: flex; justify-content: center; margin: 12px 0 22px;
  animation: stageFloat 4.6s ease-in-out infinite;
}
@keyframes stageFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

.vending {
  position: relative; width: 320px;
  border-radius: 30px 28px 30px 28px;
  background: linear-gradient(170deg, #fdf8ee 0%, var(--hd-cream) 55%, var(--hd-cream-2) 100%);
  border: 2.5px solid var(--hd-line);
  box-shadow:
    0 12px 24px var(--hd-shadow),
    inset 0 0 0 5px rgba(255,255,255,.5);
}

/* 顶部品牌灯牌（手绘描边） */
.vm-top {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  margin: 14px 16px 0; padding: 9px 12px;
  border-radius: 17px 15px 17px 15px;
  background: linear-gradient(180deg, #fffaf0, #fbeeda);
  border: 2px solid var(--hd-line);
  box-shadow: 0 3px 8px var(--hd-shadow), inset 0 1px 2px rgba(255,255,255,.9);
}
.vm-title { font-size: 15px; font-weight: 900; color: var(--hd-line); letter-spacing: 1px; }
.vm-star {
  flex-shrink: 0; width: 15px; height: 15px; background: var(--hd-yellow);
  clip-path: polygon(50% 0,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%);
  filter: drop-shadow(0 1px 0 rgba(138,90,59,.45));
}

/* 机身：左右分栏 */
.vm-body { display: flex; gap: 10px; padding: 12px 14px; }

/* 左侧商品橱窗（手绘框） */
.vm-window { flex: 1.55; min-width: 0; }
.vm-glass {
  height: 100%; min-height: 262px; border-radius: 18px 17px 18px 17px; padding: 11px 10px;
  background: linear-gradient(160deg, #fffaf0, #f7ecdb);
  border: 2.5px solid var(--hd-line);
  box-shadow: inset 0 2px 5px rgba(138,90,59,.12), 0 4px 9px var(--hd-shadow);
}
.vm-shelves { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 9px; }
.vm-goods { display: flex; flex-direction: column; align-items: center; gap: 5px; }

/* 包装主体：手绘描边 + 奶油填充 */
.vm-gface {
  position: relative; width: 100%; height: 56px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #fff, #fdf0dc);
  border: 2px solid var(--hd-line);
  border-radius: 12px 12px 14px 14px;
  box-shadow: 0 2px 5px var(--hd-shadow), inset 0 1px 2px rgba(255,255,255,.9);
}
.vm-gimg { position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; border-radius: inherit; padding: 5px; z-index: 2; }
.vm-gemoji { font-size: 26px; line-height: 1; z-index: 1;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.12)); }
.vm-gname { font-size: 10px; font-weight: 800; color: var(--hd-line);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vm-empty { grid-column: 1 / -1; text-align: center; font-size: 12px;
  font-weight: 800; color: var(--hd-line-soft); padding: 32px 0; }

/* 五种手绘包装形态：袋子 / 盒子 / 罐子 / 小袋 / 罐头 */
.pack-bag .vm-gface { border-radius: 8px 8px 16px 16px; background: linear-gradient(180deg,#ffe9d6,#fcd9bd); }
.pack-bag .vm-gface::before { content:""; position:absolute; left:2px; top:8px; width:calc(100% - 4px); height:2px; background: var(--hd-line-soft); border-radius:2px; }

.pack-box .vm-gface { border-radius: 7px; background: linear-gradient(180deg,#eef4ff,#dde7fb); }
.pack-box .vm-gface::before { content:""; position:absolute; left:0; top:13px; width:100%; height:2px; background: var(--hd-line-soft); }

.pack-jar .vm-gface { border-radius: 14px 14px 16px 16px; background: linear-gradient(180deg,#fdeef2,#f9d8e0); }
.pack-jar .vm-gface::before { content:""; position:absolute; left:6px; top:-7px; width:calc(100% - 12px); height:8px; background: var(--hd-pink-deep); border:2px solid var(--hd-line); border-radius:6px; box-sizing:border-box; }

.pack-pouch .vm-gface { border-radius: 16px; background: linear-gradient(180deg,#eafaf1,#d3f0e0); }

.pack-tin .vm-gface { border-radius: 10px; background: linear-gradient(180deg,#f6f0da,#ece0c2); }
.pack-tin .vm-gface::before, .pack-tin .vm-gface::after { content:""; position:absolute; left:0; width:100%; height:5px; background: var(--hd-line-soft); }
.pack-tin .vm-gface::before { top:0; border-radius: 8px 8px 0 0; }
.pack-tin .vm-gface::after { bottom:0; border-radius: 0 0 8px 8px; }

/* 右侧套餐按钮列（可上下滑动 + 垂直进度条） */
.vm-keys-wrap { flex: 1; min-width: 0; display: flex; gap: 6px; }
.vm-keys {
  flex: 1; min-width: 0; max-height: 286px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 9px; padding: 2px 2px 4px;
  scrollbar-width: none;
}
.vm-keys::-webkit-scrollbar { display: none; }

/* 进度条轨道与滑块（JS 控制滑块位置） */
.vm-keys-track {
  flex-shrink: 0; position: relative; width: 6px; align-self: stretch;
  border-radius: 6px; background: rgba(138,90,59,.14); border: 1px solid rgba(138,90,59,.2);
}
.vm-keys-thumb {
  position: absolute; left: 0; top: 0; width: 100%; min-height: 18px;
  border-radius: 6px; background: var(--hd-line-soft);
}

.vm-key {
  position: relative; width: 100%; cursor: pointer; text-align: center;
  border-radius: 14px 13px 14px 13px; padding: 9px 8px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--hd-line); border: 2px solid var(--hd-line);
  background: linear-gradient(160deg, #fde3ea, var(--hd-pink));
  box-shadow: 0 3px 6px var(--hd-shadow), inset 0 1px 2px rgba(255,255,255,.7);
  transition: transform .15s var(--ease), box-shadow .15s var(--ease);
}
/* 高优先级覆盖 .pkg-card 的横向 flex-basis：纵向按钮高度由内容决定 */
.vm-keys .vm-key { flex: 0 0 auto; }
.vm-key:nth-child(3n+2) { background: linear-gradient(160deg,#e6ddfb,var(--hd-purple)); }
.vm-key:nth-child(3n+3) { background: linear-gradient(160deg,#fdeecb,var(--hd-yellow)); }
.vm-key:nth-child(3n+4) { background: linear-gradient(160deg,#fde6d2,var(--hd-orange)); }
.vm-key:nth-child(3n+5) { background: linear-gradient(160deg,#dff3e8,var(--hd-mint)); }
.vm-key:active { transform: scale(.96); }
.vm-key.active {
  transform: translateY(-2px);
  box-shadow: 0 0 0 3px rgba(255,255,255,.85), 0 6px 10px var(--hd-shadow);
}
.vm-key.active::after {
  content: "✓"; position: absolute; right: 5px; top: 5px; width: 17px; height: 17px;
  background: var(--hd-line); color: #fff; border-radius: 50%;
  font-size: 11px; line-height: 17px; font-weight: 900;
}
.vm-key-tag { font-size: 9px; font-weight: 800; padding: 1px 7px; border-radius: 8px;
  background: rgba(255,255,255,.6); border: 1px solid var(--hd-line-soft); color: var(--hd-line); }
.vm-key-name { font-size: 12px; font-weight: 900; color: var(--hd-line);
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vm-key-price { font-size: 16px; font-weight: 900; color: var(--hd-line); }
.vm-key-price em { font-size: 10px; font-style: normal; margin-right: 1px; }

/* 底部出货口（手绘） */
.vm-bottom { padding: 2px 14px 16px; display: flex; justify-content: center; }
.out-slot { position: relative; display: flex; justify-content: center; width: 100%; }
.out-door {
  width: 130px; height: 44px; border-radius: 14px 13px 14px 13px;
  background: linear-gradient(180deg,#fdf3e3,#f3e0c4);
  border: 2px solid var(--hd-line);
  box-shadow: inset 0 3px 6px rgba(138,90,59,.18), 0 2px 5px var(--hd-shadow);
}

/* 出货口掉落的球（JS 触发） */
.drop-ball {
  position: absolute; top: -8px; left: 50%; margin-left: -14px;
  width: 28px; height: 28px; border-radius: 50%; z-index: 9;
  background: radial-gradient(circle at 34% 30%,#ffe1ed,#ff9ec4 62%,#f076ac);
  box-shadow: 0 4px 8px rgba(0,0,0,.22); opacity: 0;
}

/* 提交动画：机身轻晃 + 出货口掉球 */
.vending.shake { animation: machineShake .5s ease-in-out 2; }
@keyframes machineShake {
  0%,100% { transform: translateX(0) rotate(0); }
  25% { transform: translateX(-2px) rotate(-.5deg); }
  75% { transform: translateX(2px) rotate(.5deg); }
}
.vending.shake .drop-ball { animation: ballDrop .9s ease-in .15s forwards; }
@keyframes ballDrop {
  0% { transform: translateY(-16px); opacity: 0; }
  30% { opacity: 1; }
  75% { transform: translateY(24px); opacity: 1; }
  100% { transform: translateY(22px); opacity: 1; }
}

/* ============ 下单失败提示条 ============ */
.order-error {
  border-radius: 14px; padding: 12px 16px; margin-bottom: 14px;
  font-size: 13px; font-weight: 700; color: #fff; line-height: 1.6;
  background: linear-gradient(140deg, rgba(244, 63, 94, .9), rgba(190, 24, 93, .85));
  border: 1px solid rgba(255, 255, 255, .4);
  box-shadow: 0 10px 22px rgba(190, 24, 93, .3);
  animation: popIn .35s var(--ease);
}

/* ============ 轮播公告 ============ */
.notice-marquee {
  display: flex; align-items: center; gap: 10px;
  border-radius: 14px; padding: 10px 14px; margin-bottom: 16px; overflow: hidden;
}
.notice-ico {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; font-weight: 900; color: #fff;
  background: linear-gradient(140deg, var(--magenta), var(--purple));
}
.notice-viewport { position: relative; flex: 1; height: 22px; overflow: hidden; }
.notice-item {
  position: absolute; inset: 0; display: flex; align-items: center;
  font-size: 13px; font-weight: 700; color: #fff;
  text-shadow: 0 1px 2px rgba(46, 16, 101, .55);
  white-space: nowrap; opacity: 0; transform: translateY(12px);
  transition: opacity .4s, transform .4s;
}
.notice-item.on { opacity: 1; transform: translateY(0); }

/* ============ 面板 ============ */
.panel { border-radius: var(--radius); padding: 16px 14px; margin-bottom: 14px; }
.panel-title {
  font-size: 15px; font-weight: 900; margin-bottom: 13px; color: #fff;
  display: flex; align-items: center; gap: 8px;
  text-shadow: 0 1px 2px rgba(46, 16, 101, .5);
}
.panel-title::before {
  content: ""; width: 6px; height: 16px; border-radius: 4px;
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  box-shadow: 0 0 8px rgba(251, 191, 36, .7);
}

/* 套餐横向并列：深色通透玻璃，去除发白蒙版 */
.pkg-row {
  display: flex; gap: 11px; overflow-x: auto; padding: 2px 2px 10px;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
}
.pkg-row::-webkit-scrollbar { height: 5px; }
.pkg-row::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .55); border-radius: 4px; }
/* v5.1 套餐卡整体缩小、更紧凑 */
.pkg-card {
  flex: 0 0 46%; scroll-snap-align: center; position: relative;
  border: 2px solid rgba(255, 255, 255, .35); border-radius: 14px;
  padding: 10px 9px; text-align: center; cursor: pointer;
  color: #fff; background: var(--card-bg);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 7px 14px rgba(46,16,101,.2);
  transition: transform .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.pkg-card.active {
  border-color: var(--gold); transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(46, 16, 101, .38), 0 0 0 3px rgba(251, 191, 36, .35),
    inset 0 1px 0 rgba(255,255,255,.4);
}
.pkg-card.active::after {
  content: "✓"; position: absolute; right: 7px; top: 7px; width: 19px; height: 19px;
  background: var(--gold); color: #fff; border-radius: 50%;
  font-size: 12px; line-height: 19px;
}
.pkg-name {
  font-size: 14px; font-weight: 900; color: #fff;
  text-shadow: 0 1px 3px rgba(46, 16, 101, .7);
}
.pkg-tag {
  display: inline-block; margin: 5px 0 4px; font-size: 10px; font-weight: 800;
  padding: 2px 8px; border-radius: 10px; border: 1px solid rgba(255,255,255,.4);
}
.tag-random { background: rgba(236, 72, 153, .4); color: #fff; }
.tag-fixed { background: rgba(251, 191, 36, .4); color: #fff; }
.pkg-price {
  font-size: 19px; font-weight: 900; color: #fff;
  text-shadow: 0 2px 5px rgba(46, 16, 101, .7);
}
.pkg-price em { font-size: 11px; font-style: normal; margin-right: 1px; }
.pkg-desc { margin-top: 4px; font-size: 10px; color: #ecdfff; line-height: 1.45; }
.pkg-eggs { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.egg-chip {
  display: flex; align-items: center; gap: 6px; text-align: left;
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255,255,255,.25);
  border-radius: 9px; padding: 5px 7px;
}
.egg-chip img { width: 22px; height: 22px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.egg-chip b {
  font-size: 11px; font-weight: 800; color: #fff; flex: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-shadow: 0 1px 2px rgba(46,16,101,.6);
}
.egg-chip i { font-size: 10px; font-style: normal; color: #f0e7ff; flex-shrink: 0; }

/* 随机套餐：扭蛋次数步进器 */
.qty-box {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 14px; padding: 10px 12px; border-radius: 14px;
  background: rgba(46, 16, 101, .28); border: 1px solid rgba(255,255,255,.3);
}
.qty-box.is-hidden { display: none; }
.qty-label { font-size: 13px; font-weight: 800; color: #fff; text-shadow: 0 1px 2px rgba(46,16,101,.5); }
.qty-stepper { display: flex; align-items: center; gap: 10px; }
.qty-btn {
  width: 34px; height: 34px; border-radius: 10px; cursor: pointer;
  font-size: 18px; font-weight: 900; line-height: 1; color: #fff;
  border: 1px solid rgba(255,255,255,.4);
  background: linear-gradient(145deg, #9b7cff, var(--night-3));
  box-shadow: inset 0 1px 2px rgba(255,255,255,.5), 0 4px 8px rgba(46,16,101,.35);
  transition: transform .12s var(--ease);
}
.qty-btn:active { transform: scale(.92); }
.qty-num {
  width: 52px; height: 36px; text-align: center; font-size: 16px; font-weight: 900;
  color: #fff; background: transparent; border: none;
  text-shadow: 0 1px 3px rgba(46,16,101,.6);
}

/* 输入框 */
.text-input {
  width: 100%; height: 46px; border: 1.5px solid rgba(255, 255, 255, .5); border-radius: 13px;
  padding: 0 14px; font-size: 14px; font-weight: 600; color: var(--night-3);
  background: rgba(255, 255, 255, .72);
}
.text-input::placeholder { color: #9a8fc0; }
.text-input:focus {
  outline: none; border-color: var(--gold); background: rgba(255, 255, 255, .92);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, .25);
}

/* 支付方式 */
.pay-row { display: flex; flex-wrap: wrap; gap: 10px; }
.pay-card {
  display: flex; align-items: center; gap: 7px;
  border: 2px solid rgba(255, 255, 255, .45); border-radius: 13px;
  padding: 9px 13px; background: rgba(255, 255, 255, .24);
  cursor: pointer; font-size: 13px; font-weight: 800; color: #fff;
  text-shadow: 0 1px 2px rgba(46,16,101,.5);
  transition: all .16s var(--ease);
}
.pay-card img { width: 22px; height: 22px; object-fit: contain; }
.pay-card.active {
  border-color: var(--gold); background: rgba(255, 255, 255, .5);
  box-shadow: 0 0 0 3px rgba(251,191,36,.3);
}

/* 合计行 */
.total-line {
  display: flex; align-items: center; justify-content: space-between;
  border-radius: 14px; padding: 14px 18px; margin-bottom: 12px;
  background: rgba(46, 16, 101, .32); border: 1px solid rgba(255,255,255,.3);
}
.total-label { font-size: 14px; font-weight: 800; color: #ecdfff; }
.total-price {
  font-size: 26px; font-weight: 900; color: #fff;
  text-shadow: 0 2px 6px rgba(46,16,101,.7);
}

/* 主按钮（立体） */
.coin-btn {
  width: 100%; height: 56px; border: 1.5px solid rgba(255, 255, 255, .55); border-radius: 17px;
  cursor: pointer; font-size: 19px; font-weight: 900; letter-spacing: 6px; color: #fff;
  background: linear-gradient(120deg, var(--magenta), var(--purple) 55%, var(--indigo));
  box-shadow:
    0 12px 26px rgba(46, 16, 101, .45),
    inset 0 2px 4px rgba(255, 255, 255, .55),
    inset 0 -3px 6px rgba(46,16,101,.35);
  transition: transform .12s var(--ease), box-shadow .12s var(--ease);
}
.coin-btn:active { transform: translateY(2px); box-shadow: 0 6px 14px rgba(46, 16, 101, .4); }
.coin-btn:disabled { opacity: .7; cursor: not-allowed; }
.expire-tip { text-align: center; font-size: 11px; color: #f0e7ff; margin-top: 10px; font-weight: 600; }

/* 查单入口 */
.query-entries { display: flex; gap: 10px; margin-top: 18px; }
.query-entries > span { display: flex; gap: 10px; flex: 1; min-width: 0; }
.query-btn {
  flex: 1; text-align: center; font-size: 13px; font-weight: 800; color: #fff;
  border-radius: 13px; padding: 12px 8px;
  text-shadow: 0 1px 2px rgba(46,16,101,.5);
}

/* 提示卡 */
.alert-card { border-radius: var(--radius); padding: 28px 18px; text-align: center; font-size: 14px; font-weight: 700; color: #fff; }

/* ============ 弹窗公告 ============ */
.popup-mask {
  position: fixed; inset: 0; z-index: 99; padding: 26px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(46, 16, 101, .55);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  opacity: 0; visibility: hidden;
  transition: opacity .25s var(--ease), visibility .25s;
}
.popup-mask.show { opacity: 1; visibility: visible; }
.popup-mask.closing { opacity: 0; visibility: visible; transition: opacity .2s var(--ease); }
.popup-box {
  position: relative; width: 100%; max-width: 330px;
  background: linear-gradient(170deg, #fff, #f5f0ff);
  border-radius: 22px; padding: 26px 22px 22px; text-align: center;
  box-shadow: 0 24px 60px rgba(46, 16, 101, .45);
  border: 1px solid rgba(255, 255, 255, .8);
  transform: scale(.9) translateY(10px);
  transition: transform .28s var(--ease);
}
.popup-mask.show .popup-box { transform: scale(1) translateY(0); }
.popup-x {
  position: absolute; right: 12px; top: 10px; width: 32px; height: 32px;
  border: none; border-radius: 50%; cursor: pointer; font-size: 20px; line-height: 1;
  color: #6b5b95; background: rgba(122, 92, 255, .12);
  transition: background .15s, transform .15s;
}
.popup-x:hover { background: rgba(122, 92, 255, .25); }
.popup-x:active { transform: scale(.9); }
.popup-title { font-size: 18px; font-weight: 900; color: var(--night-3); margin-bottom: 13px; }
.popup-content { font-size: 14px; line-height: 1.8; color: #6b5b95; margin-bottom: 17px; }
.popup-check { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: var(--muted); margin-bottom: 15px; }
.popup-btn {
  width: 100%; height: 46px; border: none; border-radius: 13px; cursor: pointer;
  font-size: 15px; font-weight: 900; color: #fff; letter-spacing: 2px;
  background: linear-gradient(120deg, var(--magenta), var(--purple));
  box-shadow: 0 8px 18px rgba(122, 92, 255, .4);
  transition: transform .12s var(--ease);
}
.popup-btn:active { transform: scale(.97); }

/* ============ 入场动画 ============ */
.reveal {
  opacity: 0; transform: translateY(18px);
  animation: revealUp .6s var(--ease) forwards;
}
@keyframes revealUp { to { opacity: 1; transform: translateY(0); } }
@keyframes popIn {
  from { opacity: 0; transform: scale(.92); }
  to { opacity: 1; transform: scale(1); }
}
/* 依次延迟，形成错落入场 */
.machine-stage.reveal { animation-delay: .05s; }
.notice-marquee.reveal { animation-delay: .12s; }
.panel.reveal { animation-delay: .18s; }
.panel.reveal ~ .panel.reveal { animation-delay: .26s; }
.total-line.reveal { animation-delay: .3s; }
.coin-btn.reveal { animation-delay: .34s; }
.query-entries.reveal { animation-delay: .4s; }

/* ============ 窄屏适配（机器等比缩放，避免横向溢出） ============ */
@media (max-width: 360px) {
  .vending { zoom: .92; }
}
@media (max-width: 320px) {
  .vending { zoom: .84; }
}

/* ============ 减少动态（无障碍/性能） ============ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ============ v5：通用隐藏 / 自选套餐 / 余额支付 / 导航余额 ============ */
.is-hidden { display: none !important; }

/* 自选套餐标签 */
.tag-choice { background: rgba(139, 92, 246, .45); color: #fff; }

/* 自选套餐容器 */
.choice-box {
  margin-top: 14px; padding: 14px 13px; border-radius: 16px;
  background: rgba(46, 16, 101, .28); border: 1px solid rgba(255,255,255,.3);
}
.choice-box.is-hidden { display: none; }
.choice-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.choice-title { font-size:13px; font-weight:900; color:#fff; text-shadow:0 1px 2px rgba(46,16,101,.5); }
.choice-progress { font-size:12px; font-weight:800; color:#f0e7ff; }
.choice-progress b { color:#fff; font-size:14px; }
.choice-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; }
.choice-item {
  display:flex; flex-direction:column; align-items:center; gap:8px;
  border:1.5px solid rgba(255,255,255,.3); border-radius:14px; padding:11px 9px;
  background:rgba(255,255,255,.16); transition:border-color .16s var(--ease), background .16s var(--ease);
}
.choice-item img { width:46px; height:46px; border-radius:10px; object-fit:cover; }
.choice-item.on { border-color:var(--gold); background:rgba(255,255,255,.3); box-shadow:0 0 0 2px rgba(251,191,36,.28); }
.ci-name { font-size:12px; font-weight:800; color:#fff; text-align:center; text-shadow:0 1px 2px rgba(46,16,101,.6); }
/* v5.1 自选商品价值说明：金色小字，省略时不渲染 */
.ci-value { font-size:10px; font-weight:700; color:#f0e7ff; text-align:center; line-height:1.3; }
.ci-stepper { display:flex; align-items:center; gap:8px; }
.ci-btn {
  width:30px; height:30px; border-radius:9px; cursor:pointer; font-size:16px; font-weight:900;
  line-height:1; color:#fff; border:1px solid rgba(255,255,255,.4);
  background:linear-gradient(145deg,#9b7cff,var(--night-3));
  box-shadow:inset 0 1px 2px rgba(255,255,255,.5),0 3px 6px rgba(46,16,101,.3);
}
.ci-btn:active { transform:scale(.92); }
.ci-qty { min-width:22px; text-align:center; font-size:15px; font-weight:900; color:#fff; }

/* 余额支付卡：浅色卡片，深色文字，保证清晰可读 */
.pay-balance {
  background:linear-gradient(145deg,#fff8e7,#ffeec2);
  border-color:rgba(251,191,36,.55); text-shadow:none;
}
.pay-balance .pb-ico {
  display:inline-flex; align-items:center; justify-content:center;
  font-size:11px; font-weight:900; color:#7a5cff;
  background:linear-gradient(145deg,#fff,#ffe9b8); border-radius:8px; padding:3px 7px;
}
.pay-balance .pb-balance { font-weight:900; color:var(--text-dark); margin-left:2px; }

/* 导航余额入口 */
.balance-link {
  background:rgba(255,255,255,.22); border:1px solid rgba(255,255,255,.4); border-radius:11px;
  padding:6px 11px; font-weight:900; color:#fff; text-shadow:0 1px 2px rgba(46,16,101,.5);
}

/* ===== 物流轨迹时间线（v5.4） ===== */
.logi-timeline { margin-top:10px; }
.logi-list {
  list-style:none; margin:0; padding:0 0 0 4px; position:relative;
}
.logi-list::before {
  content:""; position:absolute; left:7px; top:6px; bottom:6px; width:2px;
  background:linear-gradient(var(--hd-pink-deep,#ef93a8),var(--hd-line-soft,#b08a6c));
  border-radius:2px;
}
.logi-item {
  position:relative; padding:0 0 13px 22px;
}
.logi-item:last-child { padding-bottom:2px; }
.logi-dot {
  position:absolute; left:0; top:3px; width:14px; height:14px; border-radius:50%;
  background:#fff; border:2.5px solid var(--hd-line-soft,#b08a6c);
  box-shadow:0 1px 3px rgba(120,80,50,.2);
}
.logi-item.is-latest .logi-dot {
  background:var(--hd-pink-deep,#ef93a8); border-color:var(--hd-line,#8a5a3b);
}
.logi-content { display:flex; flex-direction:column; gap:3px; }
.logi-context {
  margin:0; font-size:12.5px; line-height:1.55; font-weight:700; color:#5a4636;
}
.logi-item.is-latest .logi-context { color:var(--hd-line,#8a5a3b); font-weight:900; }
.logi-time { font-size:11px; color:#a08a76; font-weight:600; }
