html,
body {
    margin: 0;
    min-height: 100%;
    background: #f3f5f7;
    color: #17202a;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

button {
    font-family: inherit;
}

.scan-page {
    width: 100%;
    max-width: 520px;
    min-height: 100vh;
    margin: 0 auto;
    padding: calc(18px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
}

.scan-header {
    margin-bottom: 16px;
    padding: 4px 2px;
}

.scan-title {
    font-size: 24px;
    font-weight: 700;
    line-height: 34px;
}

.scan-subtitle {
    margin-top: 3px;
    color: #6b7785;
    font-size: 14px;
    line-height: 22px;
}

.scan-card {
    padding: 16px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 18px rgba(21, 35, 50, .08);
}

.reader {
    width: 100%;
    min-height: 280px;
    overflow: hidden;
    border-radius: 12px;
    background: #111;
}

.reader video {
    object-fit: cover;
    border-radius: 12px;
}

.scan-status {
    min-height: 44px;
    margin: 14px 0 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f2f7ff;
    color: #315d9a;
    font-size: 14px;
    line-height: 22px;
    text-align: center;
}

.scan-status.error {
    background: #fff1f0;
    color: #c0392b;
}

.button {
    display: block;
    width: 100%;
    min-height: 46px;
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 9px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.button-primary {
    border: 1px solid #1677ff;
    background: #1677ff;
    color: #fff;
}

.button-secondary {
    border: 1px solid #d8dee7;
    background: #fff;
    color: #34495e;
}

.error-title {
    color: #c0392b;
    font-size: 18px;
    font-weight: 700;
}

.error-message {
    margin: 12px 0 18px;
    color: #5c6773;
    font-size: 15px;
    line-height: 24px;
}

.result-label {
    color: #6b7785;
    font-size: 14px;
}

.result-code {
    margin-top: 8px;
    padding: 14px;
    overflow-wrap: anywhere;
    border-radius: 8px;
    background: #f4f7fa;
    font-size: 18px;
    font-weight: 700;
    line-height: 28px;
}

.result-list {
    margin: 16px 0 0;
}

.result-list > div {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #edf0f3;
}

.result-list dt,
.result-list dd {
    margin: 0;
    overflow-wrap: anywhere;
}

.result-list dt {
    color: #6b7785;
}

@media (max-width: 360px) {
    .scan-page {
        padding-right: 12px;
        padding-left: 12px;
    }

    .scan-card {
        padding: 12px;
    }

    .reader {
        min-height: 240px;
    }
}
