:root {
  --bg: #f1f4f6; --card: #fff; --ink: #101c29; --muted: #687789; --line: #dce3e9;
  --orange: #ff5a24; --orange-dark: #e74612; --green: #13a66b; --danger: #d94545;
  --shadow: 0 10px 30px rgba(18, 32, 47, .07);
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; color: var(--ink); background: radial-gradient(circle at 10% 0%, #fff 0, transparent 30rem), var(--bg); font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.app-shell { width: min(100%, 580px); min-height: 100dvh; margin: 0 auto; padding: max(20px, env(safe-area-inset-top)) 14px max(32px, env(safe-area-inset-bottom)); }
.app-header { display: flex; align-items: center; gap: 11px; padding: 0 2px 19px; }
.brand-mark { width: 42px; height: 42px; display: flex; align-items: stretch; justify-content: center; gap: 3px; padding: 9px 8px; background: var(--ink); border-radius: 11px; box-shadow: 0 7px 18px rgba(16,28,41,.2); }
.brand-mark span { background: #fff; border-radius: 1px; }.brand-mark span:nth-child(1) { width: 2px; }.brand-mark span:nth-child(2) { width: 5px; }.brand-mark span:nth-child(3) { width: 2px; }.brand-mark span:nth-child(4) { width: 4px; }
.eyebrow { margin: 0 0 3px; color: var(--orange); font-size: 9px; font-weight: 850; letter-spacing: .17em; }
h1 { margin: 0; font-size: 20px; line-height: 1.15; letter-spacing: -.03em; }
.local-pill { margin-left: auto; padding: 6px 9px; color: #327058; background: #e4f4ec; border: 1px solid #cbe6d9; border-radius: 999px; font-size: 10px; font-weight: 750; }
.scanner-panel, .tool-panel, .result-panel { margin-bottom: 13px; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: 17px; box-shadow: var(--shadow); }
.tool-panel, .result-panel { padding: 16px; }
.section-title, .result-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-title { padding: 15px 16px; }.tool-panel .section-title { padding: 0 0 15px; }.result-header { margin-bottom: 14px; }
.section-title > div, .result-header > div { display: flex; align-items: center; gap: 9px; }
.step { display: grid; width: 29px; height: 29px; place-items: center; flex: 0 0 auto; color: var(--orange); background: #fff0ea; border-radius: 8px; font-family: monospace; font-size: 11px; font-weight: 900; }
h2 { margin: 0; font-size: 15px; letter-spacing: -.015em; }
.support-label, .vin-count { color: #84919f; font-family: monospace; font-size: 9px; font-weight: 700; letter-spacing: .04em; }
.camera-stage { position: relative; height: clamp(230px, 58vw, 310px); overflow: hidden; background: #121e2a; }
.camera-stage video { width: 100%; height: 100%; display: block; object-fit: cover; }
.camera-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; background: radial-gradient(circle at 50% 38%, #293b4b, #121e2a 70%); }
.camera-placeholder[hidden] { display: none; }.camera-placeholder strong { margin-top: 19px; font-size: 14px; }.camera-placeholder span { margin-top: 5px; color: #99a8b6; font-size: 10px; }
.barcode-ghost { width: 124px; height: 49px; opacity: .3; background: repeating-linear-gradient(90deg, #fff 0 2px, transparent 2px 5px, #fff 5px 6px, transparent 6px 10px); }
.scan-frame { position: absolute; top: 50%; left: 50%; width: 83%; height: 45%; transform: translate(-50%, -50%); pointer-events: none; }
.corner { position: absolute; width: 25px; height: 25px; border-color: var(--orange); border-style: solid; filter: drop-shadow(0 0 3px rgba(255,90,36,.4)); }.tl { top: 0; left: 0; border-width: 3px 0 0 3px; }.tr { top: 0; right: 0; border-width: 3px 3px 0 0; }.bl { bottom: 0; left: 0; border-width: 0 0 3px 3px; }.br { bottom: 0; right: 0; border-width: 0 3px 3px 0; }
.scan-line { display: none; position: absolute; top: 8%; left: 3%; right: 3%; height: 2px; background: linear-gradient(90deg, transparent, #ff956e, var(--orange), #ff956e, transparent); box-shadow: 0 0 11px var(--orange); animation: scan 2s ease-in-out infinite; }.is-scanning .scan-line { display: block; }
@keyframes scan { 50% { top: 90%; } }
.live-badge { display: none; position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); padding: 5px 9px; color: #fff; background: rgba(7,15,23,.74); border: 1px solid rgba(255,255,255,.17); border-radius: 999px; font-size: 9px; font-weight: 750; backdrop-filter: blur(8px); }.is-scanning .live-badge { display: block; }.live-badge i { display: inline-block; width: 6px; height: 6px; margin-right: 4px; background: #ff4e4e; border-radius: 50%; }
.screen-light { position: absolute; inset: 12% 8%; z-index: 4; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--ink); background: rgba(255, 255, 255, .78); border: 2px solid rgba(255,255,255,.95); border-radius: 12px; box-shadow: 0 0 35px rgba(255,255,255,.8); font-size: 12px; font-weight: 800; }.screen-light[hidden] { display: none; }.screen-light button { padding: 5px 8px; color: var(--ink); background: rgba(255,255,255,.9); border: 1px solid #aab7c2; border-radius: 6px; font-size: 10px; }
.scan-status { min-height: 40px; display: flex; align-items: center; justify-content: center; gap: 7px; margin: 0; padding: 8px 13px; color: var(--muted); background: #fafbfc; border-bottom: 1px solid var(--line); font-size: 11px; text-align: center; overflow-wrap: anywhere; }.scan-status i { width: 7px; height: 7px; flex: 0 0 auto; background: #96a2ae; border-radius: 50%; }.scan-status.ok { color: var(--green); }.scan-status.ok i { background: var(--green); box-shadow: 0 0 0 4px rgba(19,166,107,.1); }.scan-status.error { color: var(--danger); }.scan-status.error i { background: var(--danger); }
.scan-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; padding: 12px; }.scan-actions button, .actions button, .copy-button { min-height: 48px; border-radius: 11px; font-size: 12px; font-weight: 800; transition: transform .12s, background .12s; }.scan-actions button:active, .actions button:active, .copy-button:active { transform: scale(.98); }.scan-actions button span { margin-right: 6px; font-size: 16px; vertical-align: -1px; }
.camera-button { color: #fff; background: var(--orange); border: 0; box-shadow: 0 7px 17px rgba(255,90,36,.22); }.camera-button:hover { background: var(--orange-dark); }.album-button { color: var(--ink); background: #fff; border: 1px solid #cfd8e0; }
.torch-button, .ocr-button { color: var(--ink); background: #fff8df; border: 1px solid #efd27a; }.ocr-button { background: #eef6ff; border-color: #b8d5f2; }.torch-button:disabled { color: #98a4af; background: #f4f6f8; border-color: #d9e0e5; cursor: not-allowed; }
label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 11px; font-weight: 750; }
.input-row { display: grid; grid-template-columns: minmax(0, 1fr) 47px; gap: 8px; }
input { width: 100%; min-width: 0; height: 51px; padding: 0 12px; color: var(--ink); background: #f8fafb; border: 1px solid #cad4dd; border-radius: 10px; font-family: "SFMono-Regular", Consolas, monospace; font-size: clamp(14px, 4vw, 18px); font-weight: 750; letter-spacing: .025em; text-transform: uppercase; outline: none; }input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,90,36,.1); }
.icon-button { color: var(--ink); background: #f4f6f8; border: 1px solid #cad4dd; border-radius: 10px; font-size: 19px; }
.meter { height: 5px; margin-top: 10px; overflow: hidden; background: #e7ecf0; border-radius: 999px; }.meter span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--orange), #ff9a48, var(--green)); border-radius: inherit; transition: width .16s ease; }
.status-line { min-height: 19px; margin: 8px 0 0; color: var(--muted); font-size: 11px; }.status-line.ok { color: var(--green); }.status-line.error { color: var(--danger); }
.actions { display: grid; grid-template-columns: 1.5fr .7fr; gap: 9px; margin-top: 15px; }.primary-button { color: #fff; background: var(--ink); border: 0; }.secondary-button { color: var(--ink); background: #fff; border: 1px solid #cfd8e0; }
.copy-button { min-height: 37px; padding: 0 12px; color: var(--ink); background: #fff; border: 1px solid #cfd8e0; }.copy-button:disabled { cursor: not-allowed; opacity: .42; }
.password-output { display: block; width: 100%; min-height: 80px; padding: 20px 12px; color: #8b97a4; background: #101b27; border: 1px solid #263747; border-radius: 12px; font-family: "SFMono-Regular", Consolas, monospace; font-size: clamp(23px, 8vw, 35px); font-weight: 900; text-align: center; overflow-wrap: anywhere; }.password-output.ready { color: #5ce5b0; text-shadow: 0 0 18px rgba(92,229,176,.2); }
.details-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }.details-grid div { min-width: 0; padding: 11px; background: #f7f9fa; border: 1px solid #e1e6eb; border-radius: 9px; }.details-grid span, .details-grid strong { display: block; }.details-grid span { margin-bottom: 6px; color: var(--muted); font-size: 10px; }.details-grid strong { min-height: 18px; font-family: monospace; font-size: 12px; overflow-wrap: anywhere; }
footer { display: flex; justify-content: space-between; gap: 12px; padding: 8px 3px 0; color: #7d8996; font-size: 9px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 480px) { .scan-actions { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 370px) { .local-pill { display: none; }.scan-actions, .actions { grid-template-columns: 1fr; }.camera-stage { height: 225px; }.details-grid { grid-template-columns: 1fr; } }
@media (min-width: 860px) { .app-shell { width: min(1100px, calc(100% - 40px)); display: grid; grid-template-columns: 1.05fr .95fr; gap: 14px; align-content: center; padding-block: 28px; }.app-header, footer { grid-column: 1 / -1; }.scanner-panel { grid-row: 2 / span 2; margin: 0; }.tool-panel, .result-panel { margin: 0; }.camera-stage { height: 345px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }
