/* 弹窗公告 */
#popup {
  display: none; /* 默认隐藏 */
  position: fixed;
  z-index: 1001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.4); /* 半透明黑色遮罩 */
  /* 使用 Flexbox 来居中, 但在JS控制显示之前，它应该是隐藏的 */
  align-items: center;
  justify-content: center;
  -webkit-animation-name: none; /* 移除旧的动画 */
  animation-name: none; /* 移除旧的动画 */
}

.popup-content {
    position: relative;
    background-color: #fefefe;
    margin: auto; /* 重新加回 auto margin 以配合 Flexbox */
    padding: 20px;
    border: 1px solid #888;
    width: 90%; /* 在手机上稍微宽一点 */
    max-width: 600px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    animation: scale-in 0.4s cubic-bezier(0.4, 0, 0.2, 1); /* 应用新的缩放动画 */
}

.popup-content > .close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.popup-content > .close:hover,
.popup-content > .close:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

.popup-header {
    text-align: center;
}

.popup-note {
    color: #ff4757;
    font-size: 0.9em;
    margin: 0 0 15px 0;
}

.popup-desc {
    color: #666;
    font-size: 1.1em;
    line-height: 1.6;
    margin: 15px 0;
}

h2 {
    color: #1a1a1a;
    font-size: 2em;
    font-weight: 600;
    margin: 15px 0;
    letter-spacing: -0.5px;
}

.buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

.popup-btn {
    padding: 12px 25px;
    border-radius: 8px;
    color: #ffffff;
    font-size: 1.1em;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.qq-group {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.contact-us {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
}

.popup-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scale-in {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@media (max-width: 480px) {
    .popup-content {
        padding: 25px;
    }
    
    .buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    h2 {
        font-size: 1.8em;
    }
    
    .popup-desc {
        font-size: 1em;
    }
}
/* 弹窗关闭按钮 */
.close {
    position: absolute;
    right: 15px;
    top: 15px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.05);
    color: #888;
    font-size: 28px;
    line-height: 1;
    text-shadow: none;
    font-weight: normal;
}


.close:hover {
    background: #ff4757;
    transform: rotate(180deg) scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.2);
    color: white;
}

/* 添加关闭动画 */
@keyframes close-popup {
    0% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
    50% {
        transform: scale(1.2) rotate(45deg);
        opacity: 0.5;
    }
    100% {
        transform: scale(0) rotate(90deg);
        opacity: 0;
    }
}

/* 修改弹窗关闭动画 */
.popup.closing {
    animation: fade-out 0.3s ease-out forwards;
}

.popup.closing .popup-content {
    animation: close-popup 0.3s ease-out forwards;
}

@keyframes fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* 联系客服下拉菜单样式 */
.contact-us {
  position: relative;
  cursor: pointer;
}

.contact-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  margin-top: 5px;
  overflow: hidden;
  z-index: 10001;
}

.contact-dropdown.active {
  display: block;
}

.contact-option {
  padding: 10px 15px;
  color: #333;
  transition: all 0.3s ease;
  cursor: pointer;
}

.contact-option:hover {
  background: #f5f5f5;
}

/* 成功提示样式 */
.copy-success {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 10px 20px;
  border-radius: 4px;
  z-index: 10000;
  display: none;
}

.copy-success.show {
  display: block;
  animation: fadeInOut 1.5s ease forwards;
}

@keyframes fadeInOut {
  0% { opacity: 0; }
  20% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

/* 电脑端视图优化：调整弹窗垂直位置 */
@media (min-width: 769px) {
    #popup {
        align-items: flex-start; /* 取消垂直居中，改为顶部对齐 */
        padding-top: 15vh; /* 从顶部向下推移视口高度的15% */
    }
}