* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 40%, #f1f5f9 100%);
    color: #334155;
    min-height: 100vh;
    line-height: 1.6;
}

.page-wrap {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-header {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: #fff;
    padding: 28px 20px 36px;
    border-radius: 0 0 24px 24px;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.25);
}

.logo-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-icon {
    width: 52px;
    height: 52px;
    background: rgba(255,255,255,0.2);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    border: 2px solid rgba(255,255,255,0.3);
}

.logo-text h1 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 2px;
}

.logo-text p {
    font-size: 13px;
    opacity: 0.85;
}

.main-content {
    flex: 1;
    padding: 20px 16px;
}

.query-card {
    background: #fff;
    border-radius: 16px;
    padding: 24px 20px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
    margin-bottom: 16px;
}

.card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 17px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
}

.card-desc {
    font-size: 13px;
    color: #94a3b8;
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.input-group input {
    flex: 1;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.input-group input:focus {
    border-color: #2563eb;
}

.btn-scan {
    width: 50px;
    height: 50px;
    border: 2px solid #2563eb;
    background: #eff6ff;
    color: #2563eb;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
    width: 100%;
    padding: 12px;
    background: #f1f5f9;
    color: #475569;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    margin-top: 12px;
}

.scan-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #0f172a;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.scan-overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    background: rgba(0,0,0,0.35);
}

.scan-close-btn {
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
}

.scan-viewport {
    flex: 1;
    min-height: 55vh;
    position: relative;
    overflow: hidden;
}

.scan-viewport #qr-reader,
.scan-viewport #qr-reader__scan_region,
.scan-viewport #qr-reader__dashboard_section {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
}

.scan-viewport #qr-reader video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.scan-viewport #qr-reader img {
    display: none !important;
}

.scan-overlay-footer {
    padding: 16px;
    background: rgba(0,0,0,0.5);
    text-align: center;
}

.btn-torch {
    background: #2563eb;
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 24px;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 10px;
}

.btn-torch.on {
    background: #f59e0b;
}

.scan-help {
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.6;
}

.scan-tip {
    font-size: 13px;
    color: #e2e8f0;
    text-align: center;
    padding: 10px 16px 0;
    background: #0f172a;
}

.result-area {
    background: #fff;
    border-radius: 16px;
    padding: 24px 20px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px dashed #e2e8f0;
}

.result-header h2 {
    font-size: 17px;
    color: #1e293b;
    margin-bottom: 10px;
}

.status-badge {
    display: inline-block;
    padding: 4px 16px;
    background: #dcfce7;
    color: #16a34a;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.status-badge.fail {
    background: #fee2e2;
    color: #dc2626;
}

.result-image {
    text-align: center;
    margin-bottom: 16px;
}

.result-image img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 12px;
    object-fit: contain;
}

.info-list {
    list-style: none;
}

.info-list li {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
}

.info-list li:last-child { border-bottom: none; }

.info-list .label {
    width: 90px;
    flex-shrink: 0;
    color: #94a3b8;
}

.info-list .value {
    flex: 1;
    color: #1e293b;
    font-weight: 500;
    word-break: break-all;
}

.error-msg {
    background: #fef2f2;
    color: #dc2626;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 14px;
    text-align: center;
}

.hidden { display: none !important; }

.site-footer {
    background: #1e293b;
    color: #94a3b8;
    padding: 24px 20px;
    font-size: 13px;
}

.footer-item {
    margin-bottom: 10px;
}

.footer-item .label {
    color: #64748b;
    margin-right: 8px;
}

.footer-item a {
    color: #93c5fd;
    text-decoration: none;
}

.copyright {
    text-align: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #334155;
    font-size: 12px;
    color: #64748b;
}
