/* ============================================================
   八部 · 弹窗与右侧面板
   ============================================================ */

.popup-overlay {
  position: fixed; inset: 0;
  background: rgba(13, 10, 7, 0.8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 99999;
  display: flex; align-items: center; justify-content: center;
  animation: babuFadeIn .3s ease;
}
@keyframes babuFadeIn { from { opacity: 0; } to { opacity: 1; } }

.popup-card {
  background: linear-gradient(160deg, #1a1510, #2a2318);
  border: 1px solid rgba(201, 164, 92, 0.3);
  border-radius: 16px;
  width: 100%; max-width: 420px;
  padding: 40px 30px 30px;
  position: relative;
  box-shadow: 0 24px 80px rgba(0,0,0,.8), 0 0 60px rgba(194,58,43,.15);
  animation: babuSlideUp .4s cubic-bezier(.16,1,.3,1);
  text-align: center;
}
@keyframes babuSlideUp {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.popup-ink {
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, transparent, #c23a2b, #c9a45c, transparent);
  border-radius: 16px 16px 0 0;
}
.popup-close {
  position: absolute; top: 14px; right: 18px;
  background: none; border: none;
  font-size: 1.6rem; color: #7a6b54;
  cursor: pointer; line-height: 1;
  transition: color .2s, transform .2s;
}
.popup-close:hover { color: #c23a2b; transform: rotate(90deg); }

.popup-header h3 {
  margin: 0 0 24px;
  font-family: "STKaiti", "KaiTi", "楷体", serif;
  font-size: 1.4rem; color: #c9a45c; letter-spacing: 6px;
}
.popup-header h3::after {
  content: ""; display: block;
  width: 50px; height: 2px;
  background: linear-gradient(90deg, #c23a2b, #c9a45c);
  margin: 12px auto 0; border-radius: 1px;
}

.popup-qr { margin-bottom: 18px; }
.popup-qr img {
  border-radius: 12px; border: 2px solid rgba(201,164,92,.3);
  padding: 6px; background: #fff; margin: 0 auto;
}
.popup-qq {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; margin-bottom: 12px; flex-wrap: wrap;
}
.qq-label { color: #b8a88e; font-size: .9rem; }
.qq-number {
  font-size: 1.35rem; font-weight: 800; color: #c23a2b;
  font-family: monospace; letter-spacing: 1px;
}
.copy-btn, .side-copy-btn {
  background: linear-gradient(135deg, #c23a2b, #a12e22);
  color: #fff; border: none; border-radius: 6px;
  padding: 9px 18px; font-size: .85rem; font-weight: 700;
  cursor: pointer; transition: transform .2s, box-shadow .2s;
}
.copy-btn:hover, .side-copy-btn:hover {
  transform: translateY(-1px); box-shadow: 0 0 20px rgba(194,58,43,.5);
}
.popup-time { font-size: .82rem; color: #7a6b54; margin: 0; }

/* ===== 右侧面板：absolute 定位 + transform 缓动跟随 ===== */
.side-panel {
  position: absolute;
  top: 0; right: 0;
  z-index: 9999;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}
.side-panel-inner {
  background: linear-gradient(160deg, #1a1510, #2a2318);
  border: 1px solid rgba(201,164,92,.25);
  border-right: none;
  border-radius: 14px 0 0 14px;
  box-shadow: -6px 6px 30px rgba(0,0,0,.6), 0 0 30px rgba(194,58,43,.1);
  padding: 22px 16px; text-align: center; position: relative;
  width: 160px;
}
.side-close {
  position: absolute; top: 6px; left: 10px;
  font-size: 1.1rem; color: #7a6b54; cursor: pointer; line-height: 1;
}
.side-close:hover { color: #c23a2b; }
.side-qr {
  border-radius: 8px; margin: 0 auto 10px; background: #fff;
  padding: 4px; display: block; border: 1px solid rgba(201,164,92,.3);
}
.side-qq {
  font-size: .88rem; font-weight: 700; color: #c23a2b;
  margin-bottom: 12px; font-family: monospace;
}
.side-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.side-top-btn {
  display: inline-block; padding: 9px 14px;
  background: rgba(201,164,92,.15);
  border: 1px solid rgba(201,164,92,.3);
  border-radius: 6px; color: #c9a45c;
  font-size: .82rem; font-weight: 600;
}
.side-top-btn:hover { background: #c9a45c; color: #1a1510; text-decoration: none; }

/* ===== 移动端：底部抽屉 ===== */
@media (max-width: 768px) {
  .popup-overlay { align-items: flex-end; justify-content: center; }
  .popup-card {
    border-radius: 20px 20px 0 0; max-width: 100%;
    padding: 44px 20px 32px;
    animation: babuSlideUpMobile .4s cubic-bezier(.16,1,.3,1);
  }
  @keyframes babuSlideUpMobile {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }
  .popup-qr img { width: 200px; height: 200px; }
  .copy-btn { min-height: 48px; min-width: 130px; font-size: .95rem; }

  .side-panel { right: 8px; }
  .side-panel-inner { width: 130px; padding: 16px 10px; }
  .side-qr { width: 100px; height: 100px; }
}

@media (prefers-reduced-motion: reduce) {
  .popup-overlay, .popup-card { animation: none; }
}
