:root {
  --bg: #f4f8fd; --surface: #ffffff; --glass: rgba(255,255,255,.72); --text: #0f1b2d; --muted: #5b6b80;
  --line: #e2eaf3; --accent: #2f7bf6; --accent-soft: #e6f0ff; --accent-text: #ffffff;
  --win: #d97706; --win-soft: #fff4dc; --danger: #d92d20; --ok: #16a34a; --warn-soft: #fff7e0;
  --radius: 16px; --shadow: 0 2px 12px rgba(30,60,110,.08);
  --tab-h: 64px; --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220; --surface: #121c2e; --glass: rgba(18,28,46,.72); --text: #e8eef8; --muted: #93a4bb; --line: #223049;
    --accent: #5b9bff; --accent-soft: #15284a; --accent-text: #08111f; --win-soft: #3a2a0a; --warn-soft: #3a2f0e; --shadow: none;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1220; --surface: #121c2e; --glass: rgba(18,28,46,.72); --text: #e8eef8; --muted: #93a4bb; --line: #223049;
  --accent: #5b9bff; --accent-soft: #15284a; --accent-text: #08111f; --win-soft: #3a2a0a; --warn-soft: #3a2f0e; --shadow: none;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); -webkit-text-size-adjust: 100%; }
body { min-height: 100dvh; padding-top: var(--safe-t); }
main { max-width: 720px; margin: 0 auto; padding: 12px 16px calc(var(--tab-h) + var(--safe-b) + 28px); outline: none; display: flex; flex-direction: column; gap: 12px; }
body.immersive main { max-width: none; padding: 0; }
body.immersive .tabbar { display: none; }
h1, h2, h3 { margin: 0; line-height: 1.3; } h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 16px; }
p { margin: 0; line-height: 1.6; } a { color: var(--accent); text-decoration: none; }
.muted { color: var(--muted); } .small { font-size: 13px; } .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .04em; }
.link { color: var(--accent); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.page-header { display: flex; align-items: center; gap: 8px; padding: 6px 0; position: sticky; top: 0; z-index: 5; background: var(--bg); }
.page-header h1 { flex: 1; } .page-actions { display: flex; gap: 6px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; color: var(--text); background: var(--surface); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-secondary { background: var(--accent-soft); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.btn-light { background: #fff; color: #1d4ed8; } .btn-sm { min-height: 34px; padding: 0 12px; font-size: 14px; } .btn-lg { min-height: 52px; font-size: 17px; width: 100%; } .btn-block { width: 100%; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center; border: 0; background: var(--glass); color: var(--text); cursor: pointer; position: relative; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.icon-btn.light { background: rgba(255,255,255,.18); color: #fff; }
.dot { position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; display: grid; place-items: center; padding: 0 4px; }

.input { width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; font-size: 16px; }
.input.invalid { border-color: var(--danger); } .input.num { min-height: 40px; }
.field { display: flex; flex-direction: column; gap: 6px; } .field label { font-size: 14px; font-weight: 600; }
.field-error { color: var(--danger); font-size: 13px; min-height: 0; }
.pending-tag { font-size: 12px; font-weight: 600; color: var(--win); background: var(--win-soft); padding: 1px 8px; border-radius: 8px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form { display: flex; flex-direction: column; gap: 12px; } .form-card h2 { margin-bottom: 2px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; } .form-actions .btn { flex: 1; }
.check { display: flex; gap: 10px; align-items: flex-start; line-height: 1.5; } .check input { width: 22px; height: 22px; margin-top: 2px; flex: none; }
.item-edit { display: flex; flex-direction: column; gap: 6px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.item-nums { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 6px; align-items: center; }

.home-header { display: flex; justify-content: space-between; align-items: center; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.brand img { border-radius: 8px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.stat-label { font-size: 13px; color: var(--muted); } .stat-value { font-size: 22px; font-weight: 800; margin-top: 4px; } .stat-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat-win .stat-value { color: var(--win); }
.scan-cta { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 0; }
.scan-fab { width: 96px; height: 96px; border-radius: 50%; background: linear-gradient(145deg, #5aa2ff, #2f7bf6); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 28px rgba(47,123,246,.45), inset 0 1px 0 rgba(255,255,255,.4); }
.scan-fab:active { transform: scale(.96); }
.scan-cta p { font-weight: 700; }

.list { display: flex; flex-direction: column; } .list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); color: inherit; } .list-row:last-child { border-bottom: 0; }
.row-icon { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.row-main { flex: 1; min-width: 0; } .row-title { font-weight: 700; } .row-sub { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-end { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; } .row-amount { font-weight: 700; }
.win-row { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--win-soft); color: var(--text); } .win-row svg { color: var(--win); flex: none; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 10px; white-space: nowrap; }
.badge-win { background: var(--win); color: #fff; } .badge-muted { background: var(--line); color: var(--muted); } .badge-info { background: var(--accent-soft); color: var(--accent); } .badge-warn { background: var(--win-soft); color: var(--win); }

.search-bar { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding-left: 12px; color: var(--muted); } .search-bar .input { border: 0; background: transparent; }
.filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; } .chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 36px; padding: 0 14px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; } .chip.active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--accent-soft); color: var(--text); font-size: 14px; line-height: 1.5; } .notice svg { flex: none; margin-top: 2px; color: var(--accent); } .notice-warn { background: var(--warn-soft); } .notice-warn svg { color: var(--win); } .notice-link { margin-left: auto; font-weight: 600; white-space: nowrap; }

.detail-head { align-items: center; text-align: center; } .big-no { font-size: 28px; font-weight: 800; } .big-amt { font-size: 22px; font-weight: 700; color: var(--accent); }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; border-bottom: 1px solid var(--line); } .kv:last-child { border: 0; } .k { color: var(--muted); font-size: 14px; flex: none; } .v { text-align: right; word-break: break-word; }
.prize { text-align: center; padding: 10px; border-radius: 12px; background: var(--win-soft); } .prize-name { font-size: 22px; font-weight: 800; color: var(--win); } .prize-amt { font-size: 18px; font-weight: 700; }
.items { display: flex; flex-direction: column; } .item { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); color: inherit; } .item:last-child { border: 0; } .item-name { font-weight: 600; } .item-sub { grid-row: 1 / span 2; grid-column: 2; font-weight: 700; align-self: center; }
.num-row { display: flex; flex-direction: column; gap: 6px; padding: 6px 0; } .num-label { font-weight: 700; } .nums { display: flex; flex-wrap: wrap; gap: 8px; } .num { font-size: 20px; font-weight: 700; background: var(--accent-soft); padding: 4px 10px; border-radius: 10px; }
.notif.unread { border-color: var(--win); } .notif-head { display: flex; align-items: center; gap: 8px; } .notif-head svg { color: var(--win); }
.prose ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; line-height: 1.6; } .list-link { padding: 12px 0; border-bottom: 1px solid var(--line); color: var(--text); display: block; }
.chart-box { position: relative; height: 220px; }
.log { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; } .log-error { color: var(--danger); } .log-warn { color: var(--win); }

.state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 36px 16px; color: var(--muted); } .state h3 { color: var(--text); }
.spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; } .spinner.lg { width: 56px; height: 56px; border-width: 5px; } @keyframes spin { to { transform: rotate(360deg); } }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: var(--glass); backdrop-filter: blur(20px) saturate(1.4); -webkit-backdrop-filter: blur(20px) saturate(1.4); border-top: 1px solid var(--line); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 11px; position: relative; } .tabbar a.active { color: var(--accent); font-weight: 700; }
.tab-badge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 16px; height: 16px; border-radius: 8px; background: var(--danger); color: #fff; font-size: 10px; display: grid; place-items: center; padding: 0 4px; font-style: normal; }
@media (min-width: 900px) { .tabbar { max-width: 520px; left: 50%; right: auto; transform: translateX(-50%); width: 100%; border-radius: 20px 20px 0 0; border: 1px solid var(--line); } }

.bar { position: sticky; top: 0; z-index: 40; padding: 8px 16px; text-align: center; font-size: 14px; color: #fff; } .bar-offline { background: #475569; } .bar-update { background: var(--accent); color: var(--accent-text); }
#toast-root { position: fixed; left: 0; right: 0; bottom: calc(var(--tab-h) + var(--safe-b) + 12px); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 60; pointer-events: none; padding: 0 16px; }
.toast { display: flex; gap: 8px; align-items: center; padding: 10px 14px; border-radius: 14px; background: #1e293b; color: #fff; font-size: 14px; opacity: 0; transform: translateY(8px); transition: .25s; max-width: 480px; } .toast.show { opacity: 1; transform: none; } .toast-success { background: #15803d; } .toast-error { background: #b42318; }
.dialog { border: 0; border-radius: 20px; padding: 0; max-width: min(92vw, 400px); width: 100%; background: var(--surface); color: var(--text); } .dialog::backdrop { background: rgba(8,15,30,.5); backdrop-filter: blur(3px); } .dialog-body { display: flex; flex-direction: column; gap: 12px; padding: 20px; } .dialog-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* 掃描頁 */
.scan { position: fixed; inset: 0; background: #0a0f1a; color: #fff; display: flex; flex-direction: column; z-index: 30; }
.scan-close { position: absolute; top: calc(12px + var(--safe-t)); right: 12px; z-index: 3; background: rgba(255,255,255,.18); color: #fff; }
.scan-stage { flex: 1; position: relative; overflow: hidden; display: flex; }
.camera-wrap { position: relative; width: 100%; height: 100%; } .scan-video { width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: absolute; left: 50%; top: 50%; width: min(78vw, 360px); aspect-ratio: 3/4.2; max-height: 72%; transform: translate(-50%, -50%); box-shadow: 0 0 0 100vmax rgba(0,0,0,.55); border-radius: 14px; }
.corner { position: absolute; width: 28px; height: 28px; border: 4px solid #7db4ff; } .tl { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-top-left-radius: 14px; } .tr { top: -2px; right: -2px; border-left: 0; border-bottom: 0; border-top-right-radius: 14px; } .bl { bottom: -2px; left: -2px; border-right: 0; border-top: 0; border-bottom-left-radius: 14px; } .br { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-bottom-right-radius: 14px; }
.scan-hint { position: absolute; left: 0; right: 0; top: calc(64px + var(--safe-t)); text-align: center; font-weight: 600; text-shadow: 0 1px 6px rgba(0,0,0,.6); padding: 0 24px; }
.scan-panel { display: flex; justify-content: space-around; align-items: center; padding: 18px 24px calc(18px + var(--safe-b)); background: rgba(10,15,26,.85); min-height: 0; } .scan-panel:empty { display: none; }
.shutter { width: 74px; height: 74px; border-radius: 50%; border: 5px solid #fff; background: rgba(255,255,255,.25); cursor: pointer; } .shutter:active { background: #fff; } .shutter:disabled { opacity: .5; }
.scan-intro, .scan-processing { margin: auto; max-width: 420px; padding: 24px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; width: 100%; }
.scan-intro .btn-secondary { background: rgba(255,255,255,.14); color: #fff; } .scan-intro .link { color: #9cc4ff; } .scan-intro-icon { width: 84px; height: 84px; border-radius: 24px; display: grid; place-items: center; background: rgba(125,180,255,.18); color: #9cc4ff; } .scan-error { color: #ffb4a9; background: rgba(217,45,32,.18); padding: 10px 12px; border-radius: 12px; }
.scan-processing .muted { color: #9fb0c8; } .progress { width: 100%; height: 8px; border-radius: 4px; background: rgba(255,255,255,.15); overflow: hidden; } .progress-fill { height: 100%; width: 0; background: #7db4ff; transition: width .2s; }

@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ============================================================
   Liquid Glass 層（Apple 風格的適度參考）
   - 材質：半透明 + 背景模糊/飽和 + 內緣高光 + 柔和陰影
   - 只用在「浮在內容之上」的元件：導覽列、按鈕、提示、對話框、卡片
   - 文字永遠放在足夠不透明的底上，維持對比；
     尊重 prefers-reduced-transparency / prefers-contrast / 不支援 backdrop-filter 的瀏覽器
   ============================================================ */
:root {
  --lg-bg: rgba(255,255,255,.62);
  --lg-bg-strong: rgba(255,255,255,.78);
  --lg-border: rgba(255,255,255,.7);
  --lg-edge: rgba(15,40,90,.08);
  --lg-hi: inset 0 1px 0 rgba(255,255,255,.85), inset 0 -1px 0 rgba(255,255,255,.25);
  --lg-shadow: 0 8px 28px rgba(30,70,140,.14), 0 1px 3px rgba(30,70,140,.08);
  --lg-blur: blur(22px) saturate(1.8);
  --bg-aura: radial-gradient(60% 40% at 15% 0%, rgba(110,175,255,.38), transparent 70%),
             radial-gradient(50% 35% at 100% 12%, rgba(150,210,255,.35), transparent 70%),
             radial-gradient(55% 40% at 50% 100%, rgba(170,200,255,.30), transparent 70%);
  --radius: 22px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --lg-bg: rgba(30,44,70,.55); --lg-bg-strong: rgba(26,38,62,.78); --lg-border: rgba(255,255,255,.14); --lg-edge: rgba(0,0,0,.35);
    --lg-hi: inset 0 1px 0 rgba(255,255,255,.14), inset 0 -1px 0 rgba(255,255,255,.04);
    --lg-shadow: 0 10px 30px rgba(0,0,0,.45), 0 1px 3px rgba(0,0,0,.4);
    --bg-aura: radial-gradient(60% 40% at 15% 0%, rgba(60,110,220,.35), transparent 70%),
               radial-gradient(50% 35% at 100% 12%, rgba(40,130,200,.25), transparent 70%),
               radial-gradient(55% 40% at 50% 100%, rgba(80,90,220,.22), transparent 70%);
  }
}
:root[data-theme="dark"] {
  --lg-bg: rgba(30,44,70,.55); --lg-bg-strong: rgba(26,38,62,.78); --lg-border: rgba(255,255,255,.14); --lg-edge: rgba(0,0,0,.35);
  --lg-hi: inset 0 1px 0 rgba(255,255,255,.14), inset 0 -1px 0 rgba(255,255,255,.04);
  --lg-shadow: 0 10px 30px rgba(0,0,0,.45), 0 1px 3px rgba(0,0,0,.4);
  --bg-aura: radial-gradient(60% 40% at 15% 0%, rgba(60,110,220,.35), transparent 70%),
             radial-gradient(50% 35% at 100% 12%, rgba(40,130,200,.25), transparent 70%),
             radial-gradient(55% 40% at 50% 100%, rgba(80,90,220,.22), transparent 70%);
}

/* 背景光暈：讓玻璃有東西可以折射 */
body { background: var(--bg-aura), var(--bg); background-attachment: fixed; }

/* 共用玻璃材質 */
.card, .stat, .notice, .tabbar, .icon-btn, .chip, .search-bar, .toast, .dialog, .bar, .win-row {
  -webkit-backdrop-filter: var(--lg-blur); backdrop-filter: var(--lg-blur);
}
.card, .stat, .search-bar {
  background: var(--lg-bg); border: 1px solid var(--lg-border);
  box-shadow: var(--lg-hi), var(--lg-shadow);
}
.card, .stat { border-radius: var(--radius); }
.notice { background: var(--lg-bg); border: 1px solid var(--lg-border); box-shadow: var(--lg-hi); border-radius: 18px; }
.notice-warn { background: color-mix(in srgb, var(--warn-soft) 80%, transparent); }
.win-row { background: color-mix(in srgb, var(--win-soft) 85%, transparent); border: 1px solid var(--lg-border); box-shadow: var(--lg-hi); border-radius: 16px; }

/* 懸浮膠囊導覽列 */
.tabbar {
  left: 12px; right: 12px; bottom: calc(10px + var(--safe-b)); height: var(--tab-h); padding-bottom: 0;
  border: 1px solid var(--lg-border); border-radius: 32px; background: var(--lg-bg-strong); box-shadow: var(--lg-hi), var(--lg-shadow);
}
.tabbar a { margin: 6px 3px; border-radius: 26px; transition: background .25s, color .25s; }
.tabbar a.active { background: color-mix(in srgb, var(--accent) 16%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent), var(--lg-hi); }
@media (min-width: 900px) { .tabbar { left: 50%; right: auto; width: 520px; transform: translateX(-50%); border-radius: 32px; } }
main { padding-bottom: calc(var(--tab-h) + var(--safe-b) + 40px); }
#toast-root { bottom: calc(var(--tab-h) + var(--safe-b) + 26px); }

/* 圓形/膠囊控制項 */
.icon-btn { background: var(--lg-bg-strong); border: 1px solid var(--lg-border); box-shadow: var(--lg-hi), 0 2px 10px rgba(30,70,140,.1); }
.icon-btn:active { transform: scale(.94); }
.chip { background: var(--lg-bg); border: 1px solid var(--lg-border); box-shadow: var(--lg-hi); border-radius: 999px; }
.chip.active { background: color-mix(in srgb, var(--accent) 88%, transparent); border-color: color-mix(in srgb, #fff 35%, transparent); color: var(--accent-text); box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 4px 14px color-mix(in srgb, var(--accent) 40%, transparent); }
.btn { border-radius: 999px; transition: transform .15s, box-shadow .2s; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn-primary { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 82%, #fff), var(--accent)); box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 6px 18px color-mix(in srgb, var(--accent) 38%, transparent); }
.btn-secondary { background: color-mix(in srgb, var(--accent) 14%, var(--lg-bg-strong)); box-shadow: var(--lg-hi); border-color: var(--lg-border); }
.btn-danger { box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 6px 18px color-mix(in srgb, var(--danger) 35%, transparent); }
.input { background: color-mix(in srgb, var(--surface) 55%, transparent); border: 1px solid var(--lg-edge); box-shadow: inset 0 1px 2px rgba(20,50,100,.06); border-radius: 14px; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.search-bar .input { box-shadow: none; border: 0; background: transparent; }
.search-bar { border-radius: 999px; padding-left: 16px; }

/* 掃描主按鈕：玻璃球 */
.scan-fab {
  background: radial-gradient(120% 120% at 30% 15%, rgba(255,255,255,.55), rgba(255,255,255,0) 45%), linear-gradient(150deg, #6fb0ff, #2f7bf6 70%);
  box-shadow: inset 0 2px 1px rgba(255,255,255,.65), inset 0 -6px 14px rgba(20,60,160,.35), 0 14px 34px rgba(47,123,246,.5);
  border: 1px solid rgba(255,255,255,.5);
}
.row-icon { background: color-mix(in srgb, var(--accent) 14%, transparent); box-shadow: var(--lg-hi); border-radius: 14px; }
.num { background: color-mix(in srgb, var(--accent) 12%, var(--lg-bg-strong)); box-shadow: var(--lg-hi); border: 1px solid var(--lg-border); }
.badge { box-shadow: var(--lg-hi); }

/* 提示、對話框 */
.toast { background: rgba(28,38,58,.78); border: 1px solid rgba(255,255,255,.18); box-shadow: var(--lg-hi), var(--lg-shadow); border-radius: 999px; padding: 10px 18px; }
.toast-success { background: rgba(21,128,61,.82); } .toast-error { background: rgba(180,35,24,.84); }
.dialog { background: var(--lg-bg-strong); border: 1px solid var(--lg-border); box-shadow: var(--lg-hi), 0 24px 70px rgba(10,30,70,.35); border-radius: 28px; }
.dialog::backdrop { background: rgba(10,25,55,.35); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.bar-offline { background: rgba(71,85,105,.88); } .bar-update { background: color-mix(in srgb, var(--accent) 90%, transparent); }
.page-header { background: transparent; }
.page-header::before { content: ""; position: absolute; inset: -12px -16px 0; z-index: -1; -webkit-backdrop-filter: blur(16px) saturate(1.6); backdrop-filter: blur(16px) saturate(1.6); background: linear-gradient(var(--bg), color-mix(in srgb, var(--bg) 0%, transparent)); -webkit-mask: linear-gradient(#000 70%, transparent); mask: linear-gradient(#000 70%, transparent); }

/* 掃描頁（深色相機畫面上的玻璃控制） */
.scan-close, .icon-btn.light { background: rgba(255,255,255,.2); border: 1px solid rgba(255,255,255,.3); color: #fff; }
.scan-panel { background: rgba(10,15,26,.45); -webkit-backdrop-filter: blur(20px) saturate(1.5); backdrop-filter: blur(20px) saturate(1.5); border-top: 1px solid rgba(255,255,255,.12); }
.scan-intro .btn-secondary { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.25); }

/* 降級：使用者要求減少透明度 / 高對比 / 瀏覽器不支援模糊 → 改用不透明底 */
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  :root, :root[data-theme="dark"] { --lg-bg: var(--surface); --lg-bg-strong: var(--surface); --lg-border: var(--line); }
  .card, .stat, .notice, .tabbar, .icon-btn, .chip, .search-bar, .toast, .dialog, .bar, .win-row, .scan-panel, .page-header::before { -webkit-backdrop-filter: none; backdrop-filter: none; }
  body { background: var(--bg); }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --lg-bg: var(--surface); --lg-bg-strong: var(--surface); }
}
