/* =========================================================
   Steven專用名片簿系統 — 樣式
   暗色科技風 · 大字體大按鈕 · RGB 流光邊框 · 全圓角
   ========================================================= */
:root {
  --bg: #05070d;
  --bg2: #0a0f1c;
  --panel: #0d1424;
  --panel2: #121c31;
  --line: rgba(140, 170, 230, .16);
  --text: #e8f1ff;
  --muted: #8ea3c7;
  --dim: #5c6f93;
  --cyan: #00e5ff;
  --violet: #8b5cf6;
  --pink: #ff2bd6;
  --green: #22f59a;
  --amber: #ffb020;
  --red: #ff4d6d;
  --line-green: #06c755;
  --r-sm: 12px;
  --r: 18px;
  --r-lg: 24px;
  --fs: 18px;
  --tab-h: 76px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

@property --ang {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font-family: 'Noto Sans TC', system-ui, -apple-system, 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  font-size: var(--fs);
  line-height: 1.5;
  min-height: 100dvh;
  overflow-x: hidden;
  padding-bottom: calc(var(--tab-h) + var(--safe-b) + 16px);
}
body.no-tab { padding-bottom: calc(var(--safe-b) + 24px); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 26px; height: 26px; flex: none; }
img, video, canvas { border-radius: var(--r-sm); }
a { color: var(--cyan); }

/* 背景網格 */
.bg-grid {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(139, 92, 246, .18), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(0, 229, 255, .12), transparent 60%),
    linear-gradient(rgba(120, 160, 255, .05) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, rgba(120, 160, 255, .05) 1px, transparent 1px) 0 0 / 28px 28px,
    var(--bg);
}
#fx { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 9999; pointer-events: none; border-radius: 0; }

/* ---------- RGB 流光邊框 ---------- */
.rgb { position: relative; isolation: isolate; }
.rgb::before, .rgb::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  padding: 1.6px;
  background: conic-gradient(from var(--ang),
    rgba(255,255,255,.07) 0deg 200deg,
    #00e5ff 230deg, #8b5cf6 262deg, #ff2bd6 292deg, #ffb020 320deg, #22f59a 344deg,
    rgba(255,255,255,.07) 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: rgbspin 4.2s linear infinite;
  animation-delay: var(--d, 0s);
  z-index: 2;
}
.rgb::after { filter: blur(7px); opacity: .55; padding: 2px; z-index: -1; }
@keyframes rgbspin { to { --ang: 360deg; } }

/* ---------- 頂部列 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 10px;
  padding: calc(var(--safe-t) + 10px) 16px 10px;
  background: rgba(5, 7, 13, .82);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { flex: 1; display: flex; align-items: baseline; gap: 8px; min-width: 0; white-space: nowrap; overflow: hidden; }
.brand-en { font-family: Orbitron, sans-serif; font-weight: 900; letter-spacing: .08em; font-size: 20px;
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.topbar.sub .brand-en { display: none; }
.brand-zh { font-weight: 700; font-size: 18px; overflow: hidden; text-overflow: ellipsis; }
.icon-btn {
  display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line); color: var(--text); padding: 0;
}
.icon-btn:active { transform: scale(.94); }
.sync-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px;
  border-radius: 999px; background: var(--panel); border: 1px solid var(--line);
  font-size: 14px; color: var(--muted); white-space: nowrap;
}
.sync-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--dim); box-shadow: 0 0 0 0 transparent; }
.sync-pill.ok .sync-dot { background: var(--green); box-shadow: 0 0 10px var(--green); }
.sync-pill.err .sync-dot { background: var(--red); box-shadow: 0 0 10px var(--red); }
.sync-pill.syncing { color: var(--cyan); border-color: rgba(0,229,255,.5); }
.sync-pill.syncing .sync-dot {
  width: 16px; height: 16px; background: none; border: 2.5px solid rgba(0,229,255,.25);
  border-top-color: var(--cyan); animation: spin .7s linear infinite;
}
.sync-line { position: sticky; top: calc(var(--safe-t) + 69px); z-index: 49; height: 3px; margin-top: -3px; opacity: 0; transition: opacity .2s; }
.sync-line.on { opacity: 1; background: linear-gradient(90deg, transparent, var(--cyan), var(--violet), var(--pink), transparent); background-size: 200% 100%; animation: slide 1.1s linear infinite; }
@keyframes slide { from { background-position: 200% 0; } to { background-position: 0 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 處理中提示列 ---------- */
.dock { position: sticky; top: calc(var(--safe-t) + 69px); z-index: 48; max-width: 760px; margin: 0 auto; }
.busybar {
  margin: 12px 16px 0; padding: 16px 18px; border-radius: var(--r);
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(135deg, rgba(0,229,255,.16), rgba(139,92,246,.2));
  border: 1.5px solid rgba(0,229,255,.55);
  box-shadow: 0 0 24px rgba(0,229,255,.25), inset 0 0 20px rgba(139,92,246,.15);
  animation: fadeIn .2s ease;
}
.busybar[hidden] { display: none; }
.busy-ring { position: relative; width: 46px; height: 46px; flex: none; }
.busy-ring i { position: absolute; inset: 0; border-radius: 50%; border: 4px solid transparent; }
.busy-ring i:nth-child(1) { border-top-color: var(--cyan); animation: spin .8s linear infinite; }
.busy-ring i:nth-child(2) { inset: 7px; border-right-color: var(--violet); animation: spin 1.1s linear infinite reverse; }
.busy-ring i:nth-child(3) { inset: 14px; border-bottom-color: var(--pink); animation: spin .6s linear infinite; }
.busy-body { flex: 1; min-width: 0; }
.busy-title { font-size: 20px; font-weight: 900; color: #fff; }
.busy-title::after { content: ''; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
.busy-sub { font-size: 14px; color: #bcd; margin-top: 2px; }
.busy-track { height: 6px; border-radius: 99px; background: rgba(255,255,255,.1); margin-top: 10px; overflow: hidden; }
.busy-track span { display: block; height: 100%; width: 40%; border-radius: 99px; background: linear-gradient(90deg, var(--cyan), var(--pink)); animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
body.is-busy main button, body.is-busy main label.btn, body.is-busy .tabbar, body.is-busy main input, body.is-busy main select, body.is-busy main textarea { pointer-events: none; }
body.is-busy main .btn, body.is-busy .tabbar { opacity: .45; filter: grayscale(.4); }

/* ---------- 提示訊息 ---------- */
.notices { margin: 0 16px; display: flex; flex-direction: column; gap: 10px; }
.notices:not(:empty) { margin-top: 12px; }
.notice {
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 14px 14px 16px;
  border-radius: var(--r); background: #111a2d; border: 1px solid var(--line);
  font-size: 16px; line-height: 1.45; animation: noticeIn .28s ease both;
}
.notice.out { animation: noticeOut .25s ease both; }
.notice svg { width: 24px; height: 24px; margin-top: 1px; }
.notice .n-text { flex: 1; }
.notice .n-close { background: none; border: 0; color: var(--muted); padding: 0; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; }
.notice.info { border-color: rgba(0,229,255,.45); } .notice.info svg { color: var(--cyan); }
.notice.success { border-color: rgba(34,245,154,.5); background: #0d2226; } .notice.success svg { color: var(--green); }
.notice.warn { border-color: rgba(255,176,32,.55); background: #231d16; } .notice.warn svg { color: var(--amber); }
.notice.error { border-color: rgba(255,77,109,.6); background: #26141e; } .notice.error svg { color: var(--red); }
@keyframes noticeIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes noticeOut { to { opacity: 0; transform: translateY(-6px); } }

/* ---------- 頁面切換（漸顯漸隱） ---------- */
main { padding: 16px; max-width: 760px; margin: 0 auto; }
.view { display: none; opacity: 0; transform: translateY(10px); transition: opacity .24s ease, transform .24s ease; }
.view.shown { display: block; }
.view.in { opacity: 1; transform: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- 按鈕 ---------- */
.btn {
  --bgc: var(--panel);
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%; border: 0; border-radius: var(--r); background: var(--bgc);
  color: var(--text); font-weight: 700; letter-spacing: .02em; text-decoration: none;
  transition: transform .12s ease, filter .2s, opacity .2s;
  user-select: none; -webkit-user-select: none;
}
.btn:active { transform: scale(.975); }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn-xl { min-height: 76px; font-size: 22px; margin: 14px 0; }
.btn-xl svg { width: 32px; height: 32px; }
.btn-lg { min-height: 64px; font-size: 20px; margin: 12px 0; }
.btn-md { min-height: 56px; font-size: 18px; margin: 10px 0; }
.btn-sm { min-height: 42px; font-size: 15px; width: auto; padding: 0 16px; border-radius: 14px; }
.btn-primary { --bgc: linear-gradient(135deg, #0b2a4a, #1b1450 60%, #3a0d4a); box-shadow: 0 8px 30px rgba(0,229,255,.12); }
.btn-primary svg { color: var(--cyan); filter: drop-shadow(0 0 6px var(--cyan)); }
.btn-accent { --bgc: linear-gradient(135deg, #07372a, #0b2a3a); }
.btn-accent svg { color: var(--green); }
.btn-line { --bgc: linear-gradient(135deg, #04361c, #08361f); }
.btn-line svg { color: var(--line-green); filter: drop-shadow(0 0 6px var(--line-green)); }
.btn-ghost { --bgc: rgba(255,255,255,.03); border: 1px solid var(--line); }
.btn-ghost.rgb { border: 0; }
.btn-danger { --bgc: rgba(255,77,109,.16); border: 1px solid rgba(255,77,109,.6); color: #ffd5dd; }
.btn-tile { flex-direction: column; min-height: 118px; font-size: 18px; gap: 10px; }
.btn-tile svg { width: 34px; height: 34px; color: var(--cyan); }
.btn-tile:nth-child(2) svg { color: var(--violet); }
.btn-tile:nth-child(3) svg { color: var(--pink); }
.btn-tile:nth-child(4) svg { color: var(--green); }
.btn-tile:nth-child(5) svg { color: var(--amber); }
.btn-tile:nth-child(6) svg { color: #9fb4da; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row2 .btn { margin: 0; }

/* ---------- 首頁 ---------- */
.hero {
  display: flex; align-items: center; gap: 16px; padding: 20px;
  border-radius: var(--r-lg); background: linear-gradient(135deg, rgba(13,20,36,.95), rgba(26,16,54,.9));
}
.hero-logo { width: 72px; height: 72px; border-radius: 20px; background: #070b16; display: grid; place-items: center; border: 1px solid var(--line); flex: none; }
.hero-logo canvas { width: 48px; height: 48px; image-rendering: pixelated; border-radius: 0; }
.hero-en { font-family: Orbitron, sans-serif; font-weight: 900; font-size: 30px; letter-spacing: .12em; line-height: 1.1;
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--pink), var(--cyan)); background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: slide 6s linear infinite; }
.hero-zh { margin: 2px 0 0; font-size: 24px; font-weight: 900; }
.hero-sub { color: var(--muted); font-size: 15px; margin-top: 2px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0 4px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 8px; text-align: center; }
.stat-num { font-family: Orbitron, sans-serif; font-size: 28px; font-weight: 700; color: var(--cyan); text-shadow: 0 0 12px rgba(0,229,255,.45); }
.stat:nth-child(2) .stat-num { color: var(--violet); text-shadow: 0 0 12px rgba(139,92,246,.5); }
.stat:nth-child(3) .stat-num { color: var(--pink); text-shadow: 0 0 12px rgba(255,43,214,.45); }
.stat-lbl { font-size: 14px; color: var(--muted); }
.sec-title { font-size: 19px; font-weight: 900; margin: 26px 2px 12px; display: flex; align-items: center; gap: 10px; }
.sec-title::before { content: ''; width: 6px; height: 20px; border-radius: 4px; background: linear-gradient(var(--cyan), var(--pink)); }

/* ---------- 名單卡片 ---------- */
.plist { display: flex; flex-direction: column; gap: 10px; }
.person {
  content-visibility: auto; contain-intrinsic-size: auto 90px;
  display: flex; gap: 14px; align-items: center; width: 100%; text-align: left;
  padding: 12px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line);
  transition: border-color .2s, transform .12s;
}
.person:active { transform: scale(.985); border-color: rgba(0,229,255,.6); }
.thumb { width: 104px; height: 64px; border-radius: 12px; overflow: hidden; flex: none; background: #0a1020; display: grid; place-items: center;
  border: 1px solid var(--line); font-family: Orbitron, sans-serif; font-size: 24px; color: var(--dim); }
.thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.pinfo { flex: 1; min-width: 0; }
.pname { font-size: 20px; font-weight: 900; line-height: 1.25; }
.ptitle { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 6px; }
.pcomp { font-size: 16px; color: #c6d4ee; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.psnip { font-size: 14px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { font-size: 13px; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.06); border: 1px solid var(--line); color: #c7d5ef; }
.chip.ind { border-color: color-mix(in srgb, var(--c) 70%, transparent); color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
mark { background: rgba(255,43,214,.3); color: #fff; border-radius: 4px; padding: 0 2px; }
.empty { text-align: center; color: var(--muted); padding: 36px 16px; border: 1px dashed var(--line); border-radius: var(--r); }
.empty b { display: block; color: var(--text); font-size: 20px; margin-bottom: 6px; }

/* ---------- 名單頁 ---------- */
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.list-title { font-size: 24px; font-weight: 900; }
.list-sub { color: var(--muted); font-size: 15px; }
.seg { display: flex; gap: 6px; padding: 5px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); margin-bottom: 14px; }
.seg button { flex: 1; min-height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-weight: 700; font-size: 16px; }
.seg button.on { background: linear-gradient(135deg, rgba(0,229,255,.2), rgba(139,92,246,.25)); color: #fff; box-shadow: inset 0 0 0 1px rgba(0,229,255,.45); }
.seg-big button { min-height: 54px; font-size: 18px; }

/* ---------- 分類 ---------- */
.catlist { display: flex; flex-direction: column; gap: 10px; }
.cat {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 70px; padding: 12px 16px;
  border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); text-align: left; position: relative; overflow: hidden;
}
.cat:active { transform: scale(.985); }
.cat .bar { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, color-mix(in srgb, var(--c) 22%, transparent), transparent); border-radius: inherit; z-index: 0; }
.cat .dot { width: 14px; height: 14px; border-radius: 5px; background: var(--c); box-shadow: 0 0 10px var(--c); z-index: 1; flex: none; }
.cat .cname { flex: 1; font-size: 19px; font-weight: 700; z-index: 1; }
.cat .ccount { font-family: Orbitron, sans-serif; font-size: 22px; font-weight: 700; z-index: 1; color: var(--c); }
.cat.zero { opacity: .45; }

/* ---------- 搜尋 ---------- */
.search-box { display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 16px; border-radius: var(--r); background: var(--panel); }
.search-box > svg { color: var(--cyan); }
.search-box input { flex: 1; min-width: 0; height: 56px; border: 0; background: transparent; outline: none; font-size: 20px; }
.search-box .icon-btn { width: 44px; height: 44px; }
.search-tip { color: var(--muted); font-size: 14px; margin: 10px 4px 14px; }

/* ---------- 掃描 ---------- */
.steps { display: flex; align-items: center; gap: 8px; margin: 2px 0 14px; }
.step { display: flex; align-items: center; gap: 8px; color: var(--dim); font-weight: 700; font-size: 16px; white-space: nowrap; }
.step b { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: var(--panel); border: 1px solid var(--line); font-family: Orbitron, sans-serif; font-size: 14px; }
.step.on { color: #fff; } .step.on b { border-color: var(--cyan); color: var(--cyan); box-shadow: 0 0 12px rgba(0,229,255,.4); }
.step.done { color: var(--green); } .step.done b { border-color: var(--green); color: var(--green); }
.step-line { flex: 1; height: 2px; border-radius: 2px; background: var(--line); }
.intro-card { padding: 18px; border-radius: var(--r-lg); background: var(--panel); }
.intro-title { font-size: 20px; font-weight: 900; margin-bottom: 8px; }
.tips { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.tips li { display: flex; gap: 12px; align-items: flex-start; font-size: 17px; color: #cbd7ee; }
.tips svg { color: var(--cyan); margin-top: 1px; }
.tips b { color: #fff; }
.tips li > span { flex: 1; }

.stage { position: relative; width: 100%; aspect-ratio: 3 / 4; max-height: 62vh; border-radius: var(--r-lg); overflow: hidden; background: #000; border: 1px solid var(--line); }
.stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.guide { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); border-radius: 18px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .5); transition: width .3s, height .3s, box-shadow .3s; }
.guide i { position: absolute; width: 34px; height: 34px; border: 4px solid var(--amber); transition: border-color .25s; }
.guide .c1 { left: -3px; top: -3px; border-right: 0; border-bottom: 0; border-radius: 18px 0 0 0; }
.guide .c2 { right: -3px; top: -3px; border-left: 0; border-bottom: 0; border-radius: 0 18px 0 0; }
.guide .c3 { left: -3px; bottom: -3px; border-right: 0; border-top: 0; border-radius: 0 0 0 18px; }
.guide .c4 { right: -3px; bottom: -3px; border-left: 0; border-top: 0; border-radius: 0 0 18px 0; }
.guide.good i { border-color: var(--green); filter: drop-shadow(0 0 6px var(--green)); }
.guide .laser { position: absolute; left: 8px; right: 8px; height: 2px; top: 0; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent); box-shadow: 0 0 12px var(--cyan); animation: laser 2.2s ease-in-out infinite; }
@keyframes laser { 0%, 100% { top: 6%; } 50% { top: 94%; } }
.stage-top { position: absolute; left: 12px; right: 12px; top: 12px; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.side-label { background: rgba(5,7,13,.72); border: 1px solid rgba(0,229,255,.5); color: #fff; font-weight: 900; font-size: 17px; padding: 8px 14px; border-radius: 14px; backdrop-filter: blur(6px); }
.level { position: relative; width: 58px; height: 58px; border-radius: 50%; background: rgba(5,7,13,.6); border: 2px solid rgba(255,255,255,.35); flex: none; }
.level i { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px; border-radius: 50%; border: 2px dashed rgba(255,255,255,.55); }
.level b { position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px var(--amber); transition: transform .1s linear, background .2s; }
.level.good { border-color: var(--green); } .level.good b { background: var(--green); box-shadow: 0 0 10px var(--green); }
.level.na { opacity: .35; }
.hints { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.hint { display: inline-flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; padding: 7px 12px; border-radius: 12px;
  background: rgba(10, 8, 0, .75); color: #ffd98a; border: 1px solid rgba(255,176,32,.6); backdrop-filter: blur(6px); animation: fadeIn .2s; }
.hint svg { width: 18px; height: 18px; }
.hint.ok { color: #b9ffe0; border-color: rgba(34,245,154,.7); background: rgba(0, 20, 12, .75); }
.auto-ring { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); width: 74px; height: 74px; }
.auto-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.auto-ring circle { fill: none; stroke-width: 3.5; stroke: rgba(255,255,255,.2); }
.auto-ring #autoRingArc { stroke: var(--green); stroke-linecap: round; stroke-dasharray: 94.25; stroke-dashoffset: 94.25; filter: drop-shadow(0 0 4px var(--green)); }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; border-radius: 0; }
.flash.go { animation: flash .35s ease-out; }
@keyframes flash { 0% { opacity: .85; } 100% { opacity: 0; } }
.meters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.meter { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-size: 15px; font-weight: 700; color: var(--muted); }
.meter i { width: 11px; height: 11px; border-radius: 50%; background: var(--dim); }
.meter.good { color: #cfffe9; border-color: rgba(34,245,154,.45); } .meter.good i { background: var(--green); box-shadow: 0 0 8px var(--green); }
.meter.bad { color: #ffe1a6; border-color: rgba(255,176,32,.5); } .meter.bad i { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.shots[hidden] { display: none; }
.shots { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.shot { position: relative; aspect-ratio: 1.66; border-radius: 14px; border: 1.5px dashed var(--line); display: grid; place-items: center; color: var(--dim); font-weight: 700; overflow: hidden; background-size: cover; background-position: center; }
.shot.has { border: 1.5px solid var(--green); color: #fff; }
.shot.has span { position: absolute; left: 8px; bottom: 8px; background: rgba(0,0,0,.65); padding: 2px 10px; border-radius: 8px; font-size: 14px; }
.shot.has span::before { content: '✓ '; color: var(--green); }
.scan-ctrl { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 14px; margin: 16px 0 4px; }
.btn-round { flex-direction: column; gap: 2px; min-height: 68px; border-radius: 20px; font-size: 14px; --bgc: var(--panel); border: 1px solid var(--line); }
.btn-round.on { border-color: var(--amber); color: var(--amber); }
.btn-round.no-torch { visibility: hidden; }
.shutter { width: 92px; height: 92px; border-radius: 50%; border: 0; background: #0b1426; display: grid; place-items: center; --d: -1s; }
.shutter span { width: 70px; height: 70px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #bfefff 40%, #58d6ff); box-shadow: 0 0 22px rgba(0,229,255,.6); transition: transform .12s; }
.shutter:active span { transform: scale(.88); }
.shutter.wait span { background: radial-gradient(circle at 35% 30%, #666, #333); box-shadow: none; }

/* ---------- 辨識中 ---------- */
.proc { padding: 26px 20px; border-radius: var(--r-lg); background: var(--panel); text-align: center; margin-top: 8px; }
.proc-card { position: relative; width: 230px; height: 138px; margin: 8px auto 22px; border-radius: 16px; border: 2px solid rgba(0,229,255,.55);
  background: linear-gradient(135deg, #0c1a33, #1a0f33); overflow: hidden; box-shadow: 0 0 30px rgba(0,229,255,.2); }
.proc-card::before { content: ''; position: absolute; left: 18px; top: 24px; width: 90px; height: 12px; border-radius: 6px; background: rgba(255,255,255,.35);
  box-shadow: 0 22px 0 -2px rgba(255,255,255,.2), 0 44px 0 -2px rgba(255,255,255,.2), 110px 70px 0 -2px rgba(255,255,255,.15); }
.proc-scan { position: absolute; left: 0; right: 0; height: 3px; background: var(--cyan); box-shadow: 0 0 18px 4px rgba(0,229,255,.6); animation: laser 1.6s ease-in-out infinite; border-radius: 3px; }
.proc-pixels { position: absolute; inset: 0; }
.proc-pixels i { position: absolute; width: 6px; height: 6px; border-radius: 1px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .1; } }
.proc-title { font-size: 24px; font-weight: 900; }
.proc-title::after { content: ''; animation: dots 1.2s steps(4) infinite; }
.proc-sub { color: var(--muted); font-size: 15px; margin-top: 4px; }
.proc-steps { list-style: none; padding: 0; margin: 22px 0 0; text-align: left; display: flex; flex-direction: column; gap: 10px; }
.proc-steps li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px solid var(--line); color: var(--dim); font-weight: 700; }
.proc-steps li::before { content: ''; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--dim); flex: none; }
.proc-steps li.active { color: #fff; border-color: rgba(0,229,255,.5); }
.proc-steps li.active::before { border-color: rgba(0,229,255,.25); border-top-color: var(--cyan); animation: spin .7s linear infinite; }
.proc-steps li.done { color: var(--green); }
.proc-steps li.done::before { border-color: var(--green); background: var(--green); box-shadow: inset 0 0 0 4px var(--panel); }

/* ---------- 結果 / 詳細 ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.panel + .panel { margin-top: 12px; }
.res-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.res-icon { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; flex: none; }
.res-icon svg { width: 34px; height: 34px; }
.res-icon.ok { background: rgba(34,245,154,.14); color: var(--green); box-shadow: 0 0 20px rgba(34,245,154,.3); }
.res-icon.bad { background: rgba(255,176,32,.14); color: var(--amber); box-shadow: 0 0 20px rgba(255,176,32,.3); }
.res-icon.err { background: rgba(255,77,109,.14); color: var(--red); }
.res-title { font-size: 24px; font-weight: 900; line-height: 1.25; }
.res-sub { color: var(--muted); font-size: 15px; }
.issues { margin: 6px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.issues li { padding: 10px 14px; border-radius: 12px; background: rgba(255,176,32,.08); border: 1px solid rgba(255,176,32,.35); color: #ffe1a6; font-weight: 500; }
.imgs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.imgs.one { grid-template-columns: 1fr; }
.imgs button { padding: 0; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #000; aspect-ratio: 1.66; }
.imgs img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; display: block; }
.d-name { font-size: 30px; font-weight: 900; line-height: 1.2; margin-top: 14px; }
.d-sub { color: #c6d4ee; font-size: 18px; margin-top: 4px; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0 4px; }
.quick a, .quick button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 76px; border-radius: 16px;
  background: var(--panel2); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 14px; font-weight: 700; padding: 6px; }
.quick svg { color: var(--cyan); }
.quick .off { opacity: .3; pointer-events: none; }
.kv { display: flex; flex-direction: column; }
.kv-row { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--line); }
.kv-row:last-child { border-bottom: 0; }
.kv-k { color: var(--muted); font-size: 15px; padding-top: 2px; }
.kv-v { font-size: 18px; word-break: break-word; white-space: pre-wrap; }
.kv-v a { color: var(--cyan); text-decoration: none; }
.group-title { font-size: 15px; font-weight: 900; color: var(--cyan); letter-spacing: .08em; margin: 4px 2px 2px; }
details.raw summary { cursor: pointer; font-weight: 700; color: var(--muted); padding: 6px 2px; list-style: none; }
details.raw summary::before { content: '▸ '; }
details.raw[open] summary::before { content: '▾ '; }
details.raw pre { white-space: pre-wrap; font-family: inherit; font-size: 15px; color: #c6d4ee; background: rgba(0,0,0,.25); padding: 12px; border-radius: 12px; margin: 6px 0 0; }
.confirm-inline { margin: 12px 0; padding: 16px; border-radius: var(--r); border: 1.5px solid rgba(255,77,109,.6); background: rgba(255,77,109,.08); animation: noticeIn .25s ease; }
.confirm-inline p { margin: 0 0 12px; }
.dup { margin-top: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(255,176,32,.5); background: rgba(255,176,32,.08); font-size: 15px; }
.dup a { color: var(--amber); font-weight: 700; }
.bigimg img { width: 100%; height: auto; border-radius: var(--r); border: 1px solid var(--line); background: #000; }

/* ---------- 表單 ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 15px; color: var(--muted); font-weight: 700; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 56px; padding: 12px 16px; border-radius: 14px;
  background: var(--panel); border: 1.5px solid var(--line); outline: none; font-size: 18px;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(0,229,255,.15); }
.field select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.pwd { display: flex; gap: 8px; } .pwd input { flex: 1; } .pwd .icon-btn { height: 56px; width: 56px; }
.toggles { display: flex; flex-direction: column; gap: 10px; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding: 0 16px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); font-weight: 700; }
.toggle input { display: none; }
.toggle i { position: relative; width: 58px; height: 34px; border-radius: 99px; background: #26324a; transition: background .2s; flex: none; }
.toggle i::after { content: ''; position: absolute; left: 4px; top: 4px; width: 26px; height: 26px; border-radius: 50%; background: #9fb0d0; transition: transform .2s, background .2s; }
.toggle input:checked + i { background: linear-gradient(90deg, #0a6a7a, #5b3bbd); }
.toggle input:checked + i::after { transform: translateX(24px); background: #fff; box-shadow: 0 0 10px var(--cyan); }
.info-box { padding: 14px 16px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); color: #c6d4ee; font-size: 16px; }
.welcome { padding: 18px; border-radius: var(--r-lg); background: linear-gradient(135deg, rgba(0,229,255,.1), rgba(139,92,246,.14)); margin-bottom: 18px; }
.welcome-title { font-size: 24px; font-weight: 900; }
.welcome p { margin: 6px 0 0; color: #c6d4ee; }
.ver { text-align: center; color: var(--dim); font-size: 13px; margin: 24px 0 8px; font-family: Orbitron, sans-serif; letter-spacing: .05em; }

/* ---------- 匯出 ---------- */
.radio-cards { display: flex; flex-direction: column; gap: 10px; }
.rcard { display: flex; align-items: center; gap: 14px; min-height: 66px; padding: 12px 16px; border-radius: var(--r); background: var(--panel); border: 1.5px solid var(--line); text-align: left; width: 100%; }
.rcard .rdot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--dim); flex: none; display: grid; place-items: center; }
.rcard.on { border-color: var(--cyan); background: linear-gradient(135deg, rgba(0,229,255,.1), rgba(139,92,246,.12)); }
.rcard.on .rdot { border-color: var(--cyan); } .rcard.on .rdot::after { content: ''; width: 12px; height: 12px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.rcard .rtxt { flex: 1; font-size: 18px; font-weight: 700; }
.rcard .rnum { font-family: Orbitron, sans-serif; color: var(--muted); font-size: 16px; }
.chips-pick { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; padding: 14px; border-radius: var(--r); background: rgba(255,255,255,.02); border: 1px dashed var(--line); }
.chips-pick button { min-height: 46px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--panel); font-size: 16px; font-weight: 700; color: #c6d4ee; }
.chips-pick button.on { border-color: var(--c, var(--cyan)); color: #fff; background: color-mix(in srgb, var(--c, var(--cyan)) 22%, var(--panel)); }
.chips-pick button small { color: var(--muted); margin-left: 4px; font-weight: 500; }
.exp-count { margin: 16px 0 0; padding: 16px; border-radius: var(--r); background: var(--panel); text-align: center; font-size: 18px; }
.exp-count b { font-family: Orbitron, sans-serif; font-size: 30px; color: var(--cyan); margin: 0 6px; }
.linkbox { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.linkbox input { flex: 1; min-width: 0; height: 50px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); font-size: 14px; }

/* ---------- 底部導覽 ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  padding: 8px 8px calc(8px + var(--safe-b)); height: calc(var(--tab-h) + var(--safe-b));
  background: rgba(7, 10, 18, .9); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line); border-radius: 22px 22px 0 0;
  transition: transform .25s ease;
}
.tabbar.hide { transform: translateY(110%); }
.tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 58px; border: 0; background: none; color: var(--dim); font-size: 13px; font-weight: 700; border-radius: 16px; }
.tabbar button.on { color: #fff; }
.tabbar button.on svg { color: var(--cyan); filter: drop-shadow(0 0 6px var(--cyan)); }
.tabbar .tab-scan { height: 72px; width: 72px; margin: -22px auto 0; border-radius: 24px; background: linear-gradient(135deg, #0b2a4a, #2a1057); color: #fff; box-shadow: 0 8px 24px rgba(0,229,255,.25); }
.tabbar .tab-scan svg { width: 30px; height: 30px; color: var(--cyan); }

@media (min-width: 700px) {
  .grid2 { grid-template-columns: repeat(3, 1fr); }
  .stage { max-height: 70vh; }
}
@media (prefers-reduced-motion: reduce) {
  .rgb::before, .rgb::after { animation-duration: 12s; }
}
input[type=search]::-webkit-search-cancel-button, input[type=search]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
.imgs button { color: var(--muted); font-size: 14px; }
.bigimg { color: var(--muted); text-align: center; padding: 8px 0; }

/* ---------- 名單：單筆刪除 / 批次刪除 ---------- */
.list-tools { display: flex; justify-content: flex-end; margin: -4px 0 12px; }
.list-tools .btn svg { width: 20px; height: 20px; color: #ff8da1; }
.pwrap { position: relative; }
.pwrap .person { padding-right: 64px; }
.pdel { position: absolute; right: 10px; top: 12px; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  background: rgba(255,77,109,.1); border: 1px solid rgba(255,77,109,.45); color: #ff8da1; padding: 0; }
.pdel svg { width: 22px; height: 22px; }
.pdel:active { transform: scale(.92); }
.pconfirm { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 2px; padding: 12px 14px; border-radius: 14px;
  border: 1.5px solid rgba(255,77,109,.6); background: #26141e; animation: noticeIn .2s ease; font-size: 15px; }
.pconfirm span { flex: 1 1 100%; }
.pconfirm .btn { margin: 0; flex: 1; min-height: 46px; }
.pcheck { display: none; position: absolute; left: 10px; top: 50%; transform: translateY(-50%); z-index: 3; width: 30px; height: 30px; border-radius: 10px;
  border: 2px solid var(--muted); background: var(--bg2); place-items: center; pointer-events: none; }
.pcheck svg { width: 20px; height: 20px; color: #001318; opacity: 0; }
.selmode .pcheck { display: grid; }
.selmode .pwrap .person { padding-left: 52px; padding-right: 12px; }
.selmode .pdel, .selmode .pconfirm { display: none !important; }
.pwrap.sel .person { border-color: var(--cyan); background: linear-gradient(135deg, rgba(0,229,255,.1), rgba(139,92,246,.1)); }
.pwrap.sel .pcheck { background: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 10px rgba(0,229,255,.6); }
.pwrap.sel .pcheck svg { opacity: 1; }
.batchbar { position: fixed; left: 0; right: 0; bottom: calc(var(--tab-h) + var(--safe-b) + 6px); z-index: 55; padding: 0 12px; max-width: 760px; margin: 0 auto; }
.batch-row { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 18px; background: #101a2e; border: 1.5px solid rgba(0,229,255,.45); box-shadow: 0 10px 30px rgba(0,0,0,.6); }
.batch-row .btn { margin: 0; min-height: 48px; }
.batch-row .btn svg { width: 20px; height: 20px; }
.sel-count { flex: 1; text-align: center; font-weight: 900; color: var(--cyan); font-size: 16px; }
.batchbar .confirm-inline { background: #26141e; margin: 0 0 8px; box-shadow: 0 10px 30px rgba(0,0,0,.6); }
body.has-batch { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 110px); }
