:root {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Noto Sans TC", system-ui, sans-serif;
  color: #fff;
  background: #050505;
  color-scheme: dark;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body, #app, .stage { width: 100%; height: 100%; margin: 0; overflow: hidden; background: #050505; }
body { touch-action: manipulation; }
button, input, select { font: inherit; }
button { color: inherit; }
.stage { position: relative; isolation: isolate; touch-action: none; }
#camera, #vrmCanvas, .debug-canvas { position:absolute; inset:0; width:100%; height:100%; }
#camera { object-fit: cover; background: #111; }
#vrmCanvas { z-index: 2; }
.debug-canvas { z-index: 3; pointer-events:none; }
.hidden { display:none !important; }
.glass { background: rgba(10,10,10,.56); backdrop-filter: blur(18px) saturate(1.15); -webkit-backdrop-filter: blur(18px) saturate(1.15); border: 1px solid rgba(255,255,255,.10); box-shadow: 0 12px 30px rgba(0,0,0,.28); }
.topbar { position:absolute; z-index:8; top:calc(var(--safe-top) + 10px); left:12px; right:12px; border-radius:18px; padding:10px 12px 10px 14px; display:flex; align-items:center; justify-content:space-between; pointer-events:auto; }
.app-title { font-weight:800; font-size:12px; letter-spacing:.14em; }
.status { color:rgba(255,255,255,.68); font-size:11px; margin-top:3px; max-width:70vw; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.icon-btn { width:38px; height:38px; border-radius:50%; border:0; background:rgba(255,255,255,.09); font-size:20px; display:grid; place-items:center; }
.primary, .secondary { min-height:44px; border-radius:14px; border:0; padding:0 15px; font-weight:700; }
.primary { background:#fff; color:#111; }
.secondary { background:rgba(255,255,255,.10); color:#fff; border:1px solid rgba(255,255,255,.10); }
.tap-prompt { position:absolute; z-index:15; inset:0; display:grid; place-items:center; background:rgba(0,0,0,.55); cursor:pointer; pointer-events:auto; }
.tap-card { padding:22px 32px; border-radius:24px; text-align:center; display:flex; flex-direction:column; align-items:center; gap:8px; pointer-events:auto; }
.tap-icon { font-size:36px; }
.tap-title { font-size:16px; font-weight:700; color:#fff; }
.fineprint { color:rgba(255,255,255,.45); font-size:11px; line-height:1.5; margin-top:14px; }
.lens-bar { position:absolute; z-index:8; left:50%; transform:translateX(-50%); bottom:calc(var(--safe-bottom) + 98px); display:flex; align-items:center; gap:10px; padding:4px 10px; border-radius:24px; background:rgba(12,12,12,.55); backdrop-filter:blur(18px); -webkit-backdrop-filter:blur(18px); border:1px solid rgba(255,255,255,.14); pointer-events:auto; user-select:none; -webkit-user-select:none; box-shadow:0 8px 24px rgba(0,0,0,.35); }
.lens-pill { width:34px; height:34px; border-radius:50%; border:0; background:rgba(255,255,255,.12); color:#fff; font-size:11px; font-weight:700; display:grid; place-items:center; cursor:pointer; padding:0; transition:all .18s cubic-bezier(0.2,0.8,0.2,1); }
.lens-pill:active { transform:scale(.92); }
.lens-pill.active { background:#ffd60a; color:#000; font-weight:800; transform:scale(1.08); box-shadow:0 0 12px rgba(255,214,10,.5); }
.capturebar { position:absolute; z-index:8; left:12px; right:12px; bottom:calc(var(--safe-bottom) + 12px); height:78px; border-radius:24px; display:flex; align-items:center; justify-content:space-around; padding:8px 10px; pointer-events:auto; }
.tool-btn { min-width:58px; border:0; background:transparent; color:rgba(255,255,255,.9); font-size:12px; display:flex; gap:5px; align-items:center; justify-content:center; flex-direction:column; }
.dot { width:7px; height:7px; border-radius:50%; background:#777; display:block; }
.dot.active { background:#66e584; box-shadow:0 0 10px rgba(102,229,132,.8); }
.shutter { width:58px; height:58px; border-radius:50%; border:4px solid rgba(255,255,255,.95); background:rgba(255,255,255,.18); box-shadow:inset 0 0 0 4px rgba(0,0,0,.25); }
.record { width:46px; height:46px; border:2px solid rgba(255,255,255,.75); border-radius:50%; background:transparent; display:grid; place-items:center; }
.record span { width:20px; height:20px; border-radius:50%; background:#ff3b30; transition:.2s; }
.record.recording span { width:17px; height:17px; border-radius:4px; }
.drawer-backdrop { position:absolute; z-index:18; inset:0; background:rgba(0,0,0,.28); pointer-events:auto; }
.drawer { position:absolute; z-index:20; left:0; right:0; bottom:0; transform:translateY(102%); transition:transform .28s ease; max-height:82dvh; overflow:auto; border-radius:28px 28px 0 0; padding:10px 16px calc(var(--safe-bottom) + 22px); background:#151515; border-top:1px solid rgba(255,255,255,.1); pointer-events:auto; overscroll-behavior:contain; touch-action:pan-y; }
.drawer.open { transform:translateY(0); }
.drawer-handle { width:46px; height:5px; border-radius:5px; background:#444; margin:2px auto 10px; }
.drawer-header { display:flex; justify-content:space-between; align-items:center; font-size:18px; margin-bottom:4px; }
.drawer section { padding:14px 0; border-bottom:1px solid rgba(255,255,255,.08); }
.section-title { font-size:12px; color:rgba(255,255,255,.48); text-transform:uppercase; letter-spacing:.08em; margin-bottom:10px; }
.row { display:flex; align-items:center; gap:8px; }
.buttons { margin-top:6px; }
.grow { flex:1; }
.model-info { margin-top:10px; font-size:12px; color:rgba(255,255,255,.58); overflow-wrap:anywhere; }
.switch-row, .select-row { min-height:42px; display:flex; align-items:center; justify-content:space-between; gap:16px; font-size:14px; }
.switch-row input { width:20px; height:20px; accent-color:#fff; }
.select-row select { background:#252525; border:1px solid #333; color:#fff; border-radius:10px; padding:8px 10px; }
.range-row { display:grid; grid-template-columns:70px 1fr 48px; align-items:center; gap:10px; min-height:42px; font-size:13px; }
.range-row input { width:100%; accent-color:#fff; }
.range-row output { text-align:right; color:rgba(255,255,255,.55); font-variant-numeric: tabular-nums; }
.drawer-footer { padding-top:16px; color:rgba(255,255,255,.4); font-size:11px; text-align:center; }
.result-modal { position:absolute; z-index:30; inset:0; display:grid; place-items:center; background:rgba(0,0,0,.68); padding:16px; pointer-events:auto; }
.result-card { width:min(100%, 520px); max-height:90dvh; border-radius:24px; padding:12px; position:relative; }
.preview { width:100%; max-height:72dvh; object-fit:contain; border-radius:16px; background:#000; }
.result-close { position:absolute; right:18px; top:18px; z-index:2; background:rgba(0,0,0,.55); }
@media (min-width: 700px) {
  .drawer { left:auto; width:390px; top:12px; bottom:12px; right:12px; border-radius:24px; transform:translateX(110%); max-height:none; }
  .drawer.open { transform:translateX(0); }
}
.front-camera #camera, .front-camera #vrmCanvas, .front-camera #debugCanvas { transform: scaleX(-1); }
