/* ==========================================================
   LIFF 版面(店家端 / 業務端,手機優先)。色票見 app.css。
   桌機開啟時置中成 480px 手機欄,方便展示。
   ========================================================== */
.l-liff { --app-w: 480px; --nav-h: 60px; background: #E9E2D5; }
.app { position: relative; max-width: var(--app-w); min-height: 100vh; margin: 0 auto; background: var(--bg); padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
.app.has-bar { padding-bottom: calc(var(--nav-h) + 76px + env(safe-area-inset-bottom)); }
.app.no-nav { padding-bottom: 96px; }
@media (min-width: 520px) { .app { box-shadow: 0 0 0 1px var(--line), 0 10px 40px rgba(43, 38, 34, .08); } }
.wrap { padding: 0 16px; }

/* ── 頁首 ── */
.app-head { position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1px solid var(--line); }
.app-head .top { display: flex; align-items: center; gap: 10px; padding: 12px 16px 10px; }
.app-head .who { flex: 1; min-width: 0; }
.app-head .who .name { font: 600 16px/1.3 var(--f-serif); display: flex; align-items: center; gap: 6px; }
.app-head .who .meta { font-size: 12px; color: var(--sub); }
.app-head .tools { padding: 0 16px 12px; }

/* 子頁頁首(返回 + 標題)*/
.page-head { position: sticky; top: 0; z-index: 30; display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; height: 54px; padding: 0 8px; background: var(--bg); border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: 17px; text-align: center; }
.page-head .back { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; }
.page-head .back .ic { width: 22px; height: 22px; }

/* 業務代下單橫幅 */
.proxy-banner { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--primary); color: #F6F1E7; font-size: 13px; }
.proxy-banner b { font-weight: 600; font-size: 14px; }
.proxy-banner .tier { border-color: #E9C9CE; color: #F6F1E7; }
.proxy-banner a { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; padding: 4px 8px; border: 1px solid rgba(246, 241, 231, .5); border-radius: var(--radius); font-size: 12px; }

/* ── 底部導覽 ── */
.bnav { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 40; width: 100%; max-width: var(--app-w); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line); }
.bnav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; color: var(--mute); position: relative; }
.bnav a .ic { width: 22px; height: 22px; }
.bnav a.is-active { color: var(--primary); font-weight: 500; }
.bnav a.is-active::before { content: ''; position: absolute; top: 0; left: 30%; right: 30%; height: 2px; background: var(--primary); }
.bnav .dot { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--primary); color: #fff; font: 600 10px/16px var(--f-num); }

/* ── 購物車列 ── */
.cart-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); z-index: 35; width: 100%; max-width: var(--app-w); display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--invert-bg); color: var(--invert-ink); }
.no-nav .cart-bar { bottom: env(safe-area-inset-bottom); }
.cart-bar .info { flex: 1; min-width: 0; font-size: 12px; color: var(--invert-sub); }
.cart-bar .info b { display: block; font: 600 18px/1.2 var(--f-num); color: var(--invert-ink); }
.cart-bar .btn { min-height: 44px; }
.cart-bar .cart-ic { position: relative; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(242, 237, 228, .25); border-radius: var(--radius); }
.cart-bar .cart-ic .dot { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--primary); font: 600 11px/18px var(--f-num); text-align: center; padding: 0 4px; }
.cart-bar.is-empty .btn { opacity: .45; pointer-events: none; }

/* ── 區塊 ── */
.block { padding: 16px; }
.block + .block { border-top: 8px solid #EFE8DB; }
.group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding-top: 4px; }
.group-head h2 { font-size: 16px; display: flex; align-items: center; gap: 6px; }
.group-head h2 .ic { width: 18px; height: 18px; color: var(--primary); }
.group-head .hint { font-size: 12px; color: var(--mute); }
#more { display: block; scroll-margin-top: 180px; }   /* 「顯示更多」後接續處,避開置頂頁首 */
.list-bottom { padding: 16px 0 4px; text-align: center; font-size: 13px; color: var(--sub); }

/* ── 訂單卡 ── */
.o-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.o-card + .o-card { margin-top: 12px; }
.o-card .o-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.o-card .o-no { font: 600 14px var(--f-num); }
.o-card .o-sub { font-size: 12px; color: var(--sub); margin-top: 2px; }
.o-card .o-items { font-size: 13px; color: var(--ink); margin-top: 10px; line-height: 1.55; }
.o-card .o-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line-2); }
.o-card .o-total { font-size: 12px; color: var(--sub); }
.o-card .o-total b { display: block; font: 600 17px var(--f-num); color: var(--ink); }
.o-card .o-acts { display: flex; gap: 6px; }
/* 狀態卡:顏色給「要注意的」— 待出貨暖底 + 框 + 粗左邊;已出貨(多數)只留細綠邊;已取消整片灰、金額刪除線 */
.o-card { border-left-width: 4px; }
.o-card.is-pending { background: var(--warn-tint); border-color: var(--warn-line); border-left-color: var(--warn); }
.o-card.is-pending .o-foot { border-top-color: var(--warn-line); }
.o-card.is-shipped { border-left-color: var(--ok); }
.o-card.is-cancelled { background: var(--surface-2); border-color: var(--line); border-left-color: var(--line-2); }
.o-card.is-cancelled .o-no, .o-card.is-cancelled .o-items, .o-card.is-cancelled .o-total b { color: var(--mute); }
.o-card.is-cancelled .o-total b { text-decoration: line-through; font-weight: 500; }
.o-card.is-cancelled .p-thumb, .o-card.is-cancelled img { opacity: .5; }
/* 店家設定(業務):等級 / 叫貨權限 / 設定紀錄 */
.set-list { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); }
.set-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.set-row + .set-row { border-top: 1px solid var(--line); }
.set-row .k { font-size: 12px; color: var(--sub); }
.set-row .v { font-size: 14px; margin-top: 2px; }
.set-row .is-off { color: var(--danger); }
.log-row { display: grid; grid-template-columns: 86px 1fr; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.log-row:last-of-type { border-bottom: 0; }
.log-row .when { color: var(--mute); font-size: 12px; padding-top: 1px; }
.log-row .why { font-size: 12px; color: var(--sub); margin-top: 2px; }
.log-row.is-new { background: var(--warn-tint); margin: 0 -8px; padding: 8px; }
.tier-pick { border: 1px solid var(--line); border-radius: var(--radius); }
.tp-row { display: flex; align-items: center; gap: 10px; padding: 12px; cursor: pointer; }
.tp-row + .tp-row { border-top: 1px solid var(--line); }
.tp-row:has(input:checked) { background: var(--primary-soft); }
.tp-row input { accent-color: var(--primary); }
.tp-row b { display: block; font-size: 14px; }
.tp-row small { display: block; font-size: 12px; color: var(--sub); }
.tp-price { font-weight: 600; font-size: 14px; }
/* 名冊卡片:暫停叫貨 → 灰底 */
.s-card.is-paused { background: var(--surface-2); }
.s-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.s-flags:empty { display: none; }
/* 店家端:暫停叫貨 → 收掉加購與購物車,顯示提示 */
.paused-bar { display: none; }
.is-paused .paused-bar { display: flex; gap: 10px; align-items: flex-start; margin: 12px 16px 0; padding: 12px 14px; background: var(--danger-soft); border: 1px solid var(--danger); border-radius: var(--radius); color: var(--danger); font-size: 14px; }
.is-paused .paused-bar .ic { flex: none; margin-top: 2px; }
.is-paused .paused-bar p { color: var(--ink); font-size: 13px; margin-top: 2px; }
.is-paused .paused-bar a { color: var(--danger); font-weight: 600; text-decoration: underline; }
.is-paused .stepper, .is-paused [data-add], .is-paused .cart-bar, .is-paused [data-submit], .is-paused .act-bar [data-action="reorder"], .is-paused .o-acts [data-action="reorder"], .is-paused .search-scan { display: none !important; }
.is-paused .app.has-bar { padding-bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); }
.is-paused .scan-view, .is-paused .scan-sim, .is-paused .scan-result, .is-paused .scanned-log { display: none !important; }
/* 訂單詳情頂部:與卡片同一套狀態色 */
.od-head { border-left: 4px solid transparent; }
.od.is-pending .od-head { background: var(--warn-tint); border-left-color: var(--warn); }
.od.is-shipped .od-head { border-left-color: var(--ok); }
.od.is-cancelled .od-head { background: var(--surface-2); border-left-color: var(--line-2); }
.od.is-cancelled .od-head .num.strong { color: var(--mute); text-decoration: line-through; }
/* 精簡訂單列(業務店家詳情「近期訂單」):同一套狀態色,列高不變 */
.line.o-row { padding: 10px 8px 10px 10px; border-left: 4px solid transparent; }
.o-row.is-pending { background: var(--warn-tint); border-left-color: var(--warn); }
.o-row.is-shipped { border-left-color: var(--ok); }
.o-row.is-cancelled { background: var(--surface-2); border-left-color: var(--line-2); }
.o-row.is-cancelled .nm, .o-row.is-cancelled .amt { color: var(--mute); }
.o-row.is-cancelled .amt { text-decoration: line-through; }
.o-row.is-cancelled .amt small { text-decoration: none; }
.line.o-row { border-bottom: 0; }
.o-row + .o-row { margin-top: 6px; }
/* 狀態分頁:色點對應卡片;待出貨有單時數量反白 */
.st-tabs .dot { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; vertical-align: 1px; }
.st-tabs .is-pending .dot { background: var(--warn); }
.st-tabs .is-shipped .dot { background: var(--ok); }
.st-tabs .is-cancelled .dot { background: var(--line-2); }
.st-tabs .cnt { display: inline-block; min-width: 18px; height: 18px; margin-left: 4px; padding: 0 5px; border-radius: 9px; background: var(--surface-2); color: var(--sub); font-size: 11px; line-height: 18px; text-align: center; }
.st-tabs .cnt.is-hot { background: var(--warn); color: #FBF8F2; font-weight: 600; }
.cancel-tip { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--warn); margin-top: 8px; }
.cancel-tip .ic { width: 14px; height: 14px; }
/* 明細行(購物車 / 訂單詳情)*/
.line { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: center; }
.line:last-child { border-bottom: 0; }
.line .p-thumb { width: 56px; height: 68px; }
.line .p-thumb img { max-height: 62px; }
.line .nm { font-size: 14px; font-weight: 500; line-height: 1.4; }
.line .mt { font: 12px var(--f-num); color: var(--mute); margin-top: 2px; }
.line .amt { text-align: right; font: 600 15px var(--f-num); }
.line .amt small { display: block; font: 400 12px var(--f-num); color: var(--sub); }
.line .ctl { grid-column: 2 / 4; display: flex; align-items: center; justify-content: space-between; }
.line .rm { color: var(--mute); display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.line .rm .ic { width: 16px; height: 16px; }
.sum-table { width: 100%; font-size: 14px; }
.sum-table td { padding: 4px 0; }
.sum-table td:last-child { text-align: right; font-family: var(--f-num); }
.sum-table tr.total td { padding-top: 10px; border-top: 1px solid var(--line); font-size: 15px; font-weight: 700; }
.sum-table tr.total td:last-child { font-size: 20px; color: var(--primary); }

/* 底部固定動作列(無底部導覽的子頁)*/
.act-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; z-index: 35; width: 100%; max-width: var(--app-w); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; }
.act-bar .btn { flex: 1; }
.act-bar .sum { flex: 1; font-size: 12px; color: var(--sub); }
.act-bar .sum b { display: block; font: 700 19px var(--f-num); color: var(--primary); }

/* 成功狀態 */
.done { text-align: center; padding: 48px 24px 24px; }
.done .ring { width: 72px; height: 72px; margin: 0 auto 16px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: flex; align-items: center; justify-content: center; }
.done .ring .ic { width: 36px; height: 36px; }
.done h2 { font-size: 22px; }
.done .no { font: 600 15px var(--f-num); margin-top: 6px; color: var(--sub); }

/* ── 掃碼 ── */
/* 相機區:約佔螢幕上半部;圖層順序 = 影片(0)→ 掃描框 / 暗罩(1,不攔點擊)→ 浮出小卡(2)→ 工具列(3)→ 待機畫面(4)
   (舊版「掃到閃綠」的透明層蓋在按鈕上,點按鈕沒反應 → 裝飾層一律 pointer-events: none) */
.scan-view { --scan-gold: #C9A27A; --scan-red: #E0566A; --scan-ok: #6FCB8E;
  position: relative; height: clamp(320px, 56vh, 480px); overflow: hidden; background: #1E1A17 radial-gradient(ellipse at 50% 40%, #3A322C 0%, #1E1A17 70%); }
.scan-view video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
/* 橫長框(條碼是橫的),框外用超大陰影壓暗 */
.scan-box { position: absolute; left: 8%; right: 8%; top: 46%; transform: translateY(-50%); aspect-ratio: 2.6 / 1; max-height: 40%; z-index: 1;
  border-radius: 14px; box-shadow: 0 0 0 9999px rgba(12, 10, 9, .52); pointer-events: none; transition: transform .18s var(--ease); }
.scan-box i { position: absolute; width: 30px; height: 30px; border: 4px solid var(--scan-gold); transition: border-color .15s; }
.scan-box i:nth-child(1) { left: -2px; top: -2px; border-right: 0; border-bottom: 0; border-top-left-radius: 14px; }
.scan-box i:nth-child(2) { right: -2px; top: -2px; border-left: 0; border-bottom: 0; border-top-right-radius: 14px; }
.scan-box i:nth-child(3) { left: -2px; bottom: -2px; border-right: 0; border-top: 0; border-bottom-left-radius: 14px; }
.scan-box i:nth-child(4) { right: -2px; bottom: -2px; border-left: 0; border-top: 0; border-bottom-right-radius: 14px; }
/* 中央固定紅線(參照 demo-01:不上下移動);只做很緩的明暗呼吸 */
.scan-box .laser { position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; margin-top: -1px; border-radius: 2px; background: var(--scan-red); box-shadow: 0 0 10px var(--scan-red); animation: scanglow 2.6s ease-in-out infinite; }
@keyframes scanglow { 0%, 100% { opacity: .65; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .scan-box .laser { animation: none; opacity: .9; } }
.scan-box .hint { position: absolute; left: -10%; right: -10%; top: calc(100% + 14px); text-align: center; color: #F2EDE4; font-size: 13px; text-shadow: 0 1px 3px rgba(0, 0, 0, .8); }
/* 掃到:框角變綠、輕微放大一下 */
.scan-view.is-hit .scan-box { transform: translateY(-50%) scale(1.03); }
.scan-view.is-hit .scan-box i { border-color: var(--scan-ok); }
.scan-view.is-hit .scan-box .laser { background: var(--scan-ok); box-shadow: 0 0 12px var(--scan-ok); }
/* 工具列:按鈕至少 44px 高(好按) */
.scan-view .top-tools { position: absolute; top: 10px; left: 10px; right: 10px; z-index: 3; display: flex; align-items: center; gap: 8px; }
.scan-view .tool { min-height: 44px; min-width: 44px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid rgba(246, 241, 231, .35); background: rgba(20, 16, 14, .62); color: #F2EDE4; font-size: 14px; font-weight: 500; border-radius: 999px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.scan-view .tool.is-round { padding: 0; width: 44px; }
.scan-view .tool .ic { width: 18px; height: 18px; }
.scan-view .tool[aria-pressed="true"] { background: var(--scan-gold); border-color: var(--scan-gold); color: #1E1A17; }
.scan-view .tool:active { transform: scale(.96); }
/* 剛剛加入的小卡:從下緣浮出,1.8 秒後收回 */
.scan-pop { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px;
  background: rgba(251, 248, 242, .96); color: var(--ink); border-radius: 12px; box-shadow: 0 6px 20px rgba(0, 0, 0, .35); pointer-events: none;
  animation: scanpop .22s var(--ease); }
@keyframes scanpop { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.scan-pop img { width: 40px; height: 44px; object-fit: contain; flex: none; }
.scan-pop img[src=""] { display: none; }
.scan-pop .grow { min-width: 0; }
.scan-pop b { display: block; font-size: 14px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scan-pop [data-pop-sub] { display: block; font-size: 12px; color: var(--sub); }
.scan-pop .q { font: 700 20px var(--f-num); color: var(--ok); }
.scan-pop.is-warn .q, .scan-pop.is-warn [data-pop-sub] { color: var(--warn); }
.scan-pop.is-err .q, .scan-pop.is-err [data-pop-sub] { color: var(--danger); }
/* 待機畫面:相機沒開 / 被拒 / 關閉後 */
.scan-standby { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; text-align: center; color: #F2EDE4;
  background: radial-gradient(ellipse at 50% 30%, rgba(107, 30, 43, .55), transparent 65%), #1E1A17; }
.scan-standby .big { width: 64px; height: 64px; display: grid; place-items: center; border: 2px solid var(--scan-gold); border-radius: 18px; color: var(--scan-gold); }
.scan-standby .big .ic { width: 34px; height: 34px; }
.scan-standby b { font: 600 20px/1.3 var(--f-serif); letter-spacing: .06em; }
.scan-standby p { margin: 0; max-width: 30ch; color: #C9BFB2; font-size: 13px; line-height: 1.7; }
.scan-standby .btn { min-height: 52px; padding: 0 28px; margin-top: 6px; font-size: 16px; }
.scan-standby .err { color: #F0A49A; }
.scan-sim { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 16px; background: var(--surface-2); font-size: 12px; color: var(--sub); align-items: center; }
.scan-sim button { height: 28px; padding: 0 10px; border: 1px dashed var(--line-2); background: var(--surface); border-radius: var(--radius); font-size: 12px; }
.scan-result { border-left: 3px solid var(--ok); }
.scan-result.is-warn { border-left-color: var(--warn); }
.scan-result.is-err { border-left-color: var(--danger); }
.scan-result .rh { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.scan-result .rh .ic { width: 20px; height: 20px; }
.scan-result .code { font: 12px var(--f-num); color: var(--sub); margin-top: 2px; }
.pick { display: grid; grid-template-columns: 22px 56px 1fr; gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); cursor: pointer; }
.pick + .pick { margin-top: 8px; }
.pick input { accent-color: var(--primary); width: 18px; height: 18px; }
.pick:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.pick .p-thumb { width: 56px; height: 64px; }
.pick .p-thumb img { max-height: 58px; }
.scanned-log .row-log { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.scanned-log .row-log:last-child { border-bottom: 0; }
.scanned-log .row-log .q { margin-left: auto; font: 600 15px var(--f-num); color: var(--primary); }

/* ── 業務:KPI / 圖表 / 店家卡 ── */
.hello { padding: 18px 16px 14px; background: var(--invert-bg); color: var(--invert-ink); }
.hello .eyebrow { color: var(--invert-sub); }
.hello h1 { font-size: 20px; margin-top: 6px; }
.hello .meta { font-size: 12px; color: var(--invert-sub); margin-top: 2px; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.kpi .k { font-size: 12px; color: var(--sub); display: flex; align-items: center; gap: 4px; }
.kpi .v { font: 700 22px/1.25 var(--f-num); margin-top: 4px; }
.kpi .d { font-size: 12px; color: var(--mute); margin-top: 2px; }
.kpi.is-main { grid-column: 1 / -1; }
.kpi .up { color: var(--ok); }
.progress { height: 8px; background: var(--surface-2); border-radius: 4px; overflow: hidden; margin-top: 10px; }
.progress i { display: block; height: 100%; background: var(--primary); }

/* 週報 / 月報 */
.period-nav { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; }
.pn-btn { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; color: var(--ink); }
.pn-btn.is-off { color: var(--line-2); }
.pn-label { text-align: center; }
.pn-label b { font-size: 17px; }
.pn-label span { margin-left: 8px; padding: 1px 6px; font-size: 11px; color: var(--primary); background: var(--primary-soft); border-radius: var(--radius); vertical-align: 2px; }
.delta { display: flex; align-items: center; gap: 4px; color: var(--sub); flex-wrap: wrap; }
.delta b { color: var(--ink); }
.delta .mute { font-size: 12px; }
.report-who { padding-bottom: 8px; }
/* 長條圖:單一數列、細柱、4px 圓角頂端貼基線;只標最高與當期,其餘點擊看 */
.rchart { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 2px; height: 168px; margin-top: 12px; border-bottom: 1px solid var(--line-2); }
.rc-col { position: relative; display: flex; flex-direction: column; align-items: center; min-width: 0; outline: none; cursor: pointer; }
.rc-val { height: 16px; font: 600 11px var(--f-num); color: var(--ink); }
.rc-bar { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.rc-bar i { width: 60%; max-width: 28px; background: var(--primary); border-radius: 4px 4px 0 0; opacity: .55; transition: opacity .15s; }
.rc-col.is-current .rc-bar i, .rc-col:hover .rc-bar i, .rc-col:focus .rc-bar i { opacity: 1; }
.rc-x { position: absolute; top: 100%; padding-top: 6px; text-align: center; font-size: 12px; color: var(--sub); line-height: 1.2; white-space: nowrap; }
.rc-x small { display: block; font: 10px var(--f-num); color: var(--mute); }
.rc-col.is-current .rc-x { color: var(--primary); font-weight: 600; }
.rc-col.is-future .rc-x { color: var(--line-2); }
.rc-col[data-tip]:hover::after, .rc-col[data-tip]:focus::after { content: attr(data-tip); position: absolute; bottom: calc(100% - 8px); left: 50%; transform: translateX(-50%); z-index: 2; padding: 4px 8px; background: var(--ink); color: var(--invert-ink); font: 12px var(--f-num); white-space: nowrap; border-radius: var(--radius); pointer-events: none; }
.rc-col:first-child[data-tip]::after { left: 0; transform: none; }
.rc-col:last-child[data-tip]::after { left: auto; right: 0; transform: none; }
.rchart + p { margin-top: 40px; }
.rank-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rank-row:last-child { border-bottom: 0; }
.rank-row .no { width: 20px; flex: none; text-align: center; font-size: 14px; color: var(--sub); }
.rank-row:nth-child(-n+3) .no { color: var(--primary); }
.rank-row .grow { min-width: 0; }
.rank-row .nm { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-bar { display: block; height: 4px; margin-top: 6px; background: var(--surface-2); border-radius: 2px; }
.rk-bar i { display: block; height: 100%; background: var(--primary); border-radius: 2px; opacity: .55; }
.rank-row .amt { text-align: right; font: 600 14px var(--f-num); white-space: nowrap; }
.rank-row .amt small { display: block; font: 400 12px var(--f-num); color: var(--sub); }
.split { display: flex; gap: 2px; height: 12px; }
.split i { display: block; height: 100%; }
.split i:first-child { border-radius: 4px 0 0 4px; }
.split i:last-child { border-radius: 0 4px 4px 0; }
.split .is-a, .split-legend .is-a { background: var(--primary); }
.split .is-b, .split-legend .is-b { background: var(--line-2); }
.split-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; color: var(--sub); }
.split-legend span { display: inline-flex; align-items: center; gap: 6px; }
.split-legend i { width: 10px; height: 10px; border-radius: 2px; }
.split-legend b { color: var(--ink); }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; align-items: end; height: 140px; padding-top: 18px; }
.bars .b { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.bars .b i { width: 100%; max-width: 28px; background: var(--line-2); min-height: 2px; }
.bars .b.is-today i { background: var(--primary); }
.bars .b .val { font: 10px var(--f-num); color: var(--sub); }
.bars .b .day { font: 11px var(--f-num); color: var(--mute); }
.s-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.s-card + .s-card { margin-top: 10px; }
.s-card .s-top { display: flex; align-items: center; gap: 8px; }
.s-card .s-name { font: 600 16px var(--f-serif); flex: 1; min-width: 0; }
.s-card .s-meta { font-size: 12px; color: var(--sub); margin-top: 4px; }
.s-card .s-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.s-card .s-amt { font-size: 12px; color: var(--sub); }
.s-card .s-amt b { font: 600 16px var(--f-num); color: var(--ink); margin-left: 4px; }
.s-card.is-alert { border-left: 3px solid var(--warn); }

/* ── 我的 ── */
.profile { padding: 24px 16px 20px; display: flex; gap: 14px; align-items: center; }
.avatar { width: 56px; height: 56px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--primary); color: #F6F1E7; font: 600 22px var(--f-serif); }
.menu-list { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.menu-list > * { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 16px; border-bottom: 1px solid var(--line); font-size: 15px; }
.menu-list > *:last-child { border-bottom: 0; }
.menu-list > button { width: 100%; text-align: left; }
.menu-list .ic { color: var(--sub); }
.menu-list .val { margin-left: auto; font-size: 13px; color: var(--sub); display: inline-flex; align-items: center; gap: 4px; }
.menu-list .val .ic { width: 16px; height: 16px; color: var(--mute); }
.menu-title { padding: 18px 16px 8px; font-size: 12px; color: var(--sub); letter-spacing: .08em; }
.menu-head { display: flex; align-items: flex-end; justify-content: space-between; }
.menu-edit { display: inline-flex; align-items: center; gap: 4px; padding: 18px 16px 8px; font-size: 13px; color: var(--primary); font-weight: 500; }
/* 編輯店家資料 */
.profile-form { padding-bottom: 8px; }
.form-title { font-size: 12px; color: var(--sub); letter-spacing: .08em; margin-bottom: 4px; }
.locked { background: var(--surface-2); padding: 4px 14px 12px; }
.locked > div { display: flex; justify-content: space-between; align-items: center; min-height: 40px; border-bottom: 1px solid var(--line); font-size: 14px; }
.locked > div span { color: var(--sub); }
.locked > p { display: flex; gap: 6px; align-items: center; margin-top: 10px; font-size: 12px; color: var(--sub); }

/* ── 全頁狀態(綁定 / 未授權)── */
.gate { min-height: 100vh; display: flex; flex-direction: column; padding: 32px 20px; }
.gate .logo { display: flex; align-items: center; gap: 10px; }
.gate .logo b { font: 600 17px var(--f-serif); }
.gate .logo small { display: block; font: 500 10px var(--f-num); letter-spacing: .16em; color: var(--sub); }
.gate .body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 32px 0; }
.gate .big-ic { width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line-2); background: var(--surface); color: var(--primary); margin-bottom: 20px; }
.gate .big-ic .ic { width: 30px; height: 30px; }
.gate h1 { font-size: 24px; }
.gate .lead { color: var(--sub); margin-top: 10px; font-size: 15px; }
.perk { display: grid; grid-template-columns: 36px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.perk:last-child { border-bottom: 0; }
.perk .pi { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: var(--primary-soft); color: var(--primary); }
.perk .pi .ic { width: 18px; height: 18px; }
.perk b { display: block; font-size: 15px; }
.perk span { font-size: 13px; color: var(--sub); }

/* 商品詳情(LIFF 版)*/
.pd-hero { background: var(--surface); border-bottom: 1px solid var(--line); padding: 20px; display: flex; justify-content: center; }
.pd-hero img { max-height: 300px; width: auto; mix-blend-mode: multiply; }
