/* ==================== 访客国家信息 (左上角) ==================== */
#visitor-info {
    position: absolute; /* ✅ 固定左上角 */
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.8); /* ✅ 半透明黑色背景 */
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
    z-index: 1000;
}

/* 旗帜样式 */
#visitor-flag {
    width: 24px;
    height: 16px;
    display: none;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ✅ 显示访客信息 */
#visitor-info.show {
    opacity: 1;
    visibility: visible;
}

/* ✅ 渐出动画 */
#visitor-info.hide {
    opacity: 0;
    visibility: hidden;
}

/* ✅ 悬停时保持显示 */
#visitor-info:hover {
    opacity: 1 !important;
    visibility: visible !important;
}

/* ==================== 响应式优化 ==================== */
@media (max-width: 768px) {
    #visitor-info {
        font-size: 12px;
        padding: 8px 12px;
        top: 5px;
        left: 5px;
    }

    #visitor-flag {
        width: 20px;
        height: 14px;
    }
}

/* ==================== 访客按钮 (左下角 + 动画效果) ==================== */
.visitor-btn {
    position: fixed;
    bottom: 20px; /* ✅ 贴近底部 */
    left: 20px; /* ✅ 贴近左侧 */
    width: 55px;
    height: 55px;
    background: #013DC4;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease-in-out;
    animation: pulseEffect 2s infinite ease-in-out, bounceEffect 1.5s infinite alternate; /* ✅ 呼吸灯 + 轻微弹跳 */
    z-index: 1000;
}

/* 鼠标悬停时放大 */
.visitor-btn:hover {
    background: #011a72;
    transform: scale(1.1);
}

/* ✅ 点击时涟漪效果 */
.visitor-btn:active::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: rippleEffect 0.6s ease-out;
}

/* 🔹 呼吸灯动画 */
@keyframes pulseEffect {
    0% { box-shadow: 0px 0px 10px rgba(1, 61, 196, 0.6); }
    50% { box-shadow: 0px 0px 20px rgba(1, 61, 196, 0.8); }
    100% { box-shadow: 0px 0px 10px rgba(1, 61, 196, 0.6); }
}

/* 🔹 轻微弹跳动画 */
@keyframes bounceEffect {
    0% { transform: translateY(0); }
    100% { transform: translateY(-5px); }
}

/* ==================== 访客信息弹窗 (Apple 风格) ==================== */
.visitor-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    width: 320px;
    max-width: 90%;
    background: rgba(255, 255, 255, 0.15); /* ✅ 玻璃拟态背景 */
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0px 10px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
    transform: translate(-50%, -50%) scale(0.9);
    opacity: 0;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    z-index: 9999;
}

/* ✅ 弹窗显示时的状态 */
.visitor-modal.show {
    display: block;
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* ✅ 页面背景模糊 (Apple 风格) */
body.modal-open {
    overflow: hidden;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1); /* ✅ 半透明磨砂效果 */
    backdrop-filter: blur(15px);
    z-index: 9998;
    transition: opacity 0.3s ease-in-out;
}

/* ✅ 显示磨砂背景 */
.modal-overlay.show {
    display: block;
    opacity: 1;
}

/* 关闭按钮 */
.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 22px;
    cursor: pointer;
    color: #555;
    transition: color 0.3s;
}

.close-modal:hover {
    color: red;
}

/* ==================== 弹窗内社交图标 (无下划线) ==================== */
.modal-social-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

/* ✅ 移除下划线 */
.modal-social-links a {
    text-decoration: none;
}

/* 单个社交图标 */
.modal-social-icon {
    width: 50px;
    height: 50px;
    background: white;
    color: #013DC4;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease-in-out;
}

/* 鼠标悬停时放大 + 阴影增强 */
.modal-social-icon:hover {
    transform: scale(1.2);
    box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.3);
}

/* 各平台颜色 (弹窗内) */
.modal-social-icon.telegram i { color: #0088CC; }
.modal-social-icon.whatsapp i { color: #128C7E; }
.modal-social-icon.wechat i { color: #25D366; }
.modal-social-icon.email i { color: #FF5733; }

/* ==================== 响应式优化 (移动端) ==================== */
@media (max-width: 768px) {
    .visitor-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .visitor-modal {
        width: 90%;
    }

    .modal-social-icon {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
}
