* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
    background: #f3f5f8;
    color: #1f2937;
}

.app-shell {
    max-width: 720px;
    margin: 0 auto;
    padding: 16px;
}

.scan-header h1 {
    margin: 0 0 8px;
    font-size: 24px;
}

.scan-header p {
    margin: 0;
    color: #4b5563;
    line-height: 1.5;
}

.hidden {
    display: none !important;
}

.camera-prompt,
.camera-panel,
.status-box,
.result-box {
    margin-top: 16px;
}

.prompt-card,
.result-box,
.status-box {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.prompt-card {
    padding: 24px;
    text-align: center;
}

.prompt-card .action-row {
    margin-top: 16px;
}

.preview-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #111827;
    aspect-ratio: 3 / 4;
}

#videoPreview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.scan-frame {
    position: absolute;
    inset: 12% 18%;
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.35);
    pointer-events: none;
}

.action-row {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.btn {
    flex: 1;
    border: 0;
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 16px;
    cursor: pointer;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
}

.btn-secondary {
    background: #e5e7eb;
    color: #111827;
    text-align: center;
}

.file-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.status-box {
    padding: 12px 16px;
    color: #1d4ed8;
}

.result-box {
    padding: 20px;
}

.result-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.result-title.success {
    color: #15803d;
}

.result-title.fail {
    color: #b91c1c;
}

.result-code {
    font-size: 32px;
    letter-spacing: 2px;
    font-weight: 700;
    margin: 8px 0;
}

.result-meta {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.6;
}

.debug-image {
    width: 100%;
    margin-top: 12px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
}

@media (max-width: 480px) {
    .action-row {
        flex-direction: column;
    }
}
