:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --subtext: #4d4d4d;
  --border: #e5e5e5;
  --shadow: 0 8px 24px rgba(0,0,0,0.12);
  --shadow-heavy: 0 20px 48px rgba(0,0,0,0.16);
  --overlay: rgba(0, 0, 0, 0.4);
  --accent: #ff4757;            /* ❤ 主题红 */
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: linear-gradient(135deg, #fff0f3 0%, #ffe4e6 50%, #ffc9cc 100%);
  color: var(--text);
  font-family: "Noto Sans SC", Segoe UI, system-ui, -apple-system, Roboto, Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  overflow: hidden;
}

#popup-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

/* 入场弹窗 */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  display: grid;
  place-items: center;
  z-index: 9999;
}

.modal {
  width: min(92vw, 520px);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-heavy);
  text-align: left;
  overflow: hidden;
  animation: modal-appear 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.modal .titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: #ffe4e6;
  border-bottom: 1px solid var(--border);
}

.modal .titlebar .icon { font-size: 18px; }
.modal .titlebar .title { font-weight: 700; }

.modal .content { padding: 16px 16px 8px; color: var(--subtext); }
.modal .actions { padding: 0 16px 16px; display: flex; gap: 10px; justify-content: flex-end; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 4px;
  border: 1px solid var(--border);
  cursor: pointer;
  font-weight: 600;
  letter-spacing: .2px;
  background: #f7f7f7;
}

.btn.primary { background: var(--accent); color: #fff; border-color: #e03646; }
.btn:hover { filter: brightness(0.98); }
.btn.primary:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(1px); }

/* 屏幕弹窗（温馨提示） */
.popup {
  position: absolute;
  width: 230px;
  color: var(--text);
  background: #ffffff;
  border-radius: 7px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15), 0 8px 32px rgba(0,0,0,0.08);
  font-size: 13px;
  line-height: 1.4;
  pointer-events: none;
  user-select: none;
  transform-origin: center;
  overflow: hidden;
}

.popup .header {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: #ffe4e6;
  border-bottom: 1px solid var(--border);
}
.popup .header .icon { font-size: 12px; }
.popup .header .title { font-weight: 800; font-size: 11px; }

.popup .content { padding: 6px 10px; color: var(--text); font-size: 18px; font-weight: 600; line-height: 1.25; text-align: center; }

/* 主题色 */
.popup.theme-red .header { background: #ffe4e6; border-bottom-color: #ffc9cc; }
.popup.theme-red .content { background: #fff0f3; }

@media (max-width: 640px) {
  .popup { width: min(230px, 85vw); font-size: 13px; }
  .popup .content { font-size: 16px; }
}

/* 动画 */
@keyframes modal-appear {
  0% { opacity: 0; transform: scale(0.7) translateY(-20px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes popup-from-top {
  0% { opacity: 0; transform: scale(0.3) translateY(-60px); }
  60% { opacity: 1; transform: scale(1.08) translateY(0); }
  80% { transform: scale(0.95) translateY(0); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes popup-from-bottom {
  0% { opacity: 0; transform: scale(0.3) translateY(60px); }
  60% { opacity: 1; transform: scale(1.08) translateY(0); }
  80% { transform: scale(0.95) translateY(0); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes popup-from-left {
  0% { opacity: 0; transform: scale(0.3) translateX(-60px); }
  60% { opacity: 1; transform: scale(1.08) translateX(0); }
  80% { transform: scale(0.95) translateX(0); }
  100% { opacity: 1; transform: scale(1) translateX(0); }
}
@keyframes popup-from-right {
  0% { opacity: 0; transform: scale(0.3) translateX(60px); }
  60% { opacity: 1; transform: scale(1.08) translateX(0); }
  80% { transform: scale(0.95) translateX(0); }
  100% { opacity: 1; transform: scale(1) translateX(0); }
}
@keyframes popup-from-topleft {
  0% { opacity: 0; transform: scale(0.3) translate(-50px, -50px); }
  60% { opacity: 1; transform: scale(1.08) translate(0, 0); }
  80% { transform: scale(0.95) translate(0, 0); }
  100% { opacity: 1; transform: scale(1) translate(0, 0); }
}
@keyframes popup-from-topright {
  0% { opacity: 0; transform: scale(0.3) translate(50px, -50px); }
  60% { opacity: 1; transform: scale(1.08) translate(0, 0); }
  80% { transform: scale(0.95) translate(0, 0); }
  100% { opacity: 1; transform: scale(1) translate(0, 0); }
}
@keyframes popup-from-bottomleft {
  0% { opacity: 0; transform: scale(0.3) translate(-50px, 50px); }
  60% { opacity: 1; transform: scale(1.08) translate(0, 0); }
  80% { transform: scale(0.95) translate(0, 0); }
  100% { opacity: 1; transform: scale(1) translate(0, 0); }
}
@keyframes popup-from-bottomright {
  0% { opacity: 0; transform: scale(0.3) translate(50px, 50px); }
  60% { opacity: 1; transform: scale(1.08) translate(0, 0); }
  80% { transform: scale(0.95) translate(0, 0); }
  100% { opacity: 1; transform: scale(1) translate(0, 0); }
}

.anim-top { animation: popup-from-top 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.anim-bottom { animation: popup-from-bottom 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.anim-left { animation: popup-from-left 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.anim-right { animation: popup-from-right 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.anim-topleft { animation: popup-from-topleft 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.anim-topright { animation: popup-from-topright 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.anim-bottomleft { animation: popup-from-bottomleft 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.anim-bottomright { animation: popup-from-bottomright 0.55s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }

/* 右下角透明小球 */
#float-balls {
  position: fixed;
  right: 30px;
  bottom: 30px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  z-index: 10000;
}

.float-ball {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  pointer-events: auto;
}

.float-ball span {
  color: #1a1a1a;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.float-ball:hover {
  background: rgba(255, 255, 255, 0.85);
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.25);
}

.float-ball:active {
  transform: scale(0.95);
}

/* 小球出现动画 */
@keyframes ball-appear {
  0% {
    opacity: 0;
    transform: scale(0) translateX(100px);
  }
  60% {
    opacity: 1;
    transform: scale(1.15) translateX(0);
  }
  80% {
    transform: scale(0.9) translateX(0);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateX(0);
  }
}

#float-balls.show .float-ball {
  animation: ball-appear 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@media (max-width: 640px) {
  #float-balls {
    right: 20px;
    bottom: 20px;
    gap: 10px;
  }
  
  .float-ball {
    width: 40px;
    height: 40px;
  }
  
  .float-ball span {
    font-size: 11px;
  }
}
