﻿:root {
    --blue: #2563eb;
    --light-blue: #ebf4ff;
    --green: #38a169;
    --red: #e53e3e;
    --gray: #f7fafc;
    --text-dark: #2d3748;
}

body {
    font-family: 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #e0f7fa 0%, #f7fafc 100%);
    margin: 0;
    padding: 1.2rem 0.5rem 0.5rem 0.5rem;
    text-align: center;
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    transition: overflow 0.2s;
}

.qr-scanner-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 0.7rem;
}

    .qr-scanner-header .qr-icon {
        width: 44px;
        height: 44px;
        margin-bottom: 0.3rem;
        color: var(--blue);
        display: flex;
        align-items: center;
        justify-content: center;
    }

.qr-scanner-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 0.18rem;
    letter-spacing: 0.5px;
}

.qr-scanner-description {
    font-size: 1.01rem;
    color: #2563eb;
    margin-bottom: 0.3rem;
    font-weight: 500;
}

.qr-scanner-subtitle {
    font-size: 0.98rem;
    color: #4b5563;
    margin-bottom: 0.7rem;
    font-weight: 400;
}


#qr-reader {
    width: 100%;
    max-width: 420px;
    aspect-ratio: 1 / 1;
    height: auto;
    min-height: 300px;
    margin: 0 auto 1.1rem;
    border-radius: 13px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.09);
    background: white;
    overflow: hidden;
    border: 2px solid var(--blue);
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}


    #qr-reader video {
        object-fit: cover;
        width: 100%;
        height: 100%;
    }

#qr-result,
#qr-error {
    width: 100%;
    max-width: 420px;
    margin: 0.7rem auto 0.5rem auto;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    font-size: 0.98rem;
    text-align: left;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

#qr-result {
    background-color: #e6fffa;
    border-left: 6px solid var(--green);
    color: var(--green);
    display: none;
}

#qr-error {
    background-color: #fff5f5;
    border-left: 6px solid var(--red);
    color: var(--red);
    display: none;
}
/* Info button styles */
.qr-info-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0.7rem auto 0 auto !important;
    left: 0;
    right: 0;
    max-width: 320px;
    width: fit-content;
    min-width: 120px;
    position: relative;
    padding: 0.6em 1.5em 0.6em 1.2em;
    background: linear-gradient(90deg, #2563eb 70%, #60a5fa 100%);
    color: #fff;
    border: none;
    border-radius: 2em;
    font-size: 1.09rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(37,99,235,0.13), 0 1.5px 6px rgba(0,0,0,0.07);
    transition: background 0.18s, box-shadow 0.18s, transform 0.13s, color 0.13s;
    outline: none;
    z-index: 10;
    gap: 0.7em;
}

    .qr-info-btn:hover, .qr-info-btn:focus {
        background: linear-gradient(90deg, #1d4ed8 70%, #3b82f6 100%);
        color: #fff;
        transform: scale(1.045);
        box-shadow: 0 6px 20px rgba(37,99,235,0.18), 0 2px 8px rgba(0,0,0,0.10);
    }

    .qr-info-btn .qr-info-svg {
        width: 1.6em;
        height: 1.6em;
        margin-right: 0.5em;
        flex-shrink: 0;
        filter: drop-shadow(0 0 2px #fff8);
    }
/* Modal overlay */
.qr-modal-overlay {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.38);
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

    .qr-modal-overlay.active {
        display: flex;
        background: rgba(0,0,0,0.48);
    }

.qr-modal-content {
    background: #fff;
    border-radius: 16px;
    max-width: 370px;
    width: 92vw;
    padding: 1.5rem 1.2rem 1.3rem 1.3rem;
    box-shadow: 0 8px 32px rgba(37,99,235,0.13);
    text-align: left;
    color: #23406e;
    position: relative;
    animation: modal-in 0.22s cubic-bezier(.4,1.6,.6,1) both;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin: 0 auto;
    left: 0;
    right: 0;
}

@keyframes modal-in {
    0% {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.qr-modal-content .qr-close-btn {
    position: absolute;
    top: 13px;
    right: 13px;
    width: 1.2em;
    height: 1.2em;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1.5em;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(37,99,235,0.13);
    transition: background 0.18s, color 0.18s, transform 0.13s;
    z-index: 2;
    padding: 0;
}

    .qr-modal-content .qr-close-btn:hover {
        background: #1e293b;
        color: #fff;
        transform: scale(1.08);
    }

.qr-scanner-tips-title {
    font-weight: 600;
    color: #2563eb;
    margin-bottom: 0.3rem;
    font-size: 1.01rem;
}

.qr-scanner-tips ul {
    margin: 0 0 0 1.1em;
    padding: 0;
    list-style: disc;
}

.qr-scanner-tips li {
    margin-bottom: 0.3em;
    line-height: 1.5;
}

@media screen and (max-width: 600px) {
    body {
        padding: 0.7rem 0.2rem 0.2rem 0.2rem;
    }

    #qr-reader {
        height: 55vw;
        min-height: 220px;
        max-height: 350px;
        max-width: 98vw;
        margin: 0 auto 1.1rem auto;
    }

    .qr-scanner-header {
        background: #f3f7fd;
        border-radius: 1.1em;
        padding: 1.1em 0.7em 1.2em 0.7em;
        margin-bottom: 1.1em;
        box-shadow: 0 2px 10px rgba(37,99,235,0.07);
    }

        .qr-scanner-header .qr-icon {
            width: 32px;
            height: 32px;
            margin-bottom: 0.7em;
        }

    .qr-scanner-title {
        font-size: 1.18rem;
        font-weight: 700;
        margin-bottom: 0.45em;
        letter-spacing: 0.2px;
    }

    .qr-scanner-description {
        font-size: 0.99rem;
        font-weight: 500;
        margin-bottom: 0.38em;
        color: #2563eb;
    }

    .qr-scanner-subtitle {
        font-size: 0.97rem;
        font-weight: 400;
        margin-bottom: 0.1em;
        color: #4b5563;
    }

    .qr-modal-content {
        min-width: 0;
        width: 98vw;
        max-width: 97vw;
        box-sizing: border-box;
    }

    .qr-info-btn {
        width: fit-content;
        min-width: 120px;
        max-width: 95vw;
        margin: 0.7rem auto 0 auto !important;
        left: 0;
        right: 0;
        position: relative;
    }
}
