@charset "UTF-8";

:root {
  --bg: #f5f4f0;
  --surface: #ffffff;
  --ink: #17231f;
  --muted: #6f7873;
  --line: #e7e8e2;
  --accent: #ef5b43;
  --accent-dark: #d94833;
  --accent-soft: #fff0eb;
  --green: #26755a;
  --green-soft: #eaf4ef;
  --dark: #18231f;
  --shadow: 0 18px 60px rgba(30, 42, 36, .07);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 0%, rgba(239, 91, 67, .055), transparent 28rem),
    var(--bg);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid rgba(239, 91, 67, .25); outline-offset: 3px; }
svg { display: block; }

.site-header {
  width: min(1180px, calc(100% - 48px));
  height: 92px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
  color: #fff; background: var(--accent); box-shadow: 0 7px 18px rgba(239, 91, 67, .22);
}
.brand-mark svg { width: 29px; height: 29px; }
.brand-copy { display: flex; flex-direction: column; gap: 2px; }
.brand-copy strong { font-size: 19px; letter-spacing: .06em; }
.brand-copy small { font-size: 8px; font-weight: 700; letter-spacing: .2em; color: #8a918d; }
.privacy-badge {
  display: flex; align-items: center; gap: 7px; padding: 9px 13px; border: 1px solid #dde6e0;
  border-radius: 999px; color: var(--green); background: rgba(255,255,255,.62); font-size: 12px; font-weight: 600;
}
.privacy-badge svg { width: 16px; height: 16px; }

.main-content { width: min(1180px, calc(100% - 48px)); margin: 10px auto 0; }
.app-shell {
  display: grid; grid-template-columns: .88fr 1.25fr; overflow: hidden;
  background: var(--surface); border: 1px solid rgba(224, 226, 219, .9); border-radius: 28px; box-shadow: var(--shadow);
}
.control-panel { padding: 44px 42px 38px; }
.step-kicker { display: flex; align-items: center; gap: 9px; color: #7c847f; font-size: 12px; font-weight: 600; letter-spacing: .08em; }
.step-kicker span, .section-number {
  display: inline-grid; place-items: center; width: 27px; height: 22px; border-radius: 6px;
  color: var(--accent); background: var(--accent-soft); font-size: 10px; font-weight: 800; letter-spacing: 0;
}
h1 { margin: 23px 0 17px; font-size: clamp(35px, 3.25vw, 47px); line-height: 1.2; letter-spacing: -.045em; font-weight: 800; }
h1 span { color: var(--accent); }
.intro { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.9; }
.number-field { margin-top: 32px; }
.number-field > label { display: block; margin-bottom: 10px; color: #39453f; font-size: 13px; font-weight: 700; }
.input-shell {
  height: 62px; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 17px;
  border: 1.5px solid #dcdfd8; border-radius: 14px; background: #fafbf8; transition: border-color .2s, box-shadow .2s, background .2s;
}
.input-shell:focus-within { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 4px rgba(239, 91, 67, .08); }
.input-shell.has-error { border-color: var(--accent); animation: shake .35s ease; }
.input-icon { flex: 0 0 auto; width: 22px; height: 22px; color: #8e9690; }
#trackingInput { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 21px; font-weight: 700; letter-spacing: .08em; }
#trackingInput::placeholder { color: #afb5af; font-size: 16px; font-weight: 400; letter-spacing: 0; }
.clear-input { flex: 0 0 auto; width: 24px; height: 24px; padding: 0; border: 0; background: transparent; color: #b5bbb6; }
.clear-input svg { width: 100%; height: 100%; }
.paste-button { flex: 0 0 auto; padding: 7px 9px; border: 0; border-left: 1px solid #e0e3dc; color: var(--green); background: transparent; font-size: 12px; font-weight: 600; }
.field-hint, .field-error { margin: 9px 0 0; font-size: 11px; line-height: 1.5; }
.field-hint { color: #929892; }
.field-error { color: var(--accent-dark); }
.quick-numbers { display: flex; align-items: center; gap: 7px; margin-top: 15px; font-size: 11px; }
.quick-numbers > span { margin-right: 3px; color: #929892; }
.quick-numbers button { padding: 5px 9px; border: 1px solid #e3e5de; border-radius: 7px; color: #67716b; background: #fafaf7; font-size: 11px; transition: .2s; }
.quick-numbers button:hover { border-color: #f0b4a8; color: var(--accent-dark); background: var(--accent-soft); }
.primary-button {
  width: 100%; height: 57px; margin-top: 28px; padding: 0 20px; display: flex; align-items: center; justify-content: center; gap: 11px;
  border: 0; border-radius: 14px; color: #fff; background: var(--accent); box-shadow: 0 10px 24px rgba(239, 91, 67, .22);
  font-size: 15px; font-weight: 700; transition: transform .2s, background .2s, box-shadow .2s;
}
.primary-button:hover { transform: translateY(-2px); background: var(--accent-dark); box-shadow: 0 13px 28px rgba(239, 91, 67, .27); }
.primary-button:active { transform: translateY(0); }
.primary-button:disabled { cursor: wait; opacity: .7; transform: none; }
.primary-button > svg { width: 21px; height: 21px; }
.primary-button .button-arrow { width: 18px; margin-left: auto; }
.primary-button > svg:first-child { margin-left: auto; }
.primary-button.is-active { background: var(--dark); box-shadow: none; }
.privacy-note { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 15px; color: #919790; font-size: 10px; }
.privacy-note svg { width: 14px; height: 14px; }

.scanner-panel { min-width: 0; padding: 28px; background: #fafaf7; border-left: 1px solid var(--line); }
.scanner-header { height: 43px; margin-bottom: 19px; display: flex; align-items: center; justify-content: space-between; }
.scanner-header > div:first-child { display: flex; align-items: center; gap: 10px; }
.scanner-header h2 { margin: 0; font-size: 16px; letter-spacing: -.02em; }
.section-number { color: #6d7771; background: #eceee8; }
.status-pill { display: flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 99px; color: #7e8781; background: #eceee8; font-size: 10px; }
.status-pill span { width: 6px; height: 6px; border-radius: 50%; background: #9aa29c; }
.status-pill b { font-weight: 600; }
.status-pill[data-state="ready"] { color: var(--green); background: var(--green-soft); }
.status-pill[data-state="ready"] span { background: #39a477; }
.status-pill[data-state="scanning"] { color: #2b6e5a; background: #e4f2eb; }
.status-pill[data-state="scanning"] span { background: #39a477; animation: pulse 1.3s infinite; }
.status-pill[data-state="found"] { color: var(--accent-dark); background: var(--accent-soft); }
.status-pill[data-state="found"] span { background: var(--accent); }
.camera-stage {
  position: relative; width: 100%; aspect-ratio: 1.36; min-height: 340px; overflow: hidden; isolation: isolate;
  border-radius: 19px; background: var(--dark); box-shadow: inset 0 0 0 1px rgba(255,255,255,.06);
}
#cameraVideo, #demoCanvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
#cameraVideo { display: none; }
.camera-stage.is-live #cameraVideo { display: block; }
#demoCanvas { background: #202b27; }
#overlayCanvas { position: absolute; inset: 0; z-index: 4; width: 100%; height: 100%; pointer-events: none; }
.camera-placeholder { position: absolute; inset: 0; z-index: 1; overflow: hidden; }
.shelf-illustration { width: 100%; height: 100%; object-fit: cover; opacity: .62; }
.placeholder-content { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 25px; text-align: center; color: white; background: radial-gradient(circle, rgba(17,28,23,.1), rgba(17,28,23,.25)); }
.placeholder-icon { width: 58px; height: 58px; margin-bottom: 17px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.18); border-radius: 17px; color: #f3f2e9; background: rgba(255,255,255,.09); backdrop-filter: blur(8px); }
.placeholder-icon svg { width: 31px; height: 31px; }
.placeholder-content h3 { margin: 0 0 9px; font-size: 17px; font-weight: 600; letter-spacing: .02em; }
.placeholder-content p { margin: 0; color: rgba(255,255,255,.6); font-size: 11px; }
.placeholder-content button { margin-top: 20px; padding: 7px 12px; border: 1px solid rgba(255,255,255,.15); border-radius: 8px; color: rgba(255,255,255,.72); background: rgba(0,0,0,.12); font-size: 10px; }
.placeholder-content button:hover { color: white; background: rgba(255,255,255,.1); }
.placeholder-content button span { margin-left: 4px; }
.scan-corners { position: absolute; inset: 24px; z-index: 3; pointer-events: none; opacity: .65; }
.scan-corners i { position: absolute; width: 27px; height: 27px; border-color: rgba(255,255,255,.8); border-style: solid; }
.scan-corners i:nth-child(1) { top: 0; left: 0; border-width: 2px 0 0 2px; border-radius: 5px 0 0; }
.scan-corners i:nth-child(2) { top: 0; right: 0; border-width: 2px 2px 0 0; border-radius: 0 5px 0 0; }
.scan-corners i:nth-child(3) { bottom: 0; left: 0; border-width: 0 0 2px 2px; border-radius: 0 0 0 5px; }
.scan-corners i:nth-child(4) { right: 0; bottom: 0; border-width: 0 2px 2px 0; border-radius: 0 0 5px; }
.camera-stage.is-live .scan-corners, .camera-stage.is-demo .scan-corners { opacity: .32; }
.scan-line { position: absolute; z-index: 3; left: 9%; right: 9%; top: 15%; height: 2px; background: linear-gradient(90deg, transparent, #ff8a72 20%, #ff6a50 50%, #ff8a72 80%, transparent); box-shadow: 0 0 14px 2px rgba(239,91,67,.4); animation: scanning 2.8s ease-in-out infinite; pointer-events: none; }
.camera-topbar { position: absolute; z-index: 6; top: 15px; left: 16px; right: 16px; display: flex; align-items: center; justify-content: space-between; }
.live-badge { display: flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 6px; color: #fff; background: rgba(12,20,17,.55); backdrop-filter: blur(8px); font-size: 9px; font-weight: 700; letter-spacing: .08em; }
.live-badge span { width: 6px; height: 6px; border-radius: 50%; background: #ff6953; box-shadow: 0 0 0 3px rgba(255,105,83,.17); }
.camera-actions { display: flex; gap: 7px; }
.camera-actions button { width: 34px; height: 34px; padding: 8px; border: 1px solid rgba(255,255,255,.12); border-radius: 9px; color: #fff; background: rgba(12,20,17,.52); backdrop-filter: blur(8px); }
.camera-actions button:hover, .camera-actions button.is-active { background: rgba(239,91,67,.8); }
.camera-actions svg { width: 100%; height: 100%; }
.scan-status { position: absolute; z-index: 5; left: 50%; bottom: 17px; transform: translateX(-50%); max-width: calc(100% - 34px); display: flex; align-items: center; gap: 8px; padding: 9px 13px; border: 1px solid rgba(255,255,255,.1); border-radius: 9px; color: rgba(255,255,255,.87); background: rgba(11,20,16,.66); backdrop-filter: blur(10px); font-size: 10px; white-space: nowrap; }
.scan-status > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.scan-spinner { flex: 0 0 auto; width: 12px; height: 12px; border: 1.5px solid rgba(255,255,255,.25); border-top-color: #ff846d; border-radius: 50%; animation: spin .8s linear infinite; }
.found-panel { position: absolute; z-index: 7; left: 14px; right: 14px; bottom: 14px; min-height: 72px; display: flex; align-items: center; gap: 11px; padding: 12px 13px; border: 1px solid rgba(255,255,255,.75); border-radius: 14px; background: rgba(255,255,255,.94); box-shadow: 0 10px 35px rgba(0,0,0,.2); backdrop-filter: blur(14px); animation: slideUp .35s ease; }
.found-icon { flex: 0 0 auto; width: 38px; height: 38px; padding: 8px; border-radius: 50%; color: #fff; background: var(--accent); }
.found-icon svg { width: 100%; height: 100%; }
.found-copy { min-width: 0; display: flex; flex: 1; flex-direction: column; gap: 4px; }
.found-copy strong { font-size: 12px; }
.found-copy span { color: #7a817c; font-size: 10px; }
.found-copy b { color: var(--accent-dark); letter-spacing: .05em; }
.found-actions { display: flex; align-items: center; gap: 7px; }
.found-actions button { height: 33px; border-radius: 8px; font-size: 10px; font-weight: 600; }
#savePhotoButton { width: 33px; padding: 7px; border: 1px solid #e1e3dd; background: #fff; }
#savePhotoButton svg { width: 100%; height: 100%; }
#resumeScanButton { padding: 0 10px; border: 0; color: white; background: var(--dark); }
.camera-error { position: absolute; inset: 0; z-index: 9; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 35px; color: white; text-align: center; background: #202c27; }
.error-icon { width: 48px; height: 48px; padding: 11px; border-radius: 14px; color: #ff917e; background: rgba(239,91,67,.12); }
.error-icon svg { width: 100%; height: 100%; }
.camera-error h3 { margin: 17px 0 8px; font-size: 16px; }
.camera-error p { max-width: 340px; margin: 0; color: #aeb8b2; font-size: 11px; line-height: 1.8; }
.camera-error button { margin-top: 19px; padding: 9px 18px; border: 0; border-radius: 9px; color: #fff; background: var(--accent); font-size: 11px; }
.scanner-footer { min-height: 48px; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-top: 16px; }
.scan-tip { display: flex; align-items: center; gap: 8px; color: #8a918c; font-size: 10px; line-height: 1.6; }
.scan-tip svg { flex: 0 0 auto; width: 17px; height: 17px; color: #7d8881; }
.scan-tip b { margin-right: 5px; color: #58635d; font-weight: 600; }
.demo-button { flex: 0 0 auto; padding: 4px 0; border: 0; border-bottom: 1px dashed #b2b8b2; color: #7c857f; background: transparent; font-size: 10px; }
.demo-button:hover { color: var(--accent); border-color: var(--accent); }

.how-it-works { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-top: 20px; }
.how-it-works article { display: flex; align-items: center; gap: 15px; padding: 20px 23px; border: 1px solid #e3e5de; border-radius: 17px; background: rgba(255,255,255,.65); }
.step-icon { flex: 0 0 auto; width: 43px; height: 43px; padding: 10px; border-radius: 12px; color: #6c7771; background: #ebece6; }
.step-icon svg { width: 100%; height: 100%; }
.how-it-works small { display: block; margin-bottom: 3px; color: #a0a69f; font-size: 8px; font-weight: 700; letter-spacing: .13em; }
.how-it-works h3 { display: inline; margin: 0 8px 0 0; font-size: 13px; }
.how-it-works p { display: inline; margin: 0; color: #858d87; font-size: 10px; }
.site-footer { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 28px 20px 32px; color: #9aa09a; font-size: 10px; }
.site-footer span { color: #757e78; font-weight: 600; }
.site-footer i { width: 3px; height: 3px; border-radius: 50%; background: #b7bcb6; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 28px; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 11px; color: white; background: rgba(23,35,31,.94); box-shadow: 0 10px 35px rgba(0,0,0,.18); font-size: 12px; text-align: center; animation: toastIn .25s ease; }

@keyframes scanning { 0%,100% { top: 14%; opacity: .55; } 50% { top: 82%; opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (max-width: 960px) {
  .app-shell { grid-template-columns: .85fr 1.15fr; }
  .control-panel { padding: 34px 28px; }
  .scanner-panel { padding: 22px; }
  .camera-stage { min-height: 330px; aspect-ratio: auto; height: 390px; }
  .how-it-works article { padding: 17px; gap: 11px; }
  .how-it-works p { display: block; margin-top: 4px; }
}

@media (max-width: 740px) {
  .site-header { width: calc(100% - 32px); height: 75px; }
  .brand-mark { width: 39px; height: 39px; border-radius: 11px; }
  .brand-mark svg { width: 26px; height: 26px; }
  .brand-copy strong { font-size: 17px; }
  .privacy-badge { padding: 8px 10px; font-size: 10px; }
  .main-content { width: calc(100% - 28px); margin-top: 4px; }
  .app-shell { display: flex; flex-direction: column; border-radius: 22px; }
  .control-panel { padding: 28px 23px 25px; }
  h1 { margin-top: 18px; font-size: 36px; }
  .intro { font-size: 13px; }
  .number-field { margin-top: 25px; }
  .input-shell { height: 58px; }
  .primary-button { margin-top: 23px; }
  .scanner-panel { padding: 22px 18px 18px; border-top: 1px solid var(--line); border-left: 0; }
  .camera-stage { height: auto; min-height: 320px; aspect-ratio: 1.15; }
  .scanner-footer { align-items: center; }
  .scan-tip { max-width: 80%; }
  .how-it-works { gap: 8px; margin-top: 12px; }
  .how-it-works article { flex-direction: column; align-items: flex-start; gap: 10px; padding: 15px 12px; }
  .step-icon { width: 35px; height: 35px; padding: 8px; }
  .how-it-works p { display: none; }
  .how-it-works h3 { font-size: 12px; }
  .site-footer { flex-wrap: wrap; gap: 8px; padding-top: 23px; font-size: 9px; }
}

@media (max-width: 420px) {
  .privacy-badge { border: 0; padding-right: 0; background: transparent; }
  .privacy-badge svg { width: 14px; }
  .brand-copy small { display: none; }
  .control-panel { padding: 25px 20px; }
  h1 { font-size: 33px; }
  .scanner-panel { padding: 20px 13px 15px; }
  .camera-stage { min-height: 330px; aspect-ratio: .98; }
  .placeholder-content h3 { font-size: 15px; }
  .found-panel { gap: 8px; padding: 10px; }
  .found-icon { width: 32px; height: 32px; }
  .found-copy strong { font-size: 11px; }
  .found-copy span { font-size: 9px; }
  #resumeScanButton { padding: 0 8px; }
  .scan-tip span { font-size: 9px; }
  .scan-tip b { display: block; }
}

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