:root {
  --ink: #18222f;
  --muted: #6f7d8d;
  --line: #e5ebf1;
  --blue: #1769e0;
  --blue-dark: #0b50b5;
  --blue-soft: #eaf3ff;
  --green: #16a36a;
  --green-soft: #e9f8f1;
  --surface: #ffffff;
  --page: #f4f7fa;
  --shadow: 0 18px 45px rgba(26, 68, 121, .09);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--page); }
body { margin: 0; min-height: 100%; color: var(--ink); background: radial-gradient(circle at 50% 0, #fff 0, #f4f8fc 42%, #eef3f7 100%); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.app-shell { width: min(100%, 430px); min-height: 100dvh; margin: 0 auto; background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,251,253,.96)); position: relative; overflow: hidden; box-shadow: 0 0 60px rgba(34, 61, 92, .12); }
.topbar { min-height: 78px; display: flex; align-items: center; gap: 11px; padding: max(14px, env(safe-area-inset-top)) 20px 12px; border-bottom: 1px solid rgba(226,234,241,.85); background: rgba(255,255,255,.84); backdrop-filter: blur(18px); }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: #fff; background: linear-gradient(145deg, #2c80f2, #0f5dcc); box-shadow: 0 8px 19px rgba(23,105,224,.24); }
.brand-mark svg { width: 29px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.topbar-copy { min-width: 0; flex: 1; }
.eyebrow { margin: 0 0 2px; color: #7d8b99; font-size: 11px; letter-spacing: .16em; }
.topbar h1 { margin: 0; font-size: 16px; font-weight: 650; white-space: nowrap; }
.demo-chip { flex: none; padding: 6px 9px; color: #5c6c7d; background: #edf2f6; border: 1px solid #dce5ec; border-radius: 999px; font-size: 10px; font-weight: 650; }
.demo-chip.dark { color: rgba(255,255,255,.82); background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); }
.icon-button { width: 38px; height: 38px; border: 0; background: transparent; padding: 8px; color: var(--ink); }
.icon-button svg { fill: none; stroke: currentColor; stroke-width: 2; }

.screen { min-height: calc(100dvh - 78px); padding: 26px 20px calc(24px + env(safe-area-inset-bottom)); }
.screen[hidden] { display: none !important; }
.hero { text-align: center; }
.hero-orbit { width: 126px; height: 126px; margin: 0 auto 17px; position: relative; display: grid; place-items: center; }
.orbit { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(23,105,224,.13); }
.orbit-one { animation: breathe 2.8s ease-in-out infinite; }
.orbit-two { inset: 11px; border-style: dashed; animation: rotate 12s linear infinite; }
.face-icon { width: 82px; height: 82px; display: grid; place-items: center; border-radius: 30px; color: var(--blue); background: linear-gradient(145deg, #f1f7ff, #dbeaff); box-shadow: inset 0 0 0 1px rgba(23,105,224,.08), 0 15px 35px rgba(23,105,224,.15); }
.face-icon svg { width: 57px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.face-icon .face-check { stroke: var(--green); stroke-width: 4; }
.hero h2, .prepare-content h2, .success-screen h2 { margin: 0; font-size: 25px; letter-spacing: -.02em; }
.hero > p, .prepare-content > p { max-width: 330px; margin: 9px auto 0; color: var(--muted); font-size: 14px; line-height: 1.7; }

.identity-card { margin-top: 25px; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.identity-card-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 14px; font-weight: 650; }
.secure-label { color: var(--green); font-size: 11px; font-weight: 500; }
.secure-label i { display: inline-block; width: 7px; height: 7px; margin-right: 5px; background: var(--green); border-radius: 50%; box-shadow: 0 0 0 4px rgba(22,163,106,.1); }
dl { margin: 0; }
.identity-card dl > div, .result-card dl > div { display: flex; justify-content: space-between; gap: 20px; padding: 13px 0; border-top: 1px solid #eef2f5; font-size: 14px; }
dt { color: var(--muted); }
dd { margin: 0; text-align: right; font-weight: 560; }
.notice-card { display: flex; gap: 11px; margin: 15px 0; padding: 14px; border-radius: 15px; color: #335477; background: #edf6ff; border: 1px solid #dbeeff; }
.notice-card svg { flex: none; width: 23px; fill: none; stroke: var(--blue); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.notice-card strong, .result-warning strong { display: block; margin-bottom: 3px; font-size: 13px; }
.notice-card p, .result-warning p { margin: 0; font-size: 12px; line-height: 1.55; }
.consent-row { display: flex; align-items: flex-start; gap: 10px; margin: 18px 2px; color: #5b6877; font-size: 12px; line-height: 1.6; cursor: pointer; }
.consent-row input { position: absolute; opacity: 0; pointer-events: none; }
.checkmark { flex: none; width: 19px; height: 19px; margin-top: 1px; border: 1.5px solid #b9c5d1; border-radius: 6px; background: #fff; position: relative; }
.consent-row input:checked + .checkmark { background: var(--blue); border-color: var(--blue); }
.consent-row input:checked + .checkmark::after { content: ""; position: absolute; left: 5px; top: 2px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.consent-row input:focus-visible + .checkmark { outline: 3px solid rgba(23,105,224,.2); }
.primary-button { width: 100%; min-height: 52px; display: flex; align-items: center; justify-content: center; gap: 7px; border: 0; border-radius: 15px; color: #fff; background: linear-gradient(135deg, #2479ec, #0e5ecf); font-weight: 650; box-shadow: 0 10px 24px rgba(23,105,224,.24); cursor: pointer; transition: transform .18s ease, opacity .18s ease; }
.primary-button:not(:disabled):active { transform: scale(.985); }
.primary-button:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.primary-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.legal-note { margin: 13px auto 0; color: #8c98a5; text-align: center; font-size: 10px; line-height: 1.5; }

.step-indicator { display: flex; justify-content: center; gap: 8px; margin: 0 0 25px; }
.step-indicator span { width: 26px; height: 4px; border-radius: 10px; background: #dfe6ed; }
.step-indicator .done, .step-indicator .active { background: var(--blue); }
.step-indicator .active { width: 45px; }
.prepare-content { text-align: center; }
.camera-illustration { width: 176px; height: 176px; margin: 8px auto 22px; position: relative; display: grid; place-items: center; }
.phone-outline { width: 93px; height: 142px; padding: 20px 12px; border: 3px solid var(--blue); border-radius: 25px; position: relative; z-index: 2; background: #f8fbff; box-shadow: 0 15px 35px rgba(23,105,224,.16); }
.phone-outline > span { position: absolute; top: 8px; left: 37px; width: 16px; height: 3px; border-radius: 3px; background: #8bb7f0; }
.mini-face { height: 100%; border: 1.5px dashed #8bb7f0; border-radius: 38px 38px 25px 25px; position: relative; }
.mini-face i { position: absolute; top: 38px; width: 6px; height: 3px; border-radius: 50%; background: var(--blue); }
.mini-face i:first-child { left: 16px; } .mini-face i:nth-child(2) { right: 16px; }
.mini-face b { position: absolute; left: 24px; bottom: 26px; width: 14px; height: 7px; border-bottom: 2px solid var(--blue); border-radius: 50%; }
.soft-ring { position: absolute; border-radius: 50%; background: rgba(23,105,224,.06); }
.ring-a { inset: 8px; animation: breathe 2.6s infinite; }
.ring-b { inset: 27px; background: rgba(23,105,224,.08); }
.tips-list { margin: 26px 0 32px; padding: 0; list-style: none; text-align: left; }
.tips-list li { display: flex; align-items: center; gap: 13px; padding: 12px 8px; }
.tips-list li > span { flex: none; width: 29px; height: 29px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 50%; font-size: 12px; font-weight: 700; }
.tips-list strong { font-size: 14px; }
.tips-list p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }

.camera-screen { padding: 0; min-height: 100dvh; color: #fff; background: #07111d; }
.camera-header { height: 76px; display: flex; align-items: center; justify-content: space-between; padding: max(14px, env(safe-area-inset-top)) 16px 10px; background: #07111d; }
.camera-header > div { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.camera-header strong { font-size: 15px; }.camera-header span { color: rgba(255,255,255,.6); font-size: 10px; }
.camera-close { width: 38px; height: 38px; border: 0; border-radius: 50%; color: #fff; background: rgba(255,255,255,.1); font-size: 27px; font-weight: 300; line-height: 1; cursor: pointer; }
.camera-stage { height: min(61dvh, 540px); min-height: 400px; position: relative; overflow: hidden; background: radial-gradient(circle at 50% 35%, #2a3949, #0d1825 63%); }
#cameraVideo { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.camera-placeholder { position: absolute; inset: 0; display: none; place-items: center; align-content: center; color: rgba(255,255,255,.68); text-align: center; }
.camera-placeholder.is-visible { display: grid; }
.camera-placeholder svg { width: 105px; fill: none; stroke: rgba(255,255,255,.2); stroke-width: 1.4; }
.camera-placeholder p { margin: 14px 0 4px; color: #fff; font-size: 15px; }
.camera-placeholder span { font-size: 12px; }
.scan-shade { position: absolute; inset: 0; background: radial-gradient(ellipse 132px 182px at 50% 44%, transparent 63%, rgba(3,9,16,.6) 65%); pointer-events: none; }
.face-frame { position: absolute; left: 50%; top: 44%; width: 232px; height: 314px; border: 2px solid rgba(96,179,255,.85); border-radius: 48% 48% 44% 44%; transform: translate(-50%, -50%); box-shadow: 0 0 0 1px rgba(255,255,255,.14), 0 0 25px rgba(56,153,255,.2); overflow: hidden; }
.face-frame span::before, .face-frame span::after { content: ""; position: absolute; left: 50%; width: 58%; height: 1px; background: rgba(255,255,255,.16); transform: translateX(-50%); }
.face-frame span::before { top: 36%; }.face-frame span::after { top: 67%; }
.scan-line { position: absolute; left: 13%; top: 14%; width: 74%; height: 1px; background: linear-gradient(90deg, transparent, #63c7ff, transparent); box-shadow: 0 0 13px #27aeff; animation: scan 2.4s ease-in-out infinite; }
.quality-pill { position: absolute; left: 50%; bottom: 21px; display: flex; align-items: center; gap: 7px; padding: 7px 13px; background: rgba(7,17,29,.65); border: 1px solid rgba(255,255,255,.14); border-radius: 999px; transform: translateX(-50%); backdrop-filter: blur(10px); white-space: nowrap; font-size: 11px; }
.quality-pill i { width: 7px; height: 7px; border-radius: 50%; background: #61c998; box-shadow: 0 0 0 4px rgba(97,201,152,.12); }
.action-panel { min-height: calc(39dvh - 76px); padding: 18px 24px calc(20px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: 52px 1fr; gap: 12px 13px; align-content: center; background: #07111d; }
.action-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 18px; color: #74bfff; background: rgba(48,134,222,.14); border: 1px solid rgba(96,179,255,.16); }
.action-icon svg { width: 39px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; transition: transform .3s ease; }
.action-icon.blink svg { animation: nod .9s ease-in-out infinite; }.action-icon.turn svg { animation: turn 1.3s ease-in-out infinite; }
.action-copy p { margin: 1px 0 2px; color: #6abaff; font-size: 11px; }.action-copy h2 { margin: 0; font-size: 19px; }.action-copy span { color: rgba(255,255,255,.53); font-size: 11px; }
.progress-track { grid-column: 1 / -1; height: 4px; margin-top: 4px; overflow: hidden; border-radius: 6px; background: rgba(255,255,255,.1); }
.progress-track i { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #2a83eb, #65c7ff); transition: width .12s linear; }
.ghost-button { grid-column: 1 / -1; min-height: 42px; border: 1px solid rgba(255,255,255,.24); border-radius: 13px; color: #fff; background: rgba(255,255,255,.07); cursor: pointer; }

.success-screen { text-align: center; padding-top: 55px; position: relative; }
.success-mark { width: 114px; height: 114px; margin: 0 auto 23px; display: grid; place-items: center; position: relative; }
.success-mark svg { width: 86px; position: relative; fill: var(--green); stroke: #fff; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 12px 18px rgba(22,163,106,.22)); }
.success-mark svg circle { stroke: var(--green); }
.success-pulse { position: absolute; inset: 2px; border-radius: 50%; background: rgba(22,163,106,.1); animation: breathe 2s infinite; }
.success-subtitle { margin: 8px 0 25px; color: var(--muted); font-size: 14px; }
.result-card { padding: 8px 18px 4px; text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.result-person { display: flex; align-items: center; gap: 11px; padding: 13px 0 17px; }
.result-person > div { width: 42px; height: 42px; display: grid; place-items: center; color: var(--blue); background: var(--blue-soft); border-radius: 14px; font-weight: 700; }
.result-person span { flex: 1; display: flex; flex-direction: column; gap: 3px; }.result-person strong { font-size: 15px; }.result-person small { color: var(--muted); font-size: 11px; }
.result-person em { padding: 5px 8px; color: var(--green); background: var(--green-soft); border-radius: 99px; font-size: 10px; font-style: normal; font-weight: 650; }
.result-card dl > div { font-size: 12px; }
.result-warning { margin: 15px 0 23px; padding: 13px 14px; color: #795e2a; text-align: left; background: #fff8e8; border: 1px solid #f6e8c2; border-radius: 14px; }
.success-confetti i { position: absolute; width: 6px; height: 14px; border-radius: 3px; background: #43b880; animation: fall 1.2s both; }
.success-confetti i:nth-child(1){left:20%;top:30px;transform:rotate(25deg)}.success-confetti i:nth-child(2){left:31%;top:68px;background:#3a8be6;animation-delay:.12s}.success-confetti i:nth-child(3){right:21%;top:44px;background:#f1b74a;transform:rotate(-35deg);animation-delay:.2s}.success-confetti i:nth-child(4){right:32%;top:17px;background:#7999ed;animation-delay:.3s}.success-confetti i:nth-child(5){left:12%;top:105px;background:#f0c64d;animation-delay:.18s}.success-confetti i:nth-child(6){right:12%;top:112px;background:#56c2c9;animation-delay:.35s}
.toast { position: absolute; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom)); z-index: 20; max-width: calc(100% - 48px); padding: 10px 16px; color: #fff; background: rgba(13,25,39,.9); border-radius: 10px; opacity: 0; transform: translate(-50%, 12px); transition: .22s ease; pointer-events: none; text-align: center; font-size: 12px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes rotate { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { transform: scale(1.08); opacity: .65; } }
@keyframes scan { 0%,100% { top: 14%; opacity: .2; } 50% { top: 85%; opacity: 1; } }
@keyframes nod { 50% { transform: scaleY(.88); } }
@keyframes turn { 35% { transform: translateX(-4px) rotate(-4deg); } 70% { transform: translateX(4px) rotate(4deg); } }
@keyframes fall { from { opacity: 0; transform: translateY(-15px) rotate(0); } to { opacity: 1; transform: translateY(12px) rotate(120deg); } }

@media (max-width: 360px) {
  .screen { padding-left: 16px; padding-right: 16px; }
  .topbar { padding-left: 14px; padding-right: 14px; }
  .topbar h1 { font-size: 14px; }
  .brand-mark { width: 38px; height: 38px; }
  .hero-orbit { width: 108px; height: 108px; }
  .face-icon { width: 72px; height: 72px; }
  .identity-card { margin-top: 19px; }
  .face-frame { width: 208px; height: 282px; }
}

@media (min-width: 431px) {
  body { padding: 22px 0; }
  .app-shell { min-height: calc(100dvh - 44px); border-radius: 28px; }
  .screen { min-height: calc(100dvh - 122px); }
  .camera-screen { min-height: calc(100dvh - 44px); border-radius: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
}
