* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  background: #000;
  color: #e8ecf5;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  overflow: hidden;
}

/* ===== 顶部状态栏 ===== */
.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: linear-gradient(90deg, #0b1024, #05070f);
  border-bottom: 1px solid #1d2540;
  position: relative;
  z-index: 10;
}
.brand { font-size: 20px; font-weight: 700; letter-spacing: 1px; }
.stats { display: flex; gap: 36px; }
.stat { text-align: center; }
.stat .num { display: block; font-size: 26px; font-weight: 800; color: #4fd1c5; font-variant-numeric: tabular-nums; }
.stat .label { font-size: 12px; color: #7c84a8; margin-top: 2px; }
.stat .num.live { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 18px; color: #ff6b6b; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #ff6b6b; animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,107,107,.7); } 70% { box-shadow: 0 0 0 10px rgba(255,107,107,0); } 100% { box-shadow: 0 0 0 0 rgba(255,107,107,0); } }

/* ===== 顶部参数控制条（小按钮实时调参） ===== */
.controlbar {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  background: linear-gradient(90deg, #0a0f22, #070b18);
  border-bottom: 1px solid #161d36;
  position: relative;
  z-index: 10;
  font-size: 12px;
}
.ctrl { display: flex; align-items: center; gap: 6px; }
.ctrl-label { color: #8b93b8; white-space: nowrap; }
.ctrl-val {
  color: #4fd1c5;
  font-weight: 700;
  min-width: 40px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.btn {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid #2a3358;
  background: #141b34;
  color: #cdd6f4;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, transform .05s;
}
.btn:hover { background: #1d2748; border-color: #3a4a7a; }
.btn:active { transform: scale(.9); }
.btn-reset {
  margin-left: auto;
  height: 24px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid #2a3358;
  background: #141b34;
  color: #9aa3c4;
  font-size: 12px;
  cursor: pointer;
}
.btn-reset:hover { background: #1d2748; color: #cdd6f4; }

/* 预设档位分隔线 */
.ctrl-divider {
  width: 1px;
  height: 22px;
  background: #232c4c;
  margin: 0 2px;
}
/* 预设按钮组 */
.presets { display: flex; align-items: center; gap: 6px; }
.btn-preset {
  height: 24px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid #2a3358;
  background: #141b34;
  color: #9aa3c4;
  font-size: 12px;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-preset:hover { background: #1d2748; color: #cdd6f4; }
.btn-preset.active {
  background: #14524d;
  border-color: #2dd4bf;
  color: #7ff3e6;
  font-weight: 700;
}
/* 读取频率循环按钮（琥珀色，区别于预设） */
.btn-cycle {
  height: 24px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid #6b4f1d;
  background: #2a1f0c;
  color: #f6c768;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  min-width: 52px;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-cycle:hover { background: #3a2a10; color: #ffd98a; }

/* 背景音乐控件（青绿色，呼应主题） */
.btn-music {
  height: 24px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid #1f5b54;
  background: #0e2f2c;
  color: #5fe3d2;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-music:hover { background: #134a44; color: #7ff3e6; }
.btn-music-toggle {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid #1f5b54;
  background: #0e2f2c;
  color: #5fe3d2;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-music-toggle:hover { background: #134a44; color: #7ff3e6; }
.btn-music-toggle.playing { background: #14524d; border-color: #2dd4bf; color: #7ff3e6; }
.music-name {
  color: #6b7aa8;
  font-size: 11px;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== 向上滚动瀑布流舞台 ===== */
.stage {
  position: relative;
  height: calc(100vh - 64px);   /* 顶栏 64px（控制条已移入管理中台，用户页不再展示） */
  overflow: hidden;
  background: radial-gradient(ellipse at center, #0a1130 0%, #03040f 60%, #000 100%);
}
.stage::before {
  content: '';
  position: absolute;
  inset: -50%;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, #ffffff, transparent),
    radial-gradient(1.5px 1.5px at 75% 65%, #bcd4ff, transparent),
    radial-gradient(1px 1px at 50% 80%, #ffffff, transparent),
    radial-gradient(1px 1px at 35% 15%, #9fb8ff, transparent),
    radial-gradient(1.5px 1.5px at 90% 25%, #ffffff, transparent),
    radial-gradient(1px 1px at 10% 70%, #ffffff, transparent);
  background-size: 320px 320px;
  opacity: .55;
  animation: drift 60s linear infinite;
  z-index: 0;
}
@keyframes drift { from { transform: translate(0, 0); } to { transform: translate(-320px, -320px); } }

/* ===== 订单卡片（瀑布流中从下往上升） ===== */
.order-card {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 14px;
  overflow: visible;        /* 允许印章从卡片上方「从天而降」落下，不被裁切 */
  background: #0e1430;
  border: 1px solid rgba(120, 180, 255, .30);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .55);
  transform: translate(0, 0);
  will-change: transform;
  pointer-events: none;     /* 展示页无需交互 */
  user-select: none;
}
.order-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #1a2138;
  border-radius: 14px;      /* 卡片不再裁切，图片自带圆角 */
}
/* 会员码脱敏徽标（左上） */
.member-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  padding: 3px 8px;
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: .5px;
  color: #e8edff;
  background: rgba(8, 12, 30, .72);
  border: 1px solid rgba(120, 180, 255, .35);
  border-radius: 6px;
  pointer-events: none;
}
/* 价格标签（右上，醒目黄） */
.price-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  padding: 3px 10px;
  font-size: 13px;
  font-weight: 700;
  color: #2a1500;
  background: linear-gradient(180deg, #ffe27a, #ffb020);
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
  pointer-events: none;
}
.order-card .meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  font-size: 13px;
  background: linear-gradient(0deg, rgba(8, 12, 30, .95), rgba(8, 12, 30, .35));
}
.order-card .region { color: #9aa3c4; }
.order-card .amount { color: #ffd166; font-weight: 700; }

/* 优惠券标签（底部横条，红渐变 + 白字） */
.coupon-tag {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 3;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(180deg, rgba(220,38,38,.88), rgba(185,28,28,.95));
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: .3px;
  pointer-events: none;
}

/* ===== 右下角数据接入状态条（与后台采集徽标呼应） ===== */
.sync-status {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  padding: 12px 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: #fff;
  border: 2px solid #dcfce7;
  font: bold 16px/1.3 system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  box-shadow: 0 8px 32px rgba(34, 197, 94, .55);
  animation: syncPulse 1.6s infinite;
  user-select: none;
}
.sync-status .dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fff;
  animation: syncBlink 1s infinite;
  flex: 0 0 auto;
  box-shadow: none;
}
@keyframes syncPulse { 0%,100% { box-shadow: 0 0 0 0 rgba(34,197,94,.75); } 70% { box-shadow: 0 0 0 16px rgba(34,197,94,0); } }
@keyframes syncBlink { 0%,100% { opacity: 1; } 50% { opacity: .3; } }
.sync-status.err {
  background: linear-gradient(135deg, #d97706, #f59e0b);
  border-color: #fde68a;
  animation: syncPulseErr 1.6s infinite;
}
@keyframes syncPulseErr { 0%,100% { box-shadow: 0 0 0 0 rgba(245,158,11,.8); } 70% { box-shadow: 0 0 0 16px rgba(245,158,11,0); } }
.sync-status.pending {
  background: linear-gradient(135deg, #0369a1, #38bdf8);
  border-color: #bae6fd;
  animation: syncPulsePending 1.6s infinite;
}
@keyframes syncPulsePending { 0%,100% { box-shadow: 0 0 0 0 rgba(56,189,248,.75); } 70% { box-shadow: 0 0 0 16px rgba(56,189,248,0); } }
.sync-status #syncText { line-height: 1.25; }

/* ===== 印章开关（toggle switch） ===== */
.ctrl-stamp { margin-left: 4px; }
.switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 22px;
  flex: 0 0 auto;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: #2a3358;
  border-radius: 999px;
  transition: background .2s;
}
.switch .slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 16px;
  height: 16px;
  background: #cdd6f4;
  border-radius: 50%;
  transition: transform .2s;
}
.switch input:checked + .slider { background: #2dd4bf; }
.switch input:checked + .slider::before { transform: translateX(20px); background: #04221f; }

/* ===== 圆形「已购买」印章 ===== */
.stamp {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .45));
}
.stamp svg { width: 100%; height: 100%; display: block; }
.stamp.drop { animation: stampDrop .72s cubic-bezier(.2, .85, .25, 1) forwards; }
@keyframes stampDrop {
  0%   { opacity: 0; transform: translate(-50%, calc(-50% - 210px)) scale(1.9) rotate(-22deg); }
  50%  { opacity: 1; }
  68%  { transform: translate(-50%, -50%) scale(1.14) rotate(-4deg); opacity: 1; }
  82%  { transform: translate(-50%, calc(-50% - 6px)) scale(0.95) rotate(calc(var(--stamp-rot, -8deg) - 2deg)); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(var(--stamp-rot, -8deg)); }
}

/* ===== 页头：歌词显示器 + 音乐 ON/OFF 开关 ===== */
.lyric-box {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  overflow: hidden;
}
.song-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #8b93b8;
  white-space: nowrap;
  overflow: hidden;
}
.song-title #songTitle {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 歌名旁的播放均衡器（播放时跳动） */
.eq {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
  flex: 0 0 auto;
}
.eq i {
  width: 3px;
  height: 5px;
  border-radius: 2px;
  background: #4fd1c5;
  opacity: .45;
  transform-origin: bottom;
  animation: eqBounce 1s ease-in-out infinite;
}
.eq i:nth-child(2) { animation-delay: .15s; }
.eq i:nth-child(3) { animation-delay: .3s; }
.eq i:nth-child(4) { animation-delay: .45s; }
.eq:not(.playing) i { animation-play-state: paused; }
.eq.playing i { opacity: 1; }
@keyframes eqBounce {
  0%, 100% { transform: scaleY(.4); }
  50% { transform: scaleY(1); }
}

/* 三行歌词：上一句（暗）/ 当前句（亮+光晕）/ 下一句（暗） */
.lyric-lines {
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  min-height: 46px;
}
.lyric-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: .5px;
}
.lyric-prev, .lyric-next {
  font-size: 12px;
  color: #5d6a96;
  opacity: .6;
  transition: opacity .3s, color .3s;
}
.lyric-cur {
  font-size: 20px;
  font-weight: 800;
  color: #4fd1c5;
  text-shadow: 0 0 18px rgba(79, 209, 197, .45);
  min-height: 26px;
}
.lyric-cur.lyric-in { animation: lyricIn .45s ease; }
@keyframes lyricIn {
  0%   { opacity: 0; transform: translateY(10px) scale(.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* 音乐 ON/OFF 开关（页头右侧圆形按钮） */
.btn-music-toggle {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  margin-left: 14px;
  border-radius: 50%;
  border: 2px solid rgba(79, 209, 197, .55);
  background: linear-gradient(135deg, #0f2f2c, #0b1024);
  color: #4fd1c5;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, .5);
  transition: transform .12s, box-shadow .2s, border-color .2s, background .2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-music-toggle:active { transform: scale(.9); }
.btn-music-toggle.playing {
  border-color: #2dd4bf;
  color: #7ff3e6;
  background: linear-gradient(135deg, #14524d, #0b1024);
  animation: musicPulse 2.2s infinite;
}
@keyframes musicPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(45, 212, 191, .45), 0 4px 18px rgba(0, 0, 0, .5); }
  50% { box-shadow: 0 0 0 12px rgba(45, 212, 191, 0), 0 4px 18px rgba(0, 0, 0, .5); }
}

/* ===== 移动端 H5 适配 ===== */
@media (max-width: 820px) {
  .topbar { height: 56px; padding: 0 12px; }
  .song-title { font-size: 10px; }
  .lyric-lines { min-height: 34px; }
  .lyric-prev, .lyric-next { font-size: 10px; }
  .lyric-cur { font-size: 15px; min-height: 20px; }
  .eq { height: 10px; }
  .btn-music-toggle { width: 40px; height: 40px; font-size: 18px; margin-left: 8px; }

  /* 舞台占满剩余视口（兼容不支持 dvh 的旧浏览器） */
  .stage {
    height: calc(100vh - 56px);
    height: calc(100dvh - 56px);
  }
  .sync-status {
    right: 10px;
    bottom: 10px;
    left: 10px;
    justify-content: center;
    min-width: 0;
    padding: 8px 12px;
    font-size: 13px;
    border-radius: 12px;
  }
  .member-badge { font-size: 9px; padding: 2px 6px; top: 5px; left: 5px; }
  .price-tag { font-size: 11px; padding: 2px 7px; top: 5px; right: 5px; }
  .coupon-tag { font-size: 9px; padding: 3px 6px; }
}

@media (max-width: 420px) {
  .song-title { font-size: 9px; }
  .lyric-prev, .lyric-next { font-size: 9px; }
  .lyric-cur { font-size: 13px; }
}
