:root {
  --navy: #1e2a44; --navy-2: #141c30; --cream: #f3eee4; --paper: #faf7f1; --ink: #1f2433; --muted: #6b7080;
  --orange: #f57814; --line: rgba(30, 42, 68, .14); --card: #ffffff; --r: 14px;
  --font: -apple-system, "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.5 var(--font); -webkit-text-size-adjust: 100%; }
body { min-height: 100dvh; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px 6px; }
.brand { display: flex; align-items: baseline; gap: 6px; font-weight: 700; letter-spacing: .02em; }
.brand-nova { color: var(--orange); font-size: 15px; }
.brand-kids { color: var(--navy); font-size: 15px; }
.brand-sep { width: 1px; height: 12px; background: var(--line); margin: 0 4px; align-self: center; }
.brand-name { color: var(--navy); font-size: 14px; font-weight: 500; }
.pid { font: 700 13px/1 ui-monospace, Menlo, monospace; letter-spacing: .12em; color: var(--orange); background: rgba(245, 120, 20, .1); padding: 7px 10px; border-radius: 999px; }
main { flex: 1; display: flex; flex-direction: column; }
.screen { width: 100%; max-width: 480px; margin: 0 auto; padding: 8px 20px 32px; display: flex; flex-direction: column; gap: 14px; }
h1 { font-size: 24px; line-height: 1.25; letter-spacing: -.01em; margin: 6px 0 0; color: var(--navy); }
.lead { margin: 0; color: var(--muted); font-size: 15px; }
.hero { width: 62%; align-self: center; border-radius: 8px; box-shadow: 0 10px 30px rgba(30, 42, 68, .18); margin: 8px 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 22px; border-radius: 999px; border: 0; font: 600 17px/1 var(--font); cursor: pointer; text-decoration: none; transition: transform .12s ease, background .15s ease; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: translateY(1px) scale(.985); }
.btn-primary { background: var(--orange); color: #fff; box-shadow: 0 8px 20px rgba(245, 120, 20, .28); }
.btn-ghost { background: transparent; color: var(--navy); border: 1.5px solid var(--line); }
.btn-ghost-dark { background: rgba(255, 255, 255, .14); color: #fff; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, .22); }
.btn-small { min-height: 42px; padding: 0 14px; font-size: 14px; }
.err { color: #b3261e; margin: 0; font-size: 14px; }
.guide { position: relative; align-self: center; width: 56%; margin: 4px 0 8px; }
.guide img { width: 100%; border-radius: 6px; display: block; opacity: .92; }
.guide-frame { position: absolute; inset: -10px; border: 2px dashed rgba(245, 120, 20, .8); border-radius: 12px; }
/* 识别中 */
.busy-card { display: flex; gap: 18px; align-items: center; background: var(--card); border-radius: var(--r); padding: 18px; box-shadow: 0 6px 24px rgba(30, 42, 68, .08); margin-top: 40px; }
#busyThumb { width: 90px; height: 120px; border-radius: 8px; background: var(--navy); object-fit: cover; }
.busy-text { flex: 1; }
.busy-stage { font-weight: 600; color: var(--navy); margin-bottom: 10px; }
.bar { height: 8px; border-radius: 999px; background: rgba(30, 42, 68, .1); overflow: hidden; }
.bar-fill { height: 100%; width: 5%; background: var(--orange); border-radius: 999px; transition: width .35s ease; }
/* 确认 */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.compare figure { margin: 0; background: var(--navy); border-radius: var(--r); padding: 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.compare canvas { width: 100%; height: auto; max-height: 260px; object-fit: contain; }
.compare figcaption { color: var(--cream); font-size: 13px; opacity: .8; }
.rows { display: flex; flex-direction: column; background: var(--card); border-radius: var(--r); overflow: hidden; box-shadow: 0 4px 18px rgba(30, 42, 68, .06); }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.row + .row { border-top: 1px solid var(--line); }
.row .thumb { width: 52px; height: 52px; border-radius: 10px; background: var(--cream); display: flex; align-items: center; justify-content: center; overflow: hidden; flex: none; }
.row .thumb img { max-width: 44px; max-height: 44px; }
.row .thumb.empty { color: var(--muted); font-size: 12px; }
.row .label { flex: 1; }
.row .label b { display: block; font-size: 15px; color: var(--navy); }
.row .label span { font-size: 12px; color: var(--muted); }
.row .swap { min-height: 36px; padding: 0 14px; font-size: 14px; border-radius: 999px; border: 1.5px solid var(--line); background: transparent; color: var(--navy); font-family: var(--font); }
.props-head { font-weight: 600; color: var(--navy); margin-top: 2px; }
.pockets { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.pocket { aspect-ratio: 1; border-radius: 12px; background: var(--card); border: 1.5px dashed var(--line); display: flex; align-items: center; justify-content: center; overflow: hidden; -webkit-tap-highlight-color: transparent; }
.pocket img { max-width: 80%; max-height: 80%; }
.pocket.filled { border-style: solid; }
/* 抽屉 */
.sheet { position: fixed; inset: 0; background: rgba(20, 28, 48, .45); z-index: 20; display: flex; align-items: flex-end; }
.sheet-panel { background: var(--paper); width: 100%; max-height: 78dvh; border-radius: 20px 20px 0 0; padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; color: var(--navy); }
.sheet-close { border: 0; background: transparent; color: var(--muted); font: 500 14px var(--font); padding: 6px 8px; }
.sheet-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.sheet-tools button { border: 1.5px solid var(--line); background: transparent; border-radius: 999px; padding: 6px 12px; font: 500 13px var(--font); color: var(--navy); }
.sheet-tools button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; overflow-y: auto; padding-bottom: 6px; }
.grid button { aspect-ratio: 1; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); display: flex; align-items: center; justify-content: center; padding: 6px; }
.grid button img { max-width: 100%; max-height: 100%; }
.grid button.on { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(245, 120, 20, .25); }
.grid button.none { color: var(--muted); font: 500 13px var(--font); }
/* AR */
.screen-ar { max-width: none; padding: 0; position: fixed; inset: 0; background: var(--navy-2); z-index: 10; gap: 0; }
.ar-stage { position: absolute; inset: 0; overflow: hidden; }
.ar-stage video, .ar-stage img.src { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; }
.ar-stage canvas { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.ar-hint { position: absolute; top: calc(18px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); background: rgba(20, 28, 48, .6); color: #fff; padding: 8px 14px; border-radius: 999px; font-size: 14px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: opacity .3s; white-space: nowrap; }
.ar-hint.off { opacity: 0; visibility: hidden; }
.ar-bar { position: absolute; left: 0; right: 0; bottom: calc(20px + env(safe-area-inset-bottom)); display: flex; justify-content: center; align-items: center; gap: 12px; padding: 0 16px; }
.snap { position: absolute; inset: 0; background: rgba(20, 28, 48, .92); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 20px; z-index: 5; }
.snap img { max-width: 100%; max-height: 70dvh; border-radius: 12px; box-shadow: 0 16px 40px rgba(0, 0, 0, .5); }
.snap-tip { color: #fff; font-size: 14px; opacity: .85; }
@media (prefers-reduced-motion: reduce) { .btn, .bar-fill, .ar-hint { transition: none; } }

/* 起名字 */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; color: var(--navy); font-weight: 600; }
.field input { min-height: 48px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); padding: 0 14px; font: 16px var(--font); color: var(--ink); }
.field input::placeholder { color: #8a8f9c; }
.field input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(245, 120, 20, .18); }
.ar-corner { position: absolute; left: 16px; top: calc(16px + env(safe-area-inset-top)); }
