body {
    margin: 0;
    padding: 0;
    min-height: 100vh; /* Changed from height to min-height to allow scrolling if needed */
    width: 100vw;
    background: linear-gradient(to bottom right, #f8fafc, #e7e7ef);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Microsoft YaHei', sans-serif;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    /* Remove fixed height to allow content to dictate size if it overflows */
    justify-content: center;
    padding: 20px 0; /* Add some padding for safety */
    box-sizing: border-box;
}

.card {
    width: 25%;
    min-width: 380px; /* Reduced from 500px for better tablet support */
    height: auto;
    background-color: #ffffff;
    border-radius: 40px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.card-content {
    padding: 10% 8%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.avatar {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    border: 4px solid #229fe6;
    box-sizing: border-box;
    object-fit: cover;
    margin-bottom: 25px;
}

.name {
    font-family: 'Microsoft YaHei', sans-serif;
    font-size: 2.5em;
    color: #616161;
    margin-bottom: 15px;
    margin-left: 0;
    font-weight: bold;
}

.bio {
    font-family: 'Microsoft YaHei', sans-serif;
    font-size: 1em;
    color: #b8b8b8;
    line-height: 1.8;
    text-align: left;
}

.buttons-container {
    margin-top: 50px;
    display: flex;
    gap: 25px;
}

.btn {
    width: 60px;
    height: 60px;
    background-color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
}

.btn:hover {
    transform: translateY(-5px);
}

.icon-svg {
    width: 1.8em;
    height: 1.8em;
    fill: #229fe6;
    transition: fill 0.2s;
}

.btn:hover .icon-svg {
    fill: #06689d; 
}

/* Mobile Responsive Styles */
@media screen and (max-width: 768px) {
    .card {
        width: 85%; /* Use percentage width on mobile */
        min-width: unset; /* Remove min-width constraint */
        border-radius: 30px;
    }

    .card-content {
        padding: 8% 6%;
    }

    .avatar {
        width: 120px;
        height: 120px;
        margin-bottom: 20px;
        border-width: 3px;
    }

    .name {
        font-size: 26px;
        margin-bottom: 10px;
    }

    .bio {
        font-size: 13px;
        line-height: 1.6;
    }

    .buttons-container {
        margin-top: 30px; /* Reduce gap */
        gap: 15px;
    }

    .btn {
        width: 50px;
        height: 50px;
    }

    .icon-svg {
        width: 1.6em;
        height: 1.6em;
    }
}

/* Overlay Styles */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.qr-card {
    background: white;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 80%; /* Responsive QR card width */
    max-width: 340px;
}

.qr-image {
    width: 100%;
    max-width: 300px;
    height: auto;
    max-height: 50vh;
    border-radius: 10px;
    object-fit: contain;
}


@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
