/* ===== 視覺基底（2026/10 改版）=====
   英數字用 IBM Plex Sans（放在 vendor/fonts，自己提供；不走 Google Fonts——中國大陸的店家連不到會卡住）。
   中文交給各系統內建黑體：Mac 蘋方、Windows 微軟正黑、Linux 思源黑體。
   顏色一律用下面的變數；--muted 從 #8a929c 加深，原本小字在白底上對比不足。 */
@font-face { font-family: "Plex Sans"; src: url(/vendor/fonts/plex-sans-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url(/vendor/fonts/plex-sans-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url(/vendor/fonts/plex-sans-600.woff2) format("woff2"); font-weight: 600 700; font-display: swap; }
:root {
  --pink: #c8006f; --pink-dark: #a3005a; --pink-tint: #fbe8f2; --pink-line: #f1c4db;
  --bg: #f2f2f4; --card: #fff; --line: #e2dfe5; --line-strong: #d3cfd8; --text: #1e1a22; --muted: #6b6474; --faint: #716a79; --hover: #f5f4f7;
  --r-sm: 8px; --r-lg: 12px; --amber-tint: #fff7e6; --amber-line: #f0d59a;
  --green: #12855a; --amber: #a86500; --red: #c9372c; --blue: #2563c9; --purple: #6a4cc7; --purple-text: #4f35a8; --amber-text: #7a4a00; --red-text: #a82820;
  --ink: #24182a; --ink-2: #33243a; --ink-3: #3d2944; --ink-line: #3a2c40; --ink-text: #e6dde8; --ink-muted: #a693ac;
  --font: "Plex Sans", "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", "Noto Sans CJK TC", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
/* hidden 屬性永遠優先：class 上的 display（flex／inline-flex）會蓋掉它（BACKLOG #103），全站一次擋掉 */
[hidden] { display: none !important; }
body { margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5; background: var(--bg); color: var(--text); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
code { font-family: var(--mono); font-size: .92em; background: #f1eff3; padding: 1px 5px; border-radius: 4px; }

/* ===== 深色頂欄 ===== */
.topbar { display: flex; align-items: center; gap: 12px; background: var(--ink); padding: 12px 22px; border-bottom: 1px solid var(--ink-line); position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 8px; }
.brand .logo { font-size: 22px; }
.brand b { font-size: 16px; color: #f3f4f6; }
.brand .sub { color: #9aa3ad; font-size: 14px; }
.topnav { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.topnav a { color: #c2c8d0; font-size: 14px; text-decoration: none; padding: 7px 14px; border-radius: 8px; }
.topnav a:hover { background: var(--ink-2); color: #fff; }
.topnav a.active { background: var(--ink-3); color: #fff; font-weight: 600; }
.topnav .nav-gear { font-size: 15px; padding: 6px 10px; }
.status { font-size: 12px; color: #9aa3ad; margin-left: 12px; }
.status .pill { background: var(--ink-2); color: var(--ink-text); padding: 3px 9px; border-radius: 999px; font-weight: 600; }
.status .pill.live { background: #14331f; color: #4ade80; }

/* ===== 上架工具子分頁 ===== */
.subtabs { display: flex; gap: 6px; background: var(--card); padding: 9px 22px; border-bottom: 1px solid var(--line); }
.subtabs a { font-size: 13px; color: var(--muted); text-decoration: none; padding: 6px 16px; border-radius: 8px; }
.subtabs a:hover { background: #f1f2f4; color: var(--text); }
.subtabs a.active { background: #fdeef6; color: var(--pink); font-weight: 600; }

/* ===== 篩選列 ===== */
.filterbar { display: flex; align-items: center; gap: 10px; background: var(--card); padding: 12px 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.filterbar[hidden], .bulk-bar[hidden] { display: none; }
#scanBar[hidden] { display: none !important; }
#loadMoreWrap[hidden] { display: none !important; }
.fld { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.tilde { color: var(--muted); }
input[type=date] { font: inherit; font-size: 14px; height: 38px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--text); }
.search { flex: 1; min-width: 240px; font: inherit; font-size: 14px; height: 38px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--text); }
select.search { padding: 0 30px 0 10px; }
.search:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px var(--pink-tint); }
.btn { font: inherit; font-size: 14px; min-height: 38px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--text); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--pink); color: #fff; border-color: var(--pink); font-weight: 500; }
.btn.primary:hover { background: var(--pink-dark); border-color: var(--pink-dark); }
.btn.ghost { color: var(--muted); border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.danger { color: var(--red); border-color: #ecc3bf; }
.btn.danger:hover { background: #fdf1f0; }
.btn.small { min-height: 32px; padding: 0 11px; font-size: 13px; border-radius: var(--r-sm); }

/* ===== 狀態分頁 ===== */
.tabs { display: flex; gap: 4px; background: var(--card); padding: 0 16px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { display: flex; align-items: center; gap: 7px; white-space: nowrap; padding: 13px 12px; font-size: 14px; color: #5e5766; border-bottom: 2px solid transparent; cursor: pointer; background: none; border-top: none; border-left: none; border-right: none; font-family: inherit; }
.tab .ico { font-size: 15px; display: inline-flex; align-items: center; }
.tab .ico svg { width: 16px; height: 16px; }
.bulk-title svg { width: 16px; height: 16px; vertical-align: -3px; margin-right: 2px; }
.tab .cnt { color: var(--faint); font-size: 13px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--pink); font-weight: 600; }
.tab.active .cnt { color: var(--pink); }

main { max-width: 1180px; margin: 0 auto; padding: 16px 22px 60px; }
.list { display: flex; flex-direction: column; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, Consolas, monospace; }

/* ===== 訂單列 ===== */
.row { display: grid; grid-template-columns: 220px 84px 1fr 220px 160px 38px; gap: 16px; align-items: start; background: var(--card); border: 1px solid var(--line); border-top: none; padding: 16px; }
.order-block:first-child .row { border-top: 1px solid var(--line); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.order-block:last-child .row { border-radius: 0 0 var(--r-lg) var(--r-lg); }
.order-block .row { cursor: pointer; }
.order-block.open:last-child .row { border-radius: 0; }
.order-block.open .row { background: #f7f9fc; }
.row:hover { background: #fcfcfd; }
.c-order .mono { font-size: 15px; font-weight: 600; }
.badge { display: inline-block; padding: 2px 8px; border-radius: var(--r-sm); font-size: 12px; font-weight: 600; margin-top: 6px; }
.b-checked_out { background: #eef3ff; color: var(--blue); }
.b-at_warehouse_transit, .b-at_warehouse_arrived { background: #fff3df; color: var(--amber); }
.b-shipped_overseas { background: #f0ecfd; color: var(--purple); }
.b-shipped_tw { background: #fdeef6; color: var(--pink); }
.b-delivered { background: #e7f7ee; color: var(--green); }
.b-returned { background: #fbeee0; color: #b5651d; }
.b-cancelled { background: #eef0f2; color: var(--muted); }
.b-error { background: #fce8e8; color: var(--red); }
.committed { font-size: 11px; color: var(--green); margin-top: 5px; }
.c-thumb img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #f3f4f6; }
.c-thumb .ph { width: 84px; height: 84px; border-radius: 8px; background: #f0f1f3; display: flex; align-items: center; justify-content: center; color: #c4c8ce; font-size: 22px; }
.c-goods .name { font-size: 13px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.c-goods .art { color: var(--muted); font-size: 12px; margin-top: 5px; font-family: ui-monospace, monospace; }
.c-goods .spec { display: inline-block; margin-top: 6px; font-size: 12px; color: #444; background: #f4f5f7; border-radius: var(--r-sm); padding: 2px 8px; }
.c-recipient .name { font-size: 13px; }
.c-recipient .addr { color: var(--muted); font-size: 12px; margin-top: 4px; line-height: 1.4; }
.c-date { font-size: 12px; color: var(--muted); text-align: right; }
.c-date .o { color: var(--text); }
.c-date .ship { margin-top: 8px; }
.c-date .track { font-family: ui-monospace, monospace; font-size: 11px; color: var(--blue); margin-top: 6px; word-break: break-all; }
.c-act { display: flex; align-items: center; justify-content: center; }
.c-act .chev { color: #c4c8ce; font-size: 18px; display: inline-block; transition: transform .15s; }
.order-block.open .c-act .chev { transform: rotate(90deg); }

/* ===== 就地展開明細 ===== */
.order-detail { background: #f7f8fa; border: 1px solid var(--line); border-top: none; padding: 22px 26px; }
.order-block.open:last-child .order-detail { border-radius: 0 0 var(--r-lg) var(--r-lg); }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 48px; max-width: 820px; }
.dg-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.dg-value { font-size: 14px; color: var(--text); word-break: break-all; }
.dg-value.mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.dg.full { grid-column: 1 / -1; }
.detail-sec { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.sec-title { font-size: 13px; font-weight: 700; margin: 0 0 12px; }
.detail-actions { margin-top: 18px; display: flex; gap: 8px; }
.timeline { border-left: 2px solid var(--line); margin-left: 6px; padding-left: 16px; }
.tl-item { position: relative; padding-bottom: 14px; }
.tl-item::before { content: ''; position: absolute; left: -23px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--pink); border: 2px solid #fff; }
.tl-item.head::before { background: var(--amber); }
.tl-item.tail::before { background: var(--purple); }
.tl-desc { font-size: 13px; line-height: 1.45; }
.tl-meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
.leg-tag { font-size: 10px; padding: 0 6px; border-radius: 5px; margin-left: 6px; }
.leg-tag.head { background: #fff3df; color: var(--amber); }
.leg-tag.tail { background: #f0ecfd; color: var(--purple); }

.empty { padding: 50px; text-align: center; color: var(--muted); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); }
.pager { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 16px; font-size: 13px; color: var(--muted); }
.pager button { font: inherit; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.pager button:disabled { opacity: .4; cursor: default; }

/* ===== 側邊抽屜（選品/商品編輯用）===== */
.drawer { position: fixed; inset: 0; z-index: 40; }
.drawer-bg { position: absolute; inset: 0; background: rgba(0,0,0,.35); }
.drawer-panel { position: absolute; top: 0; right: 0; height: 100%; width: 460px; max-width: 92vw; background: #fff; box-shadow: -8px 0 30px rgba(0,0,0,.18); overflow-y: auto; padding: 22px; }
.drawer-panel.wide { width: 560px; }
.dh { display: flex; justify-content: space-between; align-items: flex-start; }
.dh .close { cursor: pointer; font-size: 22px; color: var(--muted); border: none; background: none; }
.d-title { font-size: 18px; font-weight: 700; }
.d-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.flabel { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); margin: 12px 0; }
.flabel input, .flabel select { font: inherit; font-size: 13px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); }
.flabel .hint { color: var(--muted); font-size: 12px; }
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.d-imgs { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 4px; }
.d-imgs img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.pricing-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.pricing-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--muted); }
.pricing-grid input { font: inherit; font-size: 13px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; }
.sku-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.sku-table th, .sku-table td { padding: 7px 8px; font-size: 12px; border-bottom: 1px solid var(--line); text-align: left; }
.sku-table th { color: var(--muted); font-weight: 600; }
.sku-table input { width: 72px; font: inherit; font-size: 12px; padding: 5px 6px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.sku-table .profit { font-weight: 600; color: var(--green); }
.sku-table .profit.neg { color: var(--red); }

/* ===== 表格（商品管理）===== */
.tablewrap { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 12px 14px; font-size: 14px; border-bottom: 1px solid #ecebef; vertical-align: top; }
th { background: #faf9fb; color: #5e5766; font-weight: 500; font-size: 13px; white-space: nowrap; }
tbody tr:last-child td { border-bottom: none; }
th.chk, td.chk { width: 34px; text-align: center; }
.goods-name { font-weight: 600; }
.sku { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ===== 選品商品格 ===== */
.catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.pcard { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.pcard:hover { box-shadow: 0 6px 20px rgba(0,0,0,.08); transform: translateY(-2px); }
.pimg img, .pimg .ph { width: 100%; height: 140px; object-fit: cover; border-radius: 8px; background: #f0f1f3; }
.pimg .ph { display: flex; align-items: center; justify-content: center; font-size: 36px; color: #c4c8ce; }
.ptitle { font-size: 13px; font-weight: 600; margin-top: 10px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pmeta { font-size: 12px; color: var(--muted); margin-top: 5px; }
.pmeta2 { font-size: 11px; color: var(--faint); margin-top: 2px; }
.pprice { font-size: 12px; color: var(--pink); font-weight: 600; margin-top: 8px; }

/* ===== Dashboard 總覽 ===== */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; }
.kpi-ic { width: 42px; height: 42px; border-radius: var(--r-sm); flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; color: var(--accent, var(--pink)); background: color-mix(in srgb, var(--accent, var(--pink)) 12%, #fff); }
.kpi-ic svg { width: 21px; height: 21px; }
.kpi-body { min-width: 0; }
.kpi-label { font-size: 12px; color: var(--muted); margin-top: 4px; }
.kpi-value { font-size: 24px; font-weight: 700; margin: 0; letter-spacing: -.5px; line-height: 1; }
.kpi-value .kpi-sub { font-size: 14px; color: var(--faint); font-weight: 600; }
.kpi-hint { display: none; }
.dash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; }
.dash-card h2 { font-size: 15px; margin: 0 0 14px; }
.todo { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: 8px; text-decoration: none; color: var(--text); transition: background .12s; }
.todo:hover { background: #fafbfc; }
.todo-ic { width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; color: var(--c, #8a929c); background: color-mix(in srgb, var(--c, #8a929c) 12%, #fff); }
.todo-ic svg { width: 16px; height: 16px; }
.todo-label { flex: 1; font-size: 13px; }
.todo-arrow { color: var(--faint); font-size: 18px; }
.sbar { margin-bottom: 11px; }
.sbar-top { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; }
.sbar-top b { color: var(--text); }
.sbar-track { height: 8px; background: #eef0f2; border-radius: 5px; overflow: hidden; }
.sbar-fill { height: 100%; border-radius: 5px; transition: width .4s ease; min-width: 2px; }
.quick-links { display: flex; flex-wrap: wrap; gap: 10px; }
.ql { display: flex; align-items: center; gap: 8px; padding: 11px 16px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; text-decoration: none; color: var(--text); font-size: 13px; font-family: inherit; cursor: pointer; }
.ql:hover { background: #f2f3f5; border-color: #d6d9de; }
.ql span { font-size: 16px; display: inline-flex; align-items: center; color: var(--muted); }
.ql span svg { width: 17px; height: 17px; }
.ql.primary span { color: var(--pink); }

/* ===== Toast ===== */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: var(--r-sm); font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.25); z-index: 60; max-width: 80%; }
.toast.err { background: var(--red); }
.toast.ok { background: var(--green); }

/* ===== 響應式 ===== */
@media (max-width: 820px) {
  .dash-cols { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; }
  .topnav { margin-left: 0; flex-wrap: wrap; }
  .tablewrap { overflow-x: auto; }
  table { min-width: 720px; }
  .row { min-width: 720px; }
  .drawer-panel, .drawer-panel.wide { width: 100%; max-width: 100%; }
  .detail-grid { grid-template-columns: 1fr; }
}

/* ===== 批量依品牌上架 ===== */
.bulk-bar { background: #fff7fb; border-bottom: 1px solid #f4cfe2; padding: 14px 22px; display: flex; flex-direction: column; gap: 11px; }
.bulk-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bulk-title { font-weight: 700; font-size: 14px; color: var(--pink-dark); min-width: 92px; }
.bulk-or { color: var(--muted); font-size: 13px; padding: 0 2px; }
.bulk-row .bulk-in { flex: 1 1 240px; max-width: 320px; min-width: 200px; }
.bulk-row.nowrap { flex-wrap: nowrap; }
.bulk-row.nowrap .bulk-in { flex: 1 1 0; min-width: 140px; max-width: 360px; }
@media (max-width: 720px) { .bulk-row.nowrap { flex-wrap: wrap; } }
.bulk-min { flex: 0 0 auto; width: 230px; font: inherit; font-size: 13px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
select.bulk-min { width: 210px; }
.bulk-row select { font: inherit; font-size: 13px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.bulk-row.sub { padding-top: 11px; border-top: 1px dashed #f1cfe0; }
.bulk-sub-label { font-size: 13px; color: var(--muted); min-width: 92px; }
.bulk-hint { font-size: 12px; color: #b9a2ae; }
.bulk-results { margin-top: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; max-height: 340px; overflow-y: auto; }
.bulk-summary { font-size: 13px; margin-bottom: 8px; }
.bulk-item { display: flex; align-items: center; gap: 10px; font-size: 13px; padding: 6px 0; border-bottom: 1px solid #f2f3f5; }
.bulk-item:last-child { border-bottom: none; }
.bulk-item.ok > span:first-child { color: var(--green); font-weight: 700; }
.bulk-item.fail > span:first-child { color: var(--red); font-weight: 700; }
.bulk-item.skip > span:first-child { color: #b0872e; font-weight: 700; }
.bulk-item .bi-title { flex: 1; }
.bulk-item .bi-msg { color: var(--muted); font-size: 12px; }

/* ===== 待採購卡 ===== */
.pend-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.pend-head h2 { margin: 0; }
.pend-head small { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 6px; }
.pend-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid #f2f3f5; }
.pend-item:last-child { border-bottom: none; }
.pi-main { flex: 1 1 280px; min-width: 0; }
@media (max-width: 820px) { .pi-buy { flex-wrap: wrap; white-space: normal; } }
.pi-title { font-size: 13px; font-weight: 600; }
.pi-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.pi-buy { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.pi-price { font-size: 13px; color: var(--pink); font-weight: 600; }
.pi-warn { font-size: 12px; color: var(--amber); }
.frow2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ===== 業績儀表板 ===== */
.sales-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 4px 0 18px; }
.skpi { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; border-left: 4px solid var(--accent, var(--pink)); background: #fff; }
.skpi-v { font-size: 22px; font-weight: 700; letter-spacing: -.5px; }
.skpi-l { font-size: 12px; color: var(--muted); margin-top: 4px; }
.sales-chart { margin-bottom: 6px; }
.sbars { display: flex; align-items: flex-end; gap: 3px; height: 130px; padding: 8px 0; }
.sbar-col { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.sbar-b { width: 100%; min-height: 2px; background: linear-gradient(to top, var(--pink), #f5a3d0); border-radius: 3px 3px 0 0; transition: height .3s; }
.sbar-col:hover .sbar-b { background: var(--pink-dark); }
.sbars-x { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); padding: 2px 0 4px; white-space: nowrap; }
.sales-subtitle { font-size: 14px; margin: 18px 0 10px; }
.top-products { display: flex; flex-direction: column; }
.tp-row { display: flex; align-items: center; gap: 12px; padding: 9px 4px; border-bottom: 1px solid #f2f3f5; font-size: 13px; }
.tp-row:last-child { border-bottom: none; }
.tp-rank { width: 22px; height: 22px; flex-shrink: 0; border-radius: var(--r-sm); background: #f4f5f7; color: var(--muted); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.tp-row:nth-child(1) .tp-rank { background: #fdeef6; color: var(--pink); }
.tp-img { width: 34px; height: 34px; flex-shrink: 0; object-fit: cover; border-radius: 7px; border: 1px solid var(--line); background: #f0f1f3; }
.tp-img.ph { display: inline-block; }
.tp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-qty { color: var(--muted); font-size: 12px; white-space: nowrap; }
.tp-rev { font-weight: 700; color: var(--pink); white-space: nowrap; min-width: 84px; text-align: right; }
@media (max-width: 820px) {
  .sales-kpis { grid-template-columns: repeat(2, 1fr); }
}

/* ===== 總覽改版（千牛式，粉色主題）===== */
.db-hero { padding: 16px 20px; }
.db-greet { font-size: 14px; margin: 0 0 14px; }
.db-greet b { font-weight: 700; }
.db-greet .tag { background: var(--pink); color: #fff; font-size: 12px; padding: 2px 9px; border-radius: 999px; }
.db-tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin: 0 -20px 16px; padding: 0 20px; }
.db-tabs a { padding: 0 0 11px; font-size: 14px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; cursor: pointer; }
.db-tabs a:hover { color: var(--text); }
.db-tabs a.on { color: var(--pink); border-bottom-color: var(--pink); font-weight: 600; }
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); }
.kpis .kpi { display: block; background: none; border: none; border-radius: 0; border-left: 1px solid var(--line); padding: 2px 18px; min-width: 0; }
.kpis .kpi:first-child { border-left: none; padding-left: 0; }
.kpi .k { font-size: 13px; color: var(--muted); margin-bottom: 9px; white-space: nowrap; }
.kpi .krow { display: flex; align-items: baseline; gap: 9px; }
.kpi .v { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.5px; line-height: 1; }
.kpi .v small { font-size: 13px; color: var(--faint); font-weight: 600; }
.kpi .go { font-size: 12px; color: var(--pink); text-decoration: none; white-space: nowrap; }
.kpi .sub { font-size: 12px; color: var(--faint); margin-top: 9px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.warn .v { color: var(--red); }
.db-h { font-size: 14px; margin: 0 0 14px; font-weight: 700; }
.db-h small { font-weight: 400; color: var(--muted); font-size: 12px; }
.db-split { display: grid; grid-template-columns: 260px 1fr; gap: 20px; align-items: center; }
.db-score { background: linear-gradient(180deg, #fdf2f8, #fff); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.db-score .lab { font-size: 12px; color: var(--muted); }
.db-score .big { font-size: 34px; font-weight: 800; color: var(--pink); letter-spacing: -1px; font-variant-numeric: tabular-nums; line-height: 1.2; margin-top: 4px; }
.db-score .revsub { font-size: 12px; color: var(--muted); margin-top: 8px; font-variant-numeric: tabular-nums; }
.db-pills { display: flex; gap: 6px; justify-content: flex-end; margin-bottom: 14px; }
.db-pills .pill { font-size: 12px; color: var(--muted); padding: 5px 13px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.db-pills .pill.on { background: #fdeef6; color: var(--pink); border-color: var(--pink-line); font-weight: 600; }
.db-donuts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.donut { display: flex; align-items: center; gap: 13px; }
.ring { width: 78px; height: 78px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; position: relative; }
.ring::after { content: ""; position: absolute; width: 56px; height: 56px; background: #fff; border-radius: 50%; }
.ring .pct { position: relative; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.donut .dt b { display: block; font-size: 13px; margin-bottom: 3px; }
.donut .dt .m { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
/* grid 子項預設 min-width:auto —— 熱銷 Top 5 的長商品名會撐開自己那欄，把趨勢圖擠成一條。
   min-width:0 讓欄位真的能縮，minmax 再給圖表一個最小寬度，保證它不會被壓扁。 */
.db-trend { display: grid; grid-template-columns: minmax(320px, 1.6fr) minmax(0, 1fr); gap: 20px; }
.db-trend > * { min-width: 0; }
.db-area { position: relative; }
@media (max-width: 900px) {
  .kpis { grid-template-columns: repeat(3, 1fr); row-gap: 16px; }
  .kpis .kpi { border-left: none; padding: 2px 0; }
  .db-split, .db-trend { grid-template-columns: 1fr; }
  .db-pills { justify-content: flex-start; }
}

/* ===== 選品勾選 / 批量選取列 ===== */
.pcard { position: relative; }
.pcard.selected { border-color: var(--pink); box-shadow: 0 0 0 2px rgba(230, 0, 126, .25); }
.pcard-chk { position: absolute; top: 8px; left: 8px; z-index: 2; background: rgba(255, 255, 255, .92); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 3px; display: inline-flex; cursor: pointer; }
.pcard-chk input { width: 17px; height: 17px; cursor: pointer; accent-color: var(--pink); margin: 0; }
.sel-bar { position: fixed; bottom: 18px; left: calc(50% + 108px); transform: translateX(-50%); background: var(--ink); color: #fff; display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); z-index: 55; }
.sel-bar[hidden] { display: none; }

/* 開發者專用元素：非開發者角色隱藏 */
.dev-only { display: none !important; }
body.role-dev .dev-only { display: inline-flex !important; }

/* 得物商家專屬 UI。gate.js 依 /api/auth/status 的 shopType 在 <body> 掛上 shop-dewu。
   預設隱藏（而不是預設顯示再隱藏）：萬一 shopType 抓失敗，一般商家看到的是少東西，
   而不是一堆按了會壞的得物功能。
   注意：行內文字要用 .dewu-inline，不要在 .dewu-only 上加 style="display:inline" ——
   inline style 的優先權高過 class，那樣寫等於永遠顯示，隱藏根本不會生效。 */
.dewu-only { display: none; }
.dewu-inline { display: none; }
body.shop-dewu .dewu-only { display: block; }
body.shop-dewu .dewu-inline { display: inline; }
body.shop-dewu .set-card.dewu-only { display: flex; }
body.shop-dewu th.dewu-only, body.shop-dewu td.dewu-only { display: table-cell; }

/* ===== 上架選圖 ===== */
.d-img { position: relative; cursor: pointer; border-radius: 8px; border: 2px solid transparent; }
.d-img img { display: block; width: 64px; height: 64px; object-fit: cover; border-radius: 6px; }
.d-img.on { border-color: var(--pink); }
.d-img:not(.on) img { opacity: .45; }
.d-img-badge { position: absolute; top: -6px; left: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--pink); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.sel-bar .sel-info { font-size: 13px; }
.sel-bar .sel-info b { color: #4ade80; font-size: 15px; }
.sel-bar select { font: inherit; font-size: 13px; padding: 5px 8px; border-radius: var(--r-sm); border: 1px solid #5a4862; background: var(--ink-2); color: #fff; }
@media (max-width: 820px) {
  .sel-bar { left: 50%; flex-wrap: wrap; justify-content: center; max-width: 94vw; }
}

/* ===== 左側分組選單版面 ===== */
body.has-sidebar { padding-left: 216px; }
body.has-sidebar .topbar { display: none; }
.sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 216px; background: var(--ink); color: var(--ink-text); display: flex; flex-direction: column; overflow-y: auto; z-index: 50; }
.sb-brand { display: flex; align-items: center; gap: 10px; padding: 20px 20px 14px; }
.sb-brand .sb-logo { width: 32px; height: 32px; display: inline-flex; font-size: 0; flex-shrink: 0; }
.sb-brand .sb-logo svg { width: 32px; height: 32px; }
.sb-brand b { color: #fff; font-size: 15px; font-weight: 600; display: block; line-height: 1.2; }
.sb-brand small { color: var(--ink-muted); font-size: 12px; }
.sb-nav { flex: 1; padding: 0 12px 12px; }
.sb-group { font-size: 12px; color: var(--ink-muted); padding: 16px 10px 6px; }
.sb-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; margin: 1px 0; border-radius: 8px; color: var(--ink-text); text-decoration: none; font-size: 14px; }
.sb-item:hover { background: var(--ink-2); color: #fff; }
.sb-item.active { background: var(--ink-3); color: #fff; font-weight: 600; }
.sb-item.active::after { content: ""; margin-left: auto; width: 6px; height: 6px; border-radius: 3px; background: var(--pink); flex-shrink: 0; }
.sb-ic { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; font-size: 0; flex-shrink: 0; }
.sb-ic svg { width: 18px; height: 18px; }
.sb-foot { padding: 14px 20px 18px; border-top: 1px solid var(--ink-line); font-size: 13px; color: var(--ink-muted); }
.sb-logout { margin-top: 10px; width: 100%; height: 36px; border: 1px solid #4a3a52; background: transparent; color: var(--ink-text); border-radius: 8px; font: inherit; font-size: 13px; cursor: pointer; }
.sb-logout:hover { background: var(--ink-2); color: #fff; }
.sb-foot .pill { background: var(--ink-2); color: var(--ink-text); padding: 3px 9px; border-radius: 999px; font-weight: 600; }
.sb-foot .pill.live { background: #173a2a; color: #5fe39a; }

/* 手機：側欄收成「☰」，從左邊滑出（gate.js 建 .mtop 與 .sb-scrim）。原本是整塊堆在頁面最上面，佔掉整個第一屏。 */
.mtop, .sb-scrim { display: none; }
@media (max-width: 820px) {
  body.has-sidebar { padding-left: 0; padding-top: 56px; }
  .mtop { display: flex; align-items: center; gap: 10px; position: fixed; top: 0; left: 0; right: 0; height: 56px; padding: 0 12px 0 6px; background: var(--ink); color: #fff; z-index: 45; }
  .mtop b { font-size: 15px; font-weight: 600; }
  .mtop-logo svg { width: 28px; height: 28px; display: block; }
  .mtop-btn { width: 44px; height: 44px; border: 0; border-radius: 8px; background: transparent; color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
  .mtop-btn:hover { background: var(--ink-2); }
  .mtop-btn svg { width: 22px; height: 22px; }
  .sidebar { width: min(280px, 86vw); transform: translateX(-100%); transition: transform .2s ease; z-index: 60; }
  body.sb-open .sidebar { transform: none; box-shadow: 8px 0 30px rgba(0,0,0,.25); }
  body.sb-open .sb-scrim { display: block; position: fixed; inset: 0; background: rgba(36,24,42,.5); z-index: 55; }
  body.sb-open { overflow: hidden; }
  .sel-bar { left: 50%; }
}
@media (max-width: 820px) and (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }

/* ===== 貨態分頁重排（2026/08/24）===== */
/* 分頁改換行：八個分頁在窄螢幕會折成兩行，不再水平捲動把最後幾個藏起來 */
.tabs { flex-wrap: wrap; overflow-x: visible; padding: 0 16px; align-items: center; }
.tab.todo { color: var(--green); }
.tab.todo .cnt { color: var(--green); font-weight: 600; }
.tab.todo.active { color: var(--pink); }
.tab.todo.active .cnt { color: var(--pink); }
.tab-note { margin-left: auto; align-self: center; font-size: 12.5px; color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: var(--r-sm); }
.tab-note:hover { color: var(--text); background: #f2f4f6; }

.b-pending_purchase { background: #eef0f2; color: var(--muted); }
.b-awaiting_dewu_ship { background: #eef3ff; color: var(--blue); }
.b-dewu_shipping { background: #fff3df; color: var(--amber); }
.b-at_warehouse { background: #e7f7ee; color: var(--green); }
.b-at_momo_cn { background: #e6f5fa; color: #0e7f9c; }
/* 例外拆回三欄：退貨要處理、取消不用動、異常要查，顏色要分得出來 */
.b-returned { background: #fbeee0; color: #b5651d; }
.b-cancelled { background: #eef0f2; color: var(--muted); }
.b-error { background: #fce8e8; color: var(--red); }

/* 進度條：分頁只是篩選，這條才看得出單卡在哪一段 */
.row .step { grid-column: 1 / -1; display: flex; margin: 4px 0 0; padding-top: 12px; border-top: 1px dashed var(--line); }
.row .step .n { display: flex; flex-direction: column; align-items: center; flex: 1; position: relative; min-width: 0; }
.row .step .n::before { content: ""; position: absolute; top: 6px; left: -50%; width: 100%; height: 2px; background: var(--line); }
.row .step .n:first-child::before { display: none; }
.row .step .n.done::before, .row .step .n.cur::before { background: var(--pink); }
.row .step .d { width: 14px; height: 14px; border-radius: 99px; background: #dfe3e8; border: 2px solid #dfe3e8; position: relative; z-index: 1; }
.row .step .n.done .d { background: var(--pink); border-color: var(--pink); }
.row .step .n.cur .d { background: #fff; border-color: var(--pink); box-shadow: 0 0 0 3px #fce4f2; }
.row .step .t { font-size: 10.5px; color: var(--muted); margin-top: 5px; text-align: center; line-height: 1.35; }
.row .step .n.done .t { color: var(--text); }
.row .step .n.cur .t { color: var(--pink); font-weight: 600; }
/* 例外：走到哪算哪，用灰紅色標示，不要假裝還在往前跑 */
.row .step.ex .n.done::before, .row .step.ex .n.cur::before { background: #e7b9b9; }
.row .step.ex .n.done .d { background: #cfa3a3; border-color: #cfa3a3; }
.row .step.ex .n.cur .d { border-color: var(--red); box-shadow: 0 0 0 3px #fbe3e3; }
.row .step.ex .n.cur .t { color: var(--red); }

@media (max-width: 900px) { .row .step .t { font-size: 9.5px; } }

/* ===== 業績趨勢圖（2026/08/26 重做）=====
   原本只有一條線：沒有 y 軸刻度、沒有互動，看不出那根尖峰值多少；
   x 軸中間還放了「每日營收」四個字，讀起來像一個資料點。 */
.db-area { position: relative; }
.db-maxline { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed var(--line); pointer-events: none; }
.db-maxlab { position: absolute; left: 0; font-size: 11px; color: var(--muted); background: var(--card); padding: 0 5px 0 0; transform: translateY(-50%); pointer-events: none; font-variant-numeric: tabular-nums; }
.db-cross { position: absolute; top: 0; bottom: 0; width: 1px; background: #e6e8ec; opacity: 0; pointer-events: none; }
.db-dot { position: absolute; width: 9px; height: 9px; margin: -5px 0 0 -5px; border-radius: 50%; background: #fff; border: 2px solid var(--pink); opacity: 0; pointer-events: none; }
.db-tip { position: absolute; z-index: 3; background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.10);
  padding: 7px 10px; font-size: 12px; line-height: 1.6; white-space: nowrap; pointer-events: none; transform: translate(-50%, -114%); }
.db-tip b { font-size: 13px; font-variant-numeric: tabular-nums; }
.db-tip .d { color: var(--muted); font-size: 11px; }

/* ── 單品上架：逐尺碼改價 ── */
.price-basis { font-size: 12px; color: var(--muted); margin: 2px 0 8px; line-height: 1.6; }
.price-basis b { color: var(--text); }
.price-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px; background: #fafbfc; border: 1px solid var(--line); border-radius: 8px; font-size: 12px; color: var(--muted); }
.price-tools label { display: inline-flex; align-items: center; gap: 4px; }
.price-tools input { width: 70px; font: inherit; font-size: 12px; padding: 4px 6px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.price-tools .pt-sep { width: 1px; height: 18px; background: var(--line); margin: 0 2px; }
.sku-table.price-edit td { vertical-align: middle; }
.sku-table.price-edit th { white-space: nowrap; }
.sku-table.price-edit input { width: 64px; }
.sku-table.price-edit .pcell { white-space: nowrap; }
.sku-table.price-edit tr.p-man input.np { border-color: var(--blue); background: #f3f7fe; }
.sku-table.price-edit tr.p-loss { background: #fff4f4; }
.sku-table.price-edit tr.p-loss input.np { border-color: var(--red); color: var(--red); }
.sku-table .neg-txt { color: var(--red); font-weight: 600; }
.ptag { display: inline-block; font-size: 10.5px; line-height: 1; padding: 3px 5px; border-radius: 4px; margin-left: 4px; vertical-align: 1px; }
.ptag.man { background: #e8f0fd; color: var(--blue); }
.ptag.loss { background: #fde8e8; color: var(--red); }
.ptag.lock { background: #f1ecfb; color: var(--purple); }
.pbtn { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 13px; padding: 0 2px; }
.pbtn:hover { color: var(--text); }
.price-summary { font-size: 12.5px; color: var(--muted); margin: 8px 0 4px; }
.price-summary b { color: var(--text); }
.lock-opt { display: flex; align-items: flex-start; gap: 6px; font-size: 12px; color: var(--muted); margin: 6px 0 12px; cursor: pointer; }
.pcard .pest { font-size: 12px; color: var(--pink-dark); font-weight: 600; margin-top: 2px; }
body.mode-single .pcard-chk { display: none; }

/* ── 批量上架背景任務 ── */
.job-panel { margin: 12px 22px 0; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.job-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }
.job-head .job-sp { flex: 1; }
.job-bar { height: 8px; background: #eef0f2; border-radius: 6px; overflow: hidden; margin: 10px 0 6px; }
.job-bar > div { height: 100%; width: 0; background: var(--pink); border-radius: 6px; transition: width .4s; }
.job-bar > div.paused { background: var(--amber); }
.job-reason { font-size: 12.5px; color: var(--red); margin: 4px 0; }
.job-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; padding: 8px 10px; background: #fffaf0; border: 1px solid #f0d59a; border-radius: 8px; margin: 6px 0; }
.job-opts select { font: inherit; font-size: 12px; padding: 4px 6px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.job-list { max-height: 260px; overflow-y: auto; margin-top: 6px; }
/* class 的 display 會蓋掉 hidden 屬性（BACKLOG #103）—— 面板裡的區塊一律讓 hidden 說了算 */
.job-panel [hidden], .job-panel[hidden] { display: none !important; }
.it-status { font-size: 13px; padding: 10px 12px; background: #fafbfc; border: 1px solid var(--line); border-radius: 8px; margin: 6px 0 10px; }
.it-usage { font-size: 12.5px; color: var(--text); margin: 4px 0 6px; }
#itControls[hidden] { display: none !important; }

/* ── 確認要翻譯的圖 ── */
.rv-bar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 22px; background: var(--card); border-bottom: 1px solid var(--line); font-size: 13px; }
.rv-bar[hidden] { display: none !important; }
.rv-bar .rv-sp { flex: 1; }
.rv-prog { width: 160px; height: 6px; background: #eef0f2; border-radius: 4px; overflow: hidden; }
.rv-prog > div { height: 100%; width: 0; background: var(--pink); transition: width .4s; }
.rv-chk { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); cursor: pointer; }
.rv-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; margin: 10px 0; }
.rv-title { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.rv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.rv-img { position: relative; border: 2px solid var(--line); border-radius: 8px; overflow: hidden; cursor: pointer; background: #fafafa; aspect-ratio: 1; }
.rv-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rv-img.on { border-color: var(--pink); box-shadow: 0 0 0 2px #fdeef6; }
.rv-img.changed { outline: 2px dashed var(--blue); outline-offset: 1px; }
.rv-img.dis { cursor: default; opacity: .55; }
.rv-tick { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 1px solid var(--line); color: transparent; font-size: 13px; line-height: 20px; text-align: center; }
.rv-img.on .rv-tick { background: var(--pink); border-color: var(--pink); color: #fff; }
.rv-b { position: absolute; left: 0; right: 0; bottom: 0; font-size: 11px; padding: 3px 6px; background: rgba(255,255,255,.92); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rv-item .rv-title .rv-b { position: static; display: inline; background: none; }
.rv-b.need { color: var(--pink-dark); font-weight: 600; }
.rv-b.unk { color: var(--amber); }
.rv-b.done { color: var(--green); }
.rv-banner { margin: 12px 22px 0; padding: 10px 14px; background: #fffaf0; border: 1px solid #f0d59a; border-radius: var(--r-sm); font-size: 13px; }
.rv-banner[hidden] { display: none !important; }

/* ── 同款不同色合併確認 ── */
.mg-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(15,20,30,.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.mg-box { background: var(--card); border-radius: var(--r-lg); width: min(720px, 100%); max-height: 86vh; display: flex; flex-direction: column; padding: 18px 20px; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.mg-h { font-size: 16px; font-weight: 700; }
.mg-sub { font-size: 12px; color: var(--muted); margin: 6px 0 10px; }
.mg-list { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.mg-g { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; font-size: 13px; }
.mg-m { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.mg-m span { display: inline-flex; align-items: center; gap: 6px; background: #fafbfc; border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px 3px 3px; font-size: 12px; }
.mg-m img { width: 32px; height: 32px; object-fit: cover; border-radius: 6px; }
.mg-m i { font-style: normal; color: var(--muted); font-size: 11px; }
.mg-act { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.sel-bar .btn, .sel-bar .sel-info { white-space: nowrap; }

/* ===== 開關與設定選項列（2026/10）=====
   設定頁的布林選項一律用「標題＋說明｜開關」一列，跟下面維護工具的 dt-row 同一種排法。
   開關就是原生 checkbox（appearance:none 畫成滑動開關），id／checked／change 事件都照舊。 */
.switch { appearance: none; -webkit-appearance: none; flex-shrink: 0; position: relative; width: 40px; height: 24px; margin: 0; border-radius: 12px; background: #cfcad4; cursor: pointer; transition: background .15s; }
.switch::before { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(30,26,34,.3); transition: transform .15s; }
.switch:checked { background: var(--pink); }
.switch:checked::before { transform: translateX(16px); }
.switch:disabled { opacity: .45; cursor: default; }
.switch:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
.opt-list { border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; }
.opt { display: flex; align-items: center; gap: 20px; padding: 14px 16px; cursor: pointer; }
.opt + .opt { border-top: 1px solid var(--line); }
.opt:hover { background: #fcfbfd; }
.opt-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.opt-t b { font-size: 14px; font-weight: 600; color: var(--text); }
.opt-t > span { font-size: 13px; color: var(--muted); line-height: 1.6; }
@media (prefers-reduced-motion: reduce) { .switch, .switch::before { transition: none; } }

/* 一般 checkbox 跟主色走 */
input[type=checkbox] { accent-color: var(--pink); }

/* ===== 共用小工具 ===== */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.badge { white-space: nowrap; }
.dropdown { position: relative; display: inline-block; }
.dropdown-menu { position: absolute; top: calc(100% + 4px); right: 0; z-index: 50; background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: 0 10px 30px rgba(30,26,34,.12); padding: 6px; min-width: 210px; display: flex; flex-direction: column; }
.ddi { display: block; text-align: left; background: none; border: 0; padding: 9px 12px; border-radius: var(--r-sm); font: inherit; font-size: 14px; color: var(--text); cursor: pointer; text-decoration: none; white-space: nowrap; }
.ddi:hover { background: var(--hover); }
.ddi.danger { color: var(--red); }
.ddi:disabled { opacity: .5; cursor: default; }
.dd-sep { height: 1px; background: var(--line); margin: 5px 4px; }

/* ===== 商品管理（2026/10 改版）===== */
.pm { max-width: 1320px; margin: 0 auto; padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 18px; }
.pm-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.pm-head h1 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -.2px; }
.pm-head p { margin: 4px 0 0; color: var(--muted); }
.pm-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pm-prog-t { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.pm-prog-bar { height: 8px; background: #ebe8ee; border-radius: 5px; overflow: hidden; }
.pm-prog-bar > div { height: 100%; width: 0; background: var(--pink); transition: width .2s; }
.pm-debug { font-size: 13px; color: var(--muted); }
.pm-debug textarea { width: 100%; height: 120px; margin-top: 4px; font-size: 12px; font-family: var(--mono); border: 1px solid var(--line); border-radius: 8px; padding: 8px; }

.pm-panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.pm-tabs { padding: 0 12px; }
.pm-tabs .tab { height: 48px; padding: 0 12px; }
.pm-tabs .tab .cnt { margin-left: 2px; }
.pm-tabs .tab.active .cnt { color: var(--pink); }
.pm-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px 16px; }
.pm-filters select, .pm-filters input[type=number], .pm-size select { font: inherit; font-size: 14px; height: 38px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--text); }
.pm-filters select { max-width: 180px; }
.pm-filters input:focus, .pm-filters select:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px var(--pink-tint); }
.pm-search { flex: 1 1 280px; min-width: 220px; position: relative; display: flex; align-items: center; color: var(--faint); }
.pm-search svg { position: absolute; left: 12px; pointer-events: none; }
.pm-search input { width: 100%; font: inherit; font-size: 14px; height: 38px; padding: 0 12px 0 36px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--text); }
.pm-range { display: inline-flex; align-items: center; gap: 6px; color: var(--faint); }
.pm-range input { width: 108px; }
.pm-fsum { font-size: 13px; color: var(--muted); padding: 0 16px 12px; margin-top: -4px; }
.pm-fsum:empty { display: none; }

.pm-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; background: var(--ink); color: #fff; }
.pm-bulk-n { font-weight: 600; margin-right: 8px; }
.pm-bulk .btn { background: var(--ink-2); border-color: #5a4862; color: #fff; }
.pm-bulk .btn:hover { background: var(--ink-3); }
.pm-bulk .pm-bulk-del { background: transparent; border-color: #8c3a44; color: #ffb4b4; }
.pm-sp { flex: 1; }

.pm-table { position: relative; overflow-x: auto; border-top: 1px solid var(--line); }
.pm-table table { min-width: 960px; }
.pm-table th, .pm-table td { vertical-align: middle; }
.pm-table th.chk, .pm-table td.chk { width: 44px; padding-left: 16px; padding-right: 0; text-align: left; }
.pm-table .chk input { width: 16px; height: 16px; }
.pm-table .num { text-align: right; white-space: nowrap; }
.pm-table .act { padding-right: 16px; }
.pm-goods { display: flex; align-items: center; gap: 12px; min-width: 280px; }
.pm-thumb img, .pm-thumb .ph { width: 52px; height: 52px; border-radius: 8px; border: 1px solid var(--line); background: #f1eff3; object-fit: cover; display: flex; align-items: center; justify-content: center; color: #b5adbc; }
.pm-gt { min-width: 0; }
.pm-gt .goods-name { line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pm-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; margin-top: 3px; font-size: 13px; color: var(--muted); }
.pm-price { font-size: 15px; font-weight: 600; }
.pm-sub { font-size: 13px; color: var(--muted); }
.pm-note { font-size: 13px; color: #8a6a00; }
.pm-loss { margin-top: 6px; font-size: 13px; color: #9a1f16; }
.pm-st { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.pm-st::before { content: ""; width: 8px; height: 8px; border-radius: 4px; box-sizing: border-box; }
.pm-st.on { color: #0e5a3e; } .pm-st.on::before { background: #16a06a; }
.pm-st.draft { color: #6e4300; } .pm-st.draft::before { border: 2px solid #c98a00; }
.pm-st.off { color: var(--muted); } .pm-st.off::before { background: #b5adbc; }
.pm-acts { display: flex; justify-content: flex-end; align-items: center; gap: 6px; }
.pm-more { position: relative; }
.pm-more summary { list-style: none; width: 32px; padding: 0; }
.pm-more summary::-webkit-details-marker { display: none; }
.pm-more[open] summary { background: var(--hover); }
.pm-more-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 150px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: 0 10px 30px rgba(30,26,34,.12); padding: 6px; display: flex; flex-direction: column; }
.pm-empty { padding: 56px 24px; text-align: center; color: var(--muted); }

/* 尺碼格 */
.sz-strip { display: flex; flex-wrap: wrap; gap: 4px; min-width: 210px; max-width: 320px; }
.sz { position: relative; min-width: 38px; height: 40px; padding: 0 6px; border-radius: var(--r-sm); display: inline-flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; cursor: default; }
.sz b { font-size: 11px; font-weight: 400; white-space: nowrap; }
.sz i { font-style: normal; font-size: 13px; font-weight: 600; }
.sz.ok { background: #e5f2ec; color: #0e5a3e; }
.sz.low { background: #fbebc9; color: #6e4300; }
.sz.out { background: #f1f0f2; color: var(--faint); }
.sz.out i { font-weight: 400; text-decoration: line-through; }
.sz.loss { background: #fde5e2; color: #9a1f16; box-shadow: inset 0 0 0 1.5px #c9372c; }
.sz.lock::after { content: ""; position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 5px; background: var(--purple); border: 2px solid #fff; }

.pm-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.pm-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.pm-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sz-k { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sz-k.ok { background: #e5f2ec; } .sz-k.low { background: #fbebc9; } .sz-k.out { background: #f1f0f2; }
.sz-k.lockdot { width: 10px; height: 10px; border-radius: 5px; background: var(--purple); }
.sz-k.loss { background: #fde5e2; box-shadow: inset 0 0 0 1.5px #c9372c; }
.pm-pager { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.pm-size { display: inline-flex; align-items: center; gap: 6px; }
.pm-size select { height: 32px; }
.pm-pager .pager { margin: 0; }

@media (max-width: 820px) {
  .pm { padding: 20px 16px 40px; }
  .pm-filters select { max-width: none; flex: 1 1 140px; }
}

/* ===== 商品圖一律完整顯示，不裁切（2026/10）=====
   原本是 object-fit: cover（裁切填滿）：襪子、衛衣這種直式圖沒事，
   但鞋子是橫的，鞋頭鞋跟會被切掉。得物圖本身是白底，改成 contain 再補白底，看起來跟裁切版一樣滿。 */
.pimg img, .pimg .ph { height: auto; aspect-ratio: 1 / 1; }
.pimg img, .c-thumb img, .d-imgs img, .d-img img, .tp-img, .rv-img img, .mg-m img, .pm-thumb img { object-fit: contain; background: #fff; }
.single-cat { font: inherit; font-size: 13px; padding: 9px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; max-width: 300px; }

/* ===== 提示條（util.js 的 pmgToast）===== */
.toast { display: flex; align-items: flex-start; gap: 14px; line-height: 1.5; }
.toast-msg { user-select: text; word-break: break-word; }
.toast.err { padding-right: 10px; }
.toast-x { flex-shrink: 0; width: 28px; height: 28px; margin: -4px -2px -4px 0; border: 0; border-radius: var(--r-sm); background: rgba(255,255,255,.18); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; }
.toast-x:hover { background: rgba(255,255,255,.32); }

/* ===== 確認視窗（util.js 的 pmgConfirm／pmgPrompt）===== */
.pmg-dlg-bg { position: fixed; inset: 0; z-index: 9000; background: rgba(36,24,42,.45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.pmg-dlg { width: min(440px, 100%); background: #fff; border-radius: var(--r-lg); padding: 22px 22px 18px; box-shadow: 0 20px 60px rgba(30,26,34,.3); }
.pmg-dlg h2 { margin: 0 0 8px; font-size: 17px; font-weight: 600; }
.pmg-dlg.danger h2 { color: var(--red); }
.pmg-dlg-msg { margin: 0; white-space: pre-line; line-height: 1.7; color: #3d3644; max-height: 50vh; overflow: auto; }
.pmg-dlg-input { width: 100%; margin-top: 12px; font: inherit; font-size: 14px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 8px; resize: vertical; }
.pmg-dlg-input:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px var(--pink-tint); }
.pmg-dlg-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.btn.danger-solid { background: var(--red); border-color: var(--red); color: #fff; font-weight: 500; }
.btn.danger-solid:hover { background: #a82c23; border-color: #a82c23; }
.toast-act { flex-shrink: 0; margin: -4px 0; padding: 0 10px; height: 28px; border: 0; border-radius: var(--r-sm); background: rgba(255,255,255,.2); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.toast-act:hover { background: rgba(255,255,255,.34); }

/* ===== 讀取中（2026/10）===== */
.pmg-loadbar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 9500; pointer-events: none; opacity: 0; transition: opacity .2s; background: linear-gradient(90deg, transparent 0%, var(--pink) 30%, var(--pink) 70%, transparent 100%) no-repeat; background-size: 40% 100%; }
.pmg-loadbar.on { opacity: 1; animation: pmg-load 1.1s ease-in-out infinite; }
@keyframes pmg-load { from { background-position: -40% 0; } to { background-position: 140% 0; } }
.is-loading { opacity: .5; pointer-events: none; transition: opacity .15s; }
.sk-b { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, #eeecf0 25%, #f6f5f7 50%, #eeecf0 75%); background-size: 200% 100%; animation: pmg-sk 1.3s linear infinite; }
@keyframes pmg-sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
tr.sk td { vertical-align: middle; }
.order-sk { display: grid; grid-template-columns: 220px 84px 1fr; gap: 16px; align-items: center; background: var(--card); border: 1px solid var(--line); border-top: none; padding: 16px; }
.order-sk:first-child { border-top: 1px solid var(--line); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.order-sk:last-child { border-radius: 0 0 var(--r-lg) var(--r-lg); }
@media (prefers-reduced-motion: reduce) { .pmg-loadbar.on, .sk-b { animation: none; } }
.trial-ban { position: fixed; top: 0; left: 216px; right: 0; z-index: 44; background: var(--red); color: #fff; padding: 9px 16px; font-size: 13px; font-weight: 600; text-align: center; }
body.has-trial-ban { padding-top: 38px; }
@media (max-width: 820px) { .trial-ban { left: 0; top: 56px; } body.has-sidebar.has-trial-ban { padding-top: 94px; } }

/* ===== 上架工具頁（單品／批量）版面（2026/10）===== */
.lst-head { padding: 24px 32px 0; max-width: 1320px; }
.lst-head h1 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -.2px; }
.lst-head p { margin: 4px 0 0; color: var(--muted); max-width: 72ch; }
.lst-panel { margin: 18px 32px 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; gap: 14px; }
.lst-in { flex: 1 1 320px; max-width: 560px; display: flex; }
.lst-in .search { width: 100%; min-width: 0; }
.lst-in.sm { flex: 1 1 220px; max-width: 300px; }
.lst-adv { border-top: 1px dashed var(--line); padding-top: 12px; }
.lst-adv summary { cursor: pointer; color: var(--muted); font-size: 14px; width: fit-content; }
.lst-adv summary b { color: var(--text); font-weight: 500; }
.lst-adv[open] summary { margin-bottom: 10px; }
.lst-adv-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.lst-adv-row select { font: inherit; font-size: 14px; height: 38px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--text); max-width: 260px; }
.lst-hint { margin: 8px 0 0; font-size: 13px; color: var(--muted); }

.lst-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 12px 32px 0; padding: 10px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; font-size: 14px; color: #3d3644; }
.lst-f-label { font-size: 13px; color: var(--muted); }
.lst-f-group { display: inline-flex; gap: 8px; }
.lst-filter select { font: inherit; font-size: 14px; height: 34px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--text); max-width: 200px; }
.lst-chk { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; }
.lst-chk input { width: 16px; height: 16px; margin: 0; }
.lst-price { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; color: var(--muted); }
.lst-price input { width: 76px; font: inherit; font-size: 14px; height: 34px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 8px; color: var(--text); }
.lst-count { font-size: 13px; color: var(--muted); }
body.mode-single .brand-only { display: none !important; }
/* 單品模式的搜尋列跟批量的卡片對齊 */
#singleBar { margin: 18px 32px 0; border: 1px solid var(--line); border-radius: 12px; }
body:has(.lst-head) main { max-width: none; padding: 16px 32px 60px; }
#scanBar, #rvBanner, .job-panel, #bulkResults { margin-left: 32px !important; margin-right: 32px !important; }
@media (max-width: 820px) {
  .lst-head { padding: 18px 16px 0; }
  .lst-panel, .lst-filter, #singleBar { margin-left: 16px; margin-right: 16px; }
  body:has(.lst-head) main { padding: 16px 16px 60px; }
  #scanBar, #rvBanner, .job-panel, #bulkResults { margin-left: 16px !important; margin-right: 16px !important; }
}
/* 單品抽屜：同款其他配色 */
.sib-wrap { margin: 10px 0 6px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: var(--r-sm); background: var(--hover); }
.sib-list { display: flex; flex-wrap: wrap; gap: 8px; }
.sib { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px 4px 6px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--card); cursor: pointer; font-size: 12px; max-width: 220px; }
.sib img { width: 36px; height: 36px; object-fit: contain; background: #fff; border-radius: 5px; }
.sib-t { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.sib-t b, .sib-t small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sib-t small { color: var(--muted); font-size: 12px; }
.sib.on { border-color: var(--pink); }
.sib.main { border-color: var(--pink); background: var(--pink-tint); cursor: default; }
.sib.dis { opacity: .55; cursor: not-allowed; }
.sib-ex { font-size: 10.5px; color: var(--amber); }

/* ===== 設定頁頁首與卡片（2026/10）===== */
main.set-main { max-width: 880px; margin: 0; padding: 24px 32px 60px; }
.set-head { margin-bottom: 20px; }
.set-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.set-crumb a { color: var(--muted); text-decoration: none; padding: 2px 0; }
.set-crumb a:hover { color: var(--pink); text-decoration: underline; }
.set-crumb [aria-current] { color: var(--text); }
.set-crumb-sep { color: var(--faint); }
.set-head h1 { margin: 0; font-size: 24px; font-weight: 600; letter-spacing: -.2px; }
.set-head p { margin: 4px 0 0; color: var(--muted); max-width: 64ch; }
.set-head p:empty { display: none; }
/* 內頁的卡片標題跟頁首大標題重複了，收掉（「得物商家專用」改寫在頁首說明裡） */
.setting-panel > h2:first-child { display: none; }
.set-card { min-height: 84px; }
.set-card::after { content: "›"; margin-left: auto; padding-left: 8px; font-size: 22px; line-height: 1; color: var(--faint); }
.set-card:hover::after { color: var(--pink); }
.set-card:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
@media (max-width: 820px) { main.set-main { padding: 18px 16px 48px; } }
.setting-panel > h2:first-child + * { margin-top: 0; }
/* 單品抽屜：商詳圖簡轉繁逐張控制 */
.tr-wrap { margin: 10px 0 6px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: var(--r-sm); }
.tr-list { display: flex; flex-wrap: wrap; gap: 10px; }
.tr-card { width: 96px; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; border: 1.5px solid var(--line); border-radius: 8px; background: var(--card); font-size: 11.5px; }
.tr-card.on { border-color: var(--pink); }
.tr-img { position: relative; }
.tr-img img { width: 80px; height: 80px; object-fit: contain; background: #fff; border-radius: 6px; display: block; }
.tr-tw { position: absolute; right: 3px; bottom: 3px; background: var(--pink); color: #fff; font-size: 10px; font-weight: 700; padding: 0 4px; border-radius: 4px; }
.tr-st { padding: 1px 6px; border-radius: 8px; background: var(--hover); color: var(--muted); white-space: nowrap; }
.tr-st.needs { background: var(--pink-tint); color: var(--pink-dark); }
.tr-st.none { background: color-mix(in srgb, var(--green) 10%, var(--card)); color: var(--green); }
.tr-st.unk { background: color-mix(in srgb, var(--amber) 10%, var(--card)); color: var(--amber); }
.tr-st.done { background: color-mix(in srgb, var(--blue) 10%, var(--card)); color: var(--blue); }
.tr-ck { display: inline-flex; gap: 4px; align-items: center; cursor: pointer; }
.tr-pv { padding: 2px 8px !important; font-size: 11px !important; }
.tr-modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.tr-modal-box { background: var(--card); border-radius: 12px; padding: 14px; max-width: 980px; width: 100%; max-height: 92vh; overflow: auto; }
.tr-modal-h { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.tr-modal-h .close { margin-left: auto; border: none; background: none; font-size: 22px; cursor: pointer; }
.tr-cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tr-cmp figure { margin: 0; }
.tr-cmp img { width: 100%; border-radius: 8px; border: 1px solid var(--line); }
.tr-cmp figcaption { text-align: center; font-size: 12px; color: var(--muted); margin-top: 4px; }
@media (max-width: 640px) { .tr-cmp { grid-template-columns: 1fr; } }
/* 單品抽屜：標題輔助 */
.title-assist { margin: -4px 0 10px; font-size: 12px; color: var(--muted); line-height: 1.7; }
.title-assist .ta-len { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text); }
.title-assist .ta-len.near { color: var(--amber); }
.title-assist .ta-len.over { color: var(--red); }
.title-assist .ta-warn { color: var(--pink-dark); }
.title-assist .ta-sep { margin: 0 4px; color: var(--faint); }
.title-assist .linkbtn { border: none; background: none; padding: 0; color: var(--pink); cursor: pointer; font-size: 12px; text-decoration: underline; }
/* 單品抽屜：圖片排序＋主圖預覽 */
.img-pick { display: flex; gap: 12px; align-items: flex-start; margin: 8px 0 4px; }
.img-main { flex: 0 0 132px; position: relative; border: 2px solid var(--pink); border-radius: var(--r-sm); overflow: hidden; background: var(--hover); }
.img-main img { display: block; width: 128px; height: 128px; object-fit: contain; background: #fff; }
.img-main span { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; text-align: center; padding: 2px 0; }
.d-img[draggable="true"] { cursor: grab; }
.d-img.dragging { opacity: .4; }
.d-img.drop-to { outline: 2px dashed var(--pink); outline-offset: 2px; }
.d-img.over6 img { opacity: .35; }
.d-img-badge.over { background: var(--faint); }
.d-img-main { position: absolute; left: 2px; right: 2px; bottom: 2px; border: none; border-radius: 4px; background: rgba(0,0,0,.6); color: #fff; font-size: 10px; padding: 1px 0; cursor: pointer; opacity: 0; transition: opacity .12s; }
.d-img:hover .d-img-main, .d-img:focus-within .d-img-main { opacity: 1; }
@media (hover: none) { .d-img-main { opacity: 1; } }
@media (max-width: 520px) { .img-pick { flex-direction: column; } }
.tr-engine { margin: 0 0 8px; padding: 6px 10px; border-radius: 8px; font-size: 12px; background: color-mix(in srgb, var(--amber) 10%, var(--card)); color: var(--amber); }
.rv-old { position: absolute; left: 6px; top: 6px; font-size: 10.5px; padding: 1px 6px; border-radius: var(--r-sm); background: color-mix(in srgb, var(--blue) 12%, var(--card)); color: var(--blue); }
.tr-cached { font-size: 10.5px; color: var(--blue); }
/* 設定頁：判斷學習清單 */
.lr-sec { margin: 6px 0; }
.lr-sec summary { cursor: pointer; font-size: 13px; }
.lr-list { list-style: none; margin: 4px 0 0; padding: 0; max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.lr { display: flex; gap: 10px; align-items: center; padding: 5px 10px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.lr:last-child { border-bottom: none; }
.lr.off { opacity: .5; }
.lr-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lr-n, .lr-s { color: var(--muted); white-space: nowrap; }
.it-usage .linkbtn { border: none; background: none; padding: 0; color: var(--pink); cursor: pointer; font-size: 12px; text-decoration: underline; }
/* 同款合併：手動 */
.sib-c { cursor: text; border-bottom: 1px dashed transparent; }
.sib-c:hover { border-bottom-color: var(--muted); }
.sib-man { margin-left: 4px; font-size: 10px; color: var(--blue); }
.sib-add { margin-top: 8px; }
.pcard { position: relative; }
.pcard-grp { position: absolute; top: 10px; right: 10px; z-index: 2; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: var(--r-sm); background: var(--blue); color: #fff; }
.mg-via { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: var(--r-sm); background: var(--hover); color: var(--muted); }
.mg-via.title { background: color-mix(in srgb, var(--amber) 14%, var(--card)); color: var(--amber); }
.mg-via.manual { background: color-mix(in srgb, var(--blue) 12%, var(--card)); color: var(--blue); }
.mg-g.by-title { border-color: color-mix(in srgb, var(--amber) 45%, var(--line)); }
/* 商品管理：從 momo 刪除（書籤小工具） */
.md-box { width: min(560px, 100%); }
.md-steps { margin: 12px 0 0; padding-left: 20px; line-height: 1.7; font-size: 13.5px; }
.md-steps li { margin-bottom: 10px; }
.md-bm { display: inline-block; margin: 4px 0; padding: 4px 12px; border-radius: 8px; background: var(--red); color: #fff !important; font-weight: 600; text-decoration: none; cursor: grab; }
.md-list { font-family: var(--mono); font-size: 12px; margin: 4px 0; }
/* ===== 商詳圖轉繁頁（img-tr.html） ===== */
.it-paid { font-size: 12px; font-weight: 600; color: var(--purple-text); background: color-mix(in srgb, var(--purple) 10%, var(--card)); padding: 2px 8px; border-radius: 999px; vertical-align: middle; }
.it-tabs { display: flex; gap: 4px; background: var(--hover); padding: 4px; border-radius: var(--r-sm); width: fit-content; max-width: 100%; overflow-x: auto; }
.it-tab { border: none; background: none; padding: 7px 14px; border-radius: 8px; font: inherit; font-size: 13.5px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.it-tab[aria-selected="true"] { background: var(--card); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.it-pane[hidden] { display: none !important; }
.it-urls { width: 100%; box-sizing: border-box; font: inherit; font-size: 13px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 8px; resize: vertical; }
.it-row, .it-act { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.it-sp { flex: 1; }
.it-file { cursor: pointer; }
.it-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin: 10px 0; }
.it-card { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: var(--card); font-size: 12px; min-width: 0; }
.it-card.on { border-color: var(--pink); }
.it-card.done { border-color: var(--green); }
.it-img { position: relative; aspect-ratio: 1 / 1; border-radius: 8px; overflow: hidden; background: #fff; }
.it-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.it-busy { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.75); font-weight: 600; color: var(--pink); }
.it-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.it-card .tr-st { align-self: flex-start; }
.it-err { color: var(--red); font-size: 11.5px; }
.it-ops { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.it-ops .linkbtn, .dr-row .linkbtn { border: none; background: none; padding: 0; color: var(--muted); cursor: pointer; font-size: 11.5px; text-decoration: underline; margin-left: auto; }
.dr-row { border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: 8px; }
.dr-h { display: flex; gap: 12px; align-items: center; padding: 8px 12px; }
.dr-h img { width: 48px; height: 48px; object-fit: contain; background: #fff; border-radius: 6px; border: 1px solid var(--line); }
.dr-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dr-t b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-t small { color: var(--muted); }
.dr-body { padding: 0 12px 10px; border-top: 1px solid var(--line); }
.seg { display: flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.seg-b { flex: 1; border: none; background: var(--card); padding: 4px 0; font: inherit; font-size: 12px; cursor: pointer; color: var(--muted); }
.seg-b + .seg-b { border-left: 1px solid var(--line-strong); }
.seg-b.on { background: var(--pink); color: #fff; font-weight: 600; }
@media (max-width: 640px) { .it-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ===== 側欄待處理數字（gate.js 的 loadNavCounts）===== */
.sb-cnt { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--pink); color: #fff; font-size: 12px; font-weight: 600; line-height: 20px; text-align: center; flex-shrink: 0; }
.sb-cnt.err { background: var(--red); }
.sb-cnt.muted { background: var(--ink-3); color: var(--ink-text); font-weight: 500; }
.sb-item:has(.sb-cnt)::after { display: none; } /* 有數字就不再畫「目前頁」的小圓點 */

/* ===== 總覽：新店開通清單（dashboard.js 的 loadOnboarding）===== */
.ob { background: var(--card); border: 1px solid var(--pink-line); border-radius: var(--r-lg); padding: 20px 22px; }
.ob-head { display: flex; align-items: flex-start; gap: 16px; }
.ob-ttl { flex: 1; min-width: 0; }
.ob-ttl h2 { margin: 0; font-size: 18px; font-weight: 600; }
.ob-ttl p { margin: 4px 0 0; color: var(--muted); }
.ob-meter { font-size: 14px; color: var(--muted); white-space: nowrap; padding-top: 2px; }
.ob-meter b { font-size: 22px; color: var(--pink); font-weight: 600; }
.ob-bar { height: 6px; background: #f1eff3; border-radius: 3px; overflow: hidden; margin: 14px 0 6px; }
.ob-bar > div { height: 100%; width: 0; background: var(--pink); border-radius: 3px; transition: width .4s ease; }
.ob-steps { list-style: none; margin: 0; padding: 0; }
.ob-step { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid #f1eff3; }
.ob-step:first-child { border-top: 0; }
.ob-dot { width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%; border: 1.5px solid var(--line-strong); color: var(--muted); font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.ob-step.next .ob-dot { border-color: var(--pink); color: var(--pink); }
.ob-step.done .ob-dot { border-color: var(--green); background: var(--green); color: #fff; }
.ob-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ob-txt b { font-weight: 600; }
.ob-txt span { font-size: 13px; color: var(--muted); }
.ob-step.done .ob-txt b { color: var(--muted); font-weight: 500; }
.ob-ok { font-size: 13px; color: var(--green); white-space: nowrap; }
@media (max-width: 820px) { .ob { padding: 16px; } .ob-head { flex-wrap: wrap; } .ob-step { flex-wrap: wrap; } .ob-step .btn { margin-left: 42px; } }
@media (prefers-reduced-motion: reduce) { .ob-bar > div { transition: none; } }
a.btn { text-decoration: none; } /* 用 <a> 做的按鈕不要底線 */

/* 採購對帳頁（recon.html）：上方合計卡、單位確認列、明細表裡的來源小字和異常標記、逐筆改成本的展開列 */
.rc-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.rc-kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; }
.rc-kpi span { font-size: 13px; color: var(--muted); }
.rc-kpi b { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.rc-kpi small { font-size: 12px; color: var(--faint); }
.rc-ask { background: var(--pink-tint); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.rc-ask p { margin: 0; flex: 1 1 360px; }
.rc-ask-act { display: flex; gap: 8px; }
.rc-month { font: inherit; font-size: 14px; height: 38px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--text); }
.rc-rate { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.rc-rate input { width: 80px; font: inherit; font-size: 14px; height: 38px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 8px; }
.rc-day { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.rc-ord { display: flex; flex-direction: column; gap: 2px; min-width: 220px; }
.rc-ord span { font-size: 13px; }
.rc-src { display: block; font-size: 11px; color: var(--faint); }
.rc-neg { color: var(--red); }
.rc-flags { display: flex; flex-wrap: wrap; gap: 4px; }
.rc-flag { font-size: 12px; color: var(--amber); white-space: nowrap; }
.rc-flag.bad { color: var(--red); }
.rc-note { font-size: 12px; color: var(--muted); margin-top: 2px; }
.rc-edit td { background: var(--bg); }
.rc-edit-f { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.rc-edit-f label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.rc-edit-f input { font: inherit; font-size: 14px; height: 34px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 8px; width: 120px; }
.rc-edit-note { flex: 1 1 200px; }
.rc-edit-note input { width: 100%; }
.rc-edit .hint { margin: 6px 0 0; font-size: 12px; color: var(--faint); }

/* 換頁過場（全站）：點側欄切頁時，舊頁面留在畫面上直到新頁面畫好再淡入，不會先白一下。
   側欄有自己的名字，兩頁之間原地不動。Chrome／Edge 支援，其他瀏覽器照常換頁。 */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .12s; }
}
@media (min-width: 821px) { .sidebar { view-transition-name: pmg-sidebar; } }

/* 側欄底座（全站，gate.js 一載入就在 <html> 加 .pmg-shell）：選單還沒畫好之前，深色側欄底和版面位置先出現，
   避免露出舊的 .topbar、內容左右跳。真正的 .sidebar 畫好後疊在上面。 */
html.pmg-shell body { padding-left: 216px; }
html.pmg-shell .topbar { display: none; }
html.pmg-shell body::before { content: ""; position: fixed; left: 0; top: 0; bottom: 0; width: 216px; background: var(--ink); z-index: 49; }
@media (max-width: 820px) {
  html.pmg-shell body { padding-left: 0; padding-top: 56px; }
  html.pmg-shell body::before { right: 0; bottom: auto; width: auto; height: 56px; z-index: 44; }
}

/* 共用知識庫審核頁（kb.html）：工具列、有衝突的列要比較醒目 */
.kb-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.kb-conflict { background: var(--pink-tint); }
.kb-note { margin-top: 4px; font-size: 12.5px; color: var(--amber); }

/* 看圖元件（img-viewer.js）：放大、原圖／繁體對照。確認頁、單品抽屜、商詳圖轉繁頁共用 */
.iv-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 1100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.iv-box { background: var(--card); border-radius: 12px; padding: 14px; width: min(1100px, 100%); max-height: 94vh; display: flex; flex-direction: column; }
.iv-h { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.iv-note { font-size: 12.5px; color: var(--muted); }
.iv-seg { display: inline-flex; margin-left: auto; }
.iv-x { margin-left: auto; }
.iv-seg + .iv-x { margin-left: 4px; }
.iv-body { overflow: auto; min-height: 0; }
.iv-one { margin: 0; text-align: center; }
.iv-one img { max-width: 100%; max-height: calc(94vh - 120px); border-radius: 8px; border: 1px solid var(--line); background: #fff; object-fit: contain; }
.iv-flip { cursor: pointer; user-select: none; }
.iv-one figcaption, .iv-side figcaption { font-size: 12px; color: var(--muted); margin-top: 6px; text-align: center; }
.iv-tag { display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 999px; background: var(--line); color: var(--text); font-weight: 600; }
.iv-tag.tw { background: var(--pink-tint); color: var(--pink-dark); }
.iv-side { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.iv-side figure { margin: 0; }
.iv-side img { width: 100%; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
@media (max-width: 640px) { .iv-side { grid-template-columns: 1fr; } .iv-seg { margin-left: 0; } }
.iv-seg { border: 1px solid var(--line-strong); border-radius: var(--r-sm); overflow: hidden; }
.iv-seg .seg-b { flex: none; padding: 6px 12px; font-size: 13px; }

/* 確認要翻譯的圖（review.html）改版：新版頁首＋白底面板、每件商品全翻／全不翻、圖上放大鏡；商品圖完整顯示不裁切 */
.rv-panel .rv-bar { position: sticky; top: 0; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.rv-list { padding: 4px 16px 16px; }
.rv-panel .rv-item { border: none; border-bottom: 1px solid var(--line); border-radius: 0; padding: 12px 0; margin: 0; }
.rv-title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.rv-name { flex: 1 1 260px; min-width: 0; }
.rv-cnt { font-weight: 400; font-size: 12.5px; color: var(--muted); }
.rv-img img { object-fit: contain; background: #fff; }
.rv-zoom { position: absolute; top: 6px; left: 6px; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,.92); color: var(--text); cursor: zoom-in; padding: 0; }
.rv-zoom:hover { border-color: var(--pink); color: var(--pink-dark); }
.rv-img .rv-old { top: 36px; }

/* 商詳圖轉繁頁（img-tr.html）：「待處理」清單＋去掉行內樣式 */
.it-h { margin-top: 0; }
.it-usage-top { margin-top: 12px; }
.it-cnt { margin-left: 4px; color: var(--pink); font-weight: 600; }
.iss-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.iss-img { flex: none; width: 72px; height: 72px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; cursor: zoom-in; }
.iss-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.iss-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.iss-t b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iss-t small { color: var(--muted); font-size: 12px; }
.iss-why { font-size: 12.5px; color: var(--amber); }
.iss-ops { flex: none; display: flex; align-items: center; gap: 10px; }
.rv-title .linkbtn, .iss-ops .linkbtn { border: none; background: none; padding: 0; color: var(--pink); cursor: pointer; font-size: 12.5px; text-decoration: underline; font-weight: 400; }
@media (max-width: 640px) { .iss-row { flex-wrap: wrap; } .iss-ops { width: 100%; justify-content: flex-end; } }

/* 上架工具商品卡：關鍵字有對到標題、但品類不是搜尋詞時，用小字標出品類（例：搜「枕頭」跑出品類為「包」的枕頭包） */
.pcat-off { font-size: 11px; color: var(--amber); margin-top: 2px; }

/* 採購對帳：系統自動判斷單位後只留一行小字＋改單位的出口（藏起強調底色） */
.rc-ask.rc-ask-quiet { background: transparent; border-color: transparent; padding: 0 4px; }
.rc-ask-auto { color: var(--muted); font-size: 12px; }
/* 得物物流跟蹤頁首 */
.tr-head { padding: 20px 22px 0; }

/* 設定→串接金鑰：momo 帳號指紋小字（2026/10/26） */
.cr-acct { font-size: 11px; color: var(--faint); margin: -4px 0 8px; }
.cr-acct:empty { display: none; }
.cr-acct-warn { font-size: 11px; color: var(--amber); margin-top: 2px; }

/* 商品管理→下架不在 ERP 的 momo 商品（開發者專用面板，2026/10/26） */
.orph h2 { font-size: 16px; margin: 0 0 6px; }
.orph-note { font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.orph-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.orph-row input[type=number] { width: 80px; }
.orph-box { margin-top: 14px; font-size: 13px; }
.orph-box[hidden] { display: none; }
.orph-stats { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 8px; }
.orph-stats b { font-size: 18px; font-variant-numeric: tabular-nums; }
.orph-sample { color: var(--muted); font-size: 12px; margin: 6px 0; padding-left: 18px; }
.orph-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.orph-err { color: var(--red); margin-top: 6px; word-break: break-all; }
.orph-bar { height: 8px; background: #ebe8ee; border-radius: 5px; overflow: hidden; margin: 8px 0; }
.orph-bar > div { height: 100%; width: 0; background: var(--pink); transition: width .2s; }

/* 倉庫帳號（body.role-warehouse，gate.js 加上）：看不到金額，也不顯示通往採購頁的連結。
   後端已經不回金額欄位；之後有頁面顯示金額，加上 .amt 這個 class 就會對倉庫隱藏。 */
body.role-warehouse .amt,
body.role-warehouse .tab-note { display: none !important; }

/* 側欄可摺疊群組（gate.js：得物功能等平台群組）：標題是按鈕，右邊小箭頭；收起時標題旁顯示待處理加總角標 */
.sb-toggle { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; font-family: inherit; text-align: left; cursor: pointer; }
.sb-toggle:hover { color: var(--ink-text); }
.sb-toggle:focus-visible { outline: 2px solid var(--pink); outline-offset: -2px; border-radius: 8px; }
.sb-toggle .sb-caret { width: 14px; height: 14px; margin-left: auto; flex-shrink: 0; transition: transform .15s; }
.sb-toggle[aria-expanded="false"] .sb-caret { transform: rotate(-90deg); }
.sb-toggle .sb-gcnt { margin-left: 0; }
.sb-toggle[aria-expanded="true"] .sb-gcnt { display: none; }
.sb-sub[hidden] { display: none; }

@media (max-width: 820px) { .sb-toggle { min-height: 44px; } }

/* 商品管理匯入除錯框：dev-only 預設 inline-flex 會壓過 [hidden]，這個框要 block 且尊重 hidden（2026/10/27） */
body.role-dev .pm-debug.dev-only { display: block !important; }
body.role-dev .pm-debug.dev-only[hidden] { display: none !important; }

/* 物流頁「其他店鋪」分頁：別家店的訂單只看不處理，提示列＋整列淡化 */
.foreign-note { padding: 10px 14px; font-size: 12.5px; color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; margin-bottom: 10px; }
.order-block.is-foreign .row { opacity: .7; }

/* 批量上架：報價背景補查中／查不到的卡片狀態，以及搜尋結果為空時的說明文字 */
.pcard .pprice-wait, .pcard .pprice-fail, .pprice-none { color: var(--faint); font-weight: 400; }
.pcard .pprice-wait::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; border: 2px solid var(--line-strong); border-top-color: var(--pink); border-radius: 50%; animation: pprice-spin .8s linear infinite; }
@keyframes pprice-spin { to { transform: rotate(360deg); } }
.cat-empty-t { color: var(--red); font-weight: 700; }
.cat-empty-t.warn { color: var(--amber); }
.cat-empty-d { margin-top: 6px; }
.cat-empty-act { margin-top: 10px; }

/* ===== 批量上架單一搜尋框（2026/10/30）：一個輸入框取代三個分頁；多行貼上會自動長高 ===== */
.lst-q-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; }
.lst-in.lst-in-q { flex: 1 1 320px; max-width: 720px; }
.search.lst-q { display: block; width: 100%; min-width: 0; height: 38px; max-height: 164px; padding: 8px 12px; line-height: 22px; resize: none; overflow-y: auto; box-sizing: border-box; }
.lst-qhint { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 32px 0; font-size: 14px; color: var(--muted); }
.lst-qhint[hidden] { display: none; }
.lst-qhint-t { color: var(--text); }
.brandpick-box { grid-column: 1 / -1; padding: 16px 18px; border: 1px dashed var(--line); border-radius: var(--r-sm); background: #fafafa; }
.brandpick-t { margin-bottom: 10px; }
.brandpick-list { display: flex; flex-wrap: wrap; gap: 8px; }
.brandpick-note { margin-top: 10px; font-size: 12px; }
.brandpick { margin: 0; }
@media (max-width: 820px) {
  .lst-qhint { margin-left: 16px; margin-right: 16px; }
  .lst-in.lst-in-q { flex-basis: 100%; max-width: none; }
  .lst-q-row .btn { width: 100%; }
}

/* gate.js 側欄底部的期限提示（試用剩 N 天／正式版使用期限）：warn＝快到期用 --amber，info＝一般顯示用淡色 */
.sb-expiry { font-size: 12px; margin-bottom: 6px; }
.sb-expiry.warn { color: var(--amber); font-weight: 600; }
.sb-expiry.info { color: var(--ink-muted); }

/* 側欄底部：門戶登入者的帳號代號 */
.sb-user { font-size: 12px; color: var(--ink-muted); margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* A 組：總覽頁裡得物商家專屬的區塊，一般商家（body.shop-general）不顯示。
   跟 .dewu-only 相反（預設顯示、一般商家隱藏），因為這些元素本身的 display 各不相同（flex／block），不能硬設成 block。 */
body.shop-general .dewu-hide { display: none; }

/* 美術統一（對比、圓角三級、框線配色、間距、沒套樣式的輸入框與上傳按鈕、手機版）*/
/* 總覽：卡片之間固定 16px */
main:has(> #splitCard) { display: flex; flex-direction: column; gap: 16px; }
/* 不支援 :has() 的舊瀏覽器：改用下邊距維持總覽卡片間距 */
@supports not selector(:has(*)) { main > .ob, main > .card, main > .dash-cols { margin-bottom: 16px; } }
/* 共用：黃色提醒框 */
.note-warn { background: var(--amber-tint); border: 1px solid var(--amber-line); border-radius: var(--r-sm); padding: 8px 12px; font-size: 12px; line-height: 1.6; color: var(--amber-text); }
.note-warn.mb { margin-bottom: 10px; }
#priceBasis a { color: var(--pink); font-size: 12px; }
#dMainPrev > span { font-size: 12px; }
/* 一列：輸入框 + 按鈕（設定頁與上架抽屜共用）*/
.row2 { display: flex; gap: 8px; align-items: center; }
.row2 input:not([type=file]) { flex: 1; min-width: 0; font: inherit; font-size: 13px; height: 34px; padding: 0 11px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: #fff; color: var(--text); }
.row2 input:not([type=file]):focus, .bp-row input:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px var(--pink-tint); }
.row2 .btn { flex-shrink: 0; }
.row2 + .row2:not(.row2-b) { margin-top: 8px; }
.row2-b { margin: 0 0 8px; }
.row2-tight { margin: -4px 0 6px; }
.bp-row input { font: inherit; font-size: 13px; height: 34px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: #fff; color: var(--text); }
.flabel select { background: #fff; }
/* 檔案上傳：隱藏原生 input，用 .btn 樣式的 label */
.file-pick { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.file-pick input[type=file] { display: none; }
.file-pick .file-name { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hr-line { border: none; border-top: 1px solid var(--line); margin: 16px 0; }
/* 手機版 */
.tbl-scroll { overflow-x: auto; }
@media (max-width: 820px) {
  .frow, .frow2 { grid-template-columns: 1fr; }
  .drawer-panel, .drawer-panel.wide { max-width: 100vw; overflow-x: hidden; }
  .drawer-panel .tbl-scroll table { min-width: 560px; }
  .drawer-panel select, .drawer-panel input:not([type=checkbox]) { max-width: 100%; }
}
/* 物流頁篩選列：手機上「建立日期」標籤不換行，日期欄位可換到下一行 */
.fld { white-space: nowrap; flex-wrap: wrap; }

/* C 組：舊細條頁首換成 .pm-head 後，頁首下方的狀態列，以及頁首右側動作區裡的小字 */
.pm-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 13px; }
.pm-bar:empty { display: none; }
.pm-actions .muted { align-self: center; font-size: 12px; }
.pm-actions .search { max-width: 240px; flex: 0 1 240px; }
.pm .ok-t { color: var(--green); }
.pm .err-t { color: var(--red); }
.pm-bar label { color: var(--muted); }
.pm-bar .search { max-width: 150px; }
/* 採購頁：得物採購失敗的單（回到待採購要重新採購） */
.pi-fail { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 4px; font-size: 11.5px; font-weight: 600; color: var(--red); background: rgba(220, 38, 38, .08); }
.pi-fail-sub { font-size: 12px; color: var(--red); margin-top: 3px; }

/* 淘天功能（採集箱 taotian.html、設定頁淘天面板）：列表、上架抽屜內的版面 */
.tt-empty { padding: 56px 24px; text-align: center; color: var(--muted); border-top: 1px solid var(--line); }
.tt-goods { display: flex; align-items: center; gap: 12px; min-width: 300px; }
.tt-img { flex: none; width: 56px; height: 56px; border-radius: var(--r-sm); border: 1px solid var(--line); background: #fff; object-fit: contain; display: block; }
.tt-img.ph { background: #f1eff3; }
.tt-gt { min-width: 0; }
.tt-title { line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: break-all; }
.tt-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.tt-src { padding: 1px 7px; border-radius: 999px; background: var(--pink-tint); color: var(--pink-dark); font-weight: 600; }
.tt-link { color: var(--muted); text-decoration: none; }
.tt-link:hover { color: var(--pink); text-decoration: underline; }
.tt-sold { font-size: 12.5px; color: var(--red); }
.tt-warns { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.tt-tag.err { display: inline-block; padding: 1px 8px; border-radius: var(--r-sm); font-size: 12px; font-weight: 600; color: var(--red); background: rgba(220, 38, 38, .08); }
.tt-warn { font-size: 12.5px; color: var(--amber-text); }
.tt-acts { display: flex; gap: 6px; }
.tt-listed { display: flex; flex-direction: column; gap: 2px; }
/* 上架抽屜 */
.tt-dh { margin: 0; font-size: 18px; }
.tt-sec { margin-top: 18px; }
.tt-lab { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; margin-bottom: 8px; }
.tt-lab .muted { font-weight: 400; font-size: 12.5px; }
.tt-lab-btns { margin-left: auto; display: flex; gap: 4px; }
.tt-full { width: 100%; min-width: 0; box-sizing: border-box; }
.tt-alert { margin-top: 14px; padding: 10px 14px; border-radius: var(--r-sm); border: 1px solid #ecc3bf; background: #fdf1f0; color: var(--red); font-size: 13px; line-height: 1.6; }
.tt-alert ul, .tt-ul { margin: 4px 0 0; padding-left: 18px; }
.tt-cat-cur { font-size: 13px; margin-bottom: 8px; word-break: break-all; }
.tt-cat-list { list-style: none; margin: 6px 0 0; padding: 4px; max-height: 220px; overflow-y: auto; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: #fff; }
.tt-cat-opt { display: block; width: 100%; text-align: left; font: inherit; font-size: 13px; padding: 8px 10px; border: 0; border-radius: var(--r-sm); background: none; color: var(--text); cursor: pointer; word-break: break-all; }
.tt-cat-opt:hover, .tt-cat-opt:focus { background: var(--pink-tint); outline: none; }
.tt-cat-none { padding: 8px 10px; font-size: 13px; }
.tt-ths { display: flex; flex-wrap: wrap; gap: 8px; }
.tt-th { padding: 0; width: 64px; height: 64px; border: 2px solid var(--line); border-radius: var(--r-sm); background: #fff; cursor: pointer; overflow: hidden; }
.tt-th img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tt-th.on { border-color: var(--pink); box-shadow: 0 0 0 2px var(--pink-tint); }
.tt-skus th, .tt-skus td { padding: 8px 10px; font-size: 13px; vertical-align: middle; }
.tt-skus .num { text-align: right; white-space: nowrap; }
.tt-skus th.chk, .tt-skus td.chk { width: 34px; padding-right: 0; }
.tt-skus tr.tt-off td { color: var(--faint); background: #faf9fb; }
.tt-stock { width: 72px; height: 32px; font: inherit; font-size: 13px; text-align: right; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); box-sizing: border-box; }
.tt-descs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
.tt-descs img { flex: none; width: 72px; height: 72px; object-fit: contain; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; }
.tt-params summary { cursor: pointer; font-size: 13.5px; font-weight: 600; }
.tt-params table { margin-top: 8px; }
.tt-params th, .tt-params td { padding: 6px 10px; font-size: 12.5px; background: none; white-space: normal; word-break: break-all; }
.tt-params th { width: 36%; color: var(--muted); font-weight: 400; }
.tt-foot { position: sticky; bottom: -22px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 22px -22px -22px; padding: 12px 22px; background: #fff; border-top: 1px solid var(--line); }
.tt-hint { margin-right: auto; font-size: 12.5px; color: var(--red); }
/* 設定頁：採集外掛步驟 */
.tt-steps { margin: 6px 0 0; padding-left: 22px; display: flex; flex-direction: column; gap: 12px; }
.tt-steps li b { display: block; font-size: 14px; }
.tt-steps li span { font-size: 13px; color: var(--muted); }
.tt-tag.err { white-space: nowrap; }
.tt-spec { white-space: nowrap; }
/* 手機：頂端 ☰ 列（z-index 45）會蓋住抽屜標題和關閉鈕，採集箱的抽屜要疊在它上面 */
@media (max-width: 820px) { .drawer.tt-drawer { z-index: 46; } }

/* 物流跟蹤：同一張 momo 單的品項沒到齊（部分到倉）。出貨是整張單，所以要看得出還缺哪幾件 */
.b-partial_arrived { background: var(--amber-tint); color: var(--amber-text); }
.grp-cnt { font-size: 11.5px; margin-top: 5px; color: var(--amber-text); font-weight: 600; }
.grp-cnt.ok { color: var(--green); }
.grp-late { font-size: 11.5px; margin-top: 4px; color: var(--red); font-weight: 600; }
.grp-wait { list-style: none; margin: 4px 0 0; padding: 0; font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.grp-fail { display: block; color: var(--red); }
.ship-blocked { font-size: 12.5px; color: var(--red); }
/* Threads 熱詞（threads.html）：連線狀態列、品類切換、走勢小圖、種子詞卡片 */
.th-conn { padding: 16px; display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.th-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; }
.th-running { color: var(--amber-text); font-weight: 600; }
.th-bad { font-weight: 600; }
.th-meta summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.th-url { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 8px; }
.th-url code { font-family: var(--mono); font-size: 12.5px; word-break: break-all; }
.th-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; padding: 14px 16px; }
.th-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.th-chip { font: inherit; font-size: 13px; height: 32px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; color: var(--text); cursor: pointer; }
.th-chip:hover { border-color: var(--pink); }
.th-chip.on { background: var(--pink-tint); border-color: var(--pink); color: var(--pink-dark); font-weight: 600; }
.th-hint { margin: 0; padding: 0 16px 12px; }
.th-table table { min-width: 720px; }
.th-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.th-spark { width: 80px; height: 24px; color: var(--pink); display: block; }
.th-up { color: var(--green); font-weight: 600; }
.th-down { color: var(--muted); }
.th-new { color: var(--pink-dark); font-weight: 600; }
.th-text { white-space: pre-wrap; word-break: break-word; min-width: 280px; }
.th-time { white-space: nowrap; color: var(--muted); }
.th-search .search { flex: 1 1 200px; }
.th-search .th-sel { flex: 0 0 auto; min-width: 140px; }
.th-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; padding: 16px; }
.th-card { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; background: #fff; }
.th-card h3 { margin: 0 0 10px; font-size: 16px; }
.th-seeds { list-style: none; margin: 0 0 12px; padding: 0; }
.th-seed { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid #ecebef; }
.th-seed.off .th-seed-t span { color: var(--faint); text-decoration: line-through; }
.th-seed-t { display: flex; align-items: center; gap: 10px; min-width: 0; word-break: break-all; }
.th-add { display: flex; gap: 8px; align-items: center; }
.th-add .search { min-width: 0; }
.th-addcat { padding: 0 16px 16px; max-width: 420px; }
.th-off { border-top: 0; }
@media (max-width: 820px) { .th-cards { grid-template-columns: 1fr; } }

/* ===== 物流頁：同一張 momo 單收成一格（rowHtml 的 .row-merge）===== */
.row.row-merge { display: block; }
.row-merge .mg-head { display: grid; grid-template-columns: 220px 1fr 160px 38px; gap: 16px; align-items: start; }
.mg-items { list-style: none; margin: 12px 0 0; padding: 0; border-top: 1px dashed var(--line); }
.mg-item { display: grid; grid-template-columns: 56px 1fr minmax(0, 260px); gap: 12px; align-items: start; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.mg-item:last-child { border-bottom: none; }
.mg-thumb img, .mg-thumb .ph { width: 56px; height: 56px; border-radius: var(--r-sm); border: 1px solid var(--line); object-fit: contain; background: #fff; display: flex; align-items: center; justify-content: center; color: #c4c8ce; }
.mg-goods { min-width: 0; }
.mg-goods .name { font-size: 13px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mg-goods .art { color: var(--muted); font-size: 12px; margin-top: 3px; font-family: ui-monospace, monospace; word-break: break-all; }
.mg-goods .spec { display: inline-block; margin-top: 4px; font-size: 12px; color: #444; background: #f4f5f7; border-radius: var(--r-sm); padding: 2px 8px; }
.mg-st { min-width: 0; text-align: right; }
.mg-st .badge { margin-top: 0; }
.mg-st .track { font-family: ui-monospace, monospace; font-size: 11px; color: var(--blue); margin-top: 4px; word-break: break-all; }
.mg-st .committed { margin-top: 4px; }
.grp-else { font-size: 11.5px; margin-top: 4px; color: var(--muted); }
.mg-det { margin-bottom: 18px; }
.mg-det-t { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.mg-trace summary { cursor: pointer; }
@media (max-width: 820px) {
  .row.row-merge { min-width: 0; }
  .row-merge .mg-head { grid-template-columns: 1fr 38px; }
  .row-merge .mg-head .c-recipient, .row-merge .mg-head .c-date { grid-column: 1; text-align: left; }
  .row-merge .mg-head .c-act { grid-column: 2; grid-row: 1; }
  .mg-item { grid-template-columns: 56px 1fr; }
  .mg-st { grid-column: 2; text-align: left; }
}
/* 匯入 / 批量上架頁（import.html）：① 匯入區、② 批量新建（一款一張卡片＋整批表格）。原本寫在頁面 <style> 與行內樣式，搬進來 */
.imp-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 24px; }
.imp-card h2 { font-size: 16px; margin: 0 0 12px; }
.imp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.imp-hint { color: var(--muted); font-size: 12px; margin: 0 0 12px; }
.imp-out { margin-top: 10px; }
.imp-link { margin-top: 10px; display: inline-flex; }
.imp-sample { font-size: 11px; }
.imp-code { word-break: break-all; }
.bk-drop { margin-top: 12px; padding: 14px; border: 1px dashed var(--line-strong); border-radius: var(--r-sm); color: var(--muted); font-size: 13px; text-align: center; }
.bk-drop.over { border-color: var(--pink); background: var(--pink-tint); color: var(--text); }
.bk-drop.busy { color: var(--text); }
.bk-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 14px; }
.bk-tabs { padding: 0; border-bottom: 0; background: transparent; }
.bk-tabs .tab { padding: 8px 12px; }
.bk-chk, .bk-lm label, .bk-bb { font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.bk-lm { display: inline-flex; gap: 14px; }
.bk-sp { flex: 1; }
.bk-bulkbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; padding: 8px 12px; background: var(--hover); border-radius: var(--r-sm); }
.bk-bulkbar[hidden], .bk-prog[hidden] { display: none; }
.bk-body { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.bk-empty { padding: 28px 12px; text-align: center; color: var(--muted); }
.bk-card { border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; }
.bk-card.open { border-color: var(--line-strong); }
.bk-hd { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; }
.bk-hd input[type=checkbox] { margin-top: 4px; width: 16px; height: 16px; flex: none; }
.bk-toggle { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; text-align: left; font: inherit; background: none; border: 0; padding: 0; color: var(--text); cursor: pointer; }
.bk-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bk-key { font-variant-numeric: tabular-nums; }
.bk-name { word-break: break-word; }
.bk-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); }
.bk-need { display: block; font-size: 12px; }
.bk-need.todo { color: var(--amber-text); }
.bk-need.bad { color: var(--red-text); }
.bk-need.warn { color: var(--amber); }
.bk-need.done { color: var(--green); }
.bk-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: var(--hover); color: var(--muted); white-space: nowrap; }
.bk-badge.ok { background: #e7f7ee; color: var(--green); }
.bk-badge.done { background: #eef3ff; color: var(--blue); }
.bk-badge.todo { background: var(--amber-tint); color: var(--amber-text); }
.bk-badge.bad { background: #fce8e8; color: var(--red-text); }
.bk-detail { padding: 4px 14px 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.bk-f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; min-width: 0; }
.bk-f > span:first-child { color: var(--muted); font-size: 12px; margin-top: 10px; }
.bk-f2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bk-in { font: inherit; font-size: 14px; min-height: 34px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: #fff; color: var(--text); max-width: 100%; box-sizing: border-box; }
.bk-in:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px var(--pink-tint); }
.bk-f > .bk-in { width: 100%; }
.bk-in.w-s { width: 84px; }
.bk-in.w-m { width: 120px; }
.bk-ta { padding: 8px; resize: vertical; }
.bk-catrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.bk-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.bk-chip { font: inherit; font-size: 12px; padding: 3px 10px; border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; color: var(--text); cursor: pointer; }
.bk-chip:hover { border-color: var(--pink); color: var(--pink); }
.bk-scroll { border-top: 0; border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: 6px; }
.bk-sku { min-width: 640px; }
.bk-sku th, .bk-sku td, .bk-grid th, .bk-grid td { padding: 6px 8px; }
.bk-grid { min-width: 760px; }
.bk-tname { max-width: 260px; word-break: break-word; }
.bk-imgs { display: flex; flex-wrap: wrap; gap: 8px; }
.bk-th { position: relative; width: 72px; height: 72px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; }
.bk-th img { width: 100%; height: 100%; object-fit: contain; border-radius: var(--r-sm); }
.bk-th i { position: absolute; left: 3px; bottom: 2px; font-size: 11px; font-style: normal; color: var(--muted); }
.bk-th-x { position: absolute; right: 2px; top: 2px; width: 22px; height: 22px; border: 0; border-radius: 11px; background: rgba(0,0,0,.55); color: #fff; font-size: 14px; line-height: 1; cursor: pointer; }
.bk-acts { display: flex; gap: 8px; justify-content: flex-end; }
.bk-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.bk-summary { font-size: 14px; }
.bk-prog { margin-top: 14px; }
.bk-res { list-style: none; margin: 10px 0 0; padding: 0; font-size: 13px; display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow-y: auto; }
.bk-pick { width: 560px; max-width: 94vw; }
.bk-pick-in { width: 100%; margin: 12px 0 8px; flex: none; }
.bk-pick-list { max-height: 50vh; overflow-y: auto; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.bk-pick-item { display: block; width: 100%; text-align: left; font: inherit; font-size: 13px; padding: 8px 10px; border: 0; border-bottom: 1px solid var(--line); background: #fff; color: var(--text); cursor: pointer; }
.bk-pick-item:hover { background: var(--pink-tint); }
@media (max-width: 820px) {
  .imp-card { padding: 16px; }
  .bk-f2 { grid-template-columns: 1fr; }
  .bk-foot .imp-row, .bk-foot .btn { width: 100%; }
}

/* 採集箱抽屜「圖片簡轉繁」：每張圖右上角標判斷結果，下面一顆切換翻／不翻；人工選的加粗框 */
.tt-trg { margin-top: 10px; }
.tt-trh { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.tt-trck { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; font-weight: 400; cursor: pointer; }
.tt-trl { display: flex; flex-wrap: wrap; gap: 8px; }
.tt-trc { width: 84px; display: flex; flex-direction: column; gap: 4px; padding: 4px; border: 1.5px solid var(--line); border-radius: var(--r-sm); background: #fff; box-sizing: border-box; }
.tt-trc.on { border-color: var(--pink); }
.tt-trc.man { border-width: 2.5px; box-shadow: 0 0 0 2px var(--pink-tint); }
.tt-trc.lock { opacity: .55; }
.tt-tri { position: relative; padding: 0; width: 100%; height: 74px; border: 0; background: #fff; cursor: zoom-in; }
.tt-tri img { width: 100%; height: 100%; object-fit: contain; display: block; }
.tt-trb { position: absolute; top: 2px; right: 2px; padding: 0 5px; border-radius: 999px; font-size: 11px; line-height: 18px; background: var(--hover); color: var(--muted); white-space: nowrap; }
.tt-trb.needs { background: var(--pink); color: #fff; }
.tt-trb.none { background: color-mix(in srgb, var(--green) 14%, #fff); color: var(--green); }
.tt-trb.unk { background: color-mix(in srgb, var(--amber) 14%, #fff); color: var(--amber-text); }
.tt-trt { width: 100%; padding: 0 2px; font-size: 11.5px; }
.tt-trnote { margin: 8px 0 0; font-size: 12.5px; }

/* 淘天採購頁（taotian-purchase.html）：收貨地址卡、操作欄；物流跟蹤列上的「淘天」來源資訊 */
.tp-addr { padding: 14px 16px; margin-bottom: 12px; }
.tp-addr-none { margin: 0; color: var(--muted); font-size: 13.5px; }
.tp-addr-none a { margin-left: 8px; color: var(--pink); }
.tp-addr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 16px; }
.tp-addr-item { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13.5px; }
.tp-addr-l { flex: none; width: 56px; color: var(--muted); font-size: 12.5px; }
.tp-addr-v { flex: 1; min-width: 0; word-break: break-all; }
.tp-acts { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 220px; }
.tp-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tp-in { font: inherit; font-size: 13px; height: 32px; width: 150px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: #fff; color: var(--text); }
.tp-in-s { width: 90px; }
.tp-chk { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); }
.tp-no { font-size: 13px; }
.tp-warn { margin-top: 4px; font-size: 12.5px; color: var(--amber-text); }
.tt-ship { margin-top: 4px; font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.tt-mini { padding: 1px 7px; border-radius: 999px; background: var(--pink-tint); color: var(--pink-dark); font-weight: 600; font-size: 12px; }
@media (max-width: 820px) {
  .tp-acts { min-width: 0; }
  .tp-in { width: 130px; }
}

/* 商品管理：商品名前的來源小標籤（product_source 開關打開時才出現）。單色，不用顏色分類。 */
.src-tag { display: inline-block; margin-right: 6px; padding: 0 6px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); font-size: 12px; font-weight: 500; line-height: 18px; color: var(--muted); vertical-align: 1px; }

/* 採集箱：得物同款比價（列表欄、篩選列、上架設定抽屜的比價區）。綠＝比得物便宜，灰＝比較貴，近似用琥珀色提醒要人確認。 */
.tt-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.tt-filter .tt-csv { margin-left: auto; }
.tt-cmpc { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; white-space: nowrap; }
.tt-lvl { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 18px; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; }
.tt-lvl.exact { color: var(--green); border-color: var(--green); }
.tt-lvl.near { color: var(--amber-text); border-color: var(--amber); background: rgba(168, 101, 0, .08); }
.tt-diff { font-size: 13px; font-weight: 600; color: var(--muted); }
.tt-diff.cheap { color: var(--green); }
.tt-diff.dear { color: var(--muted); font-weight: 400; }
.tt-cmpnote { margin: 0 0 10px; font-size: 12.5px; }
.tt-cmpm { padding: 12px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; }
.tt-cmpm .tt-goods { min-width: 0; margin-bottom: 8px; }
.tt-kv { width: 100%; border-collapse: collapse; }
.tt-kv th, .tt-kv td { padding: 5px 0; font-size: 13px; text-align: left; font-weight: 400; background: none; }
.tt-kv th { width: 40%; color: var(--muted); }
.tt-cmps { margin-top: 8px; }
.tt-cmps .tt-lo { color: var(--green); font-weight: 600; }
@media (max-width: 820px) { .tt-filter .tt-csv { margin-left: 0; } }
/* 採集箱：得物同款讀不到又開著篩選時的提示列 */
.tt-fltmsg { padding: 10px 16px; font-size: 13px; color: var(--amber-text); background: rgba(168, 101, 0, .08); border-bottom: 1px solid var(--line); }

/* 得物採購頁：「已在外面下單」小表單（訂單號必填、實付與備註選填），點按鈕才展開。 */
.pend-manual { flex: 1 0 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-top: 6px; }

/* 對帳頁「代墊」分頁（reimburse.js）：切換列、缺金額的列要醒目 */
.rc-views { margin-bottom: 12px; border-radius: var(--r-lg); }
.rc-miss td { background: var(--pink-tint); }
.rc-fill { border-color: var(--red); color: var(--red); }

/* 採購頁：得物單被別張佔用、需重新採購的提示 */
.pi-rebuy { color: var(--red); font-size: 12px; margin-top: 2px; }
/* ===== 物流頁手機版（index.html）：訂單卡直排、進度條改一行字、分頁單行橫滑、篩選收成一顆按鈕；另有「看全部日期」提示。桌機不變。 ===== */
.fb-bar { display: none; }
.step-now { display: none; }
.range-hint { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 22px 0; padding: 10px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 13px; color: var(--muted); }
.range-hint[hidden] { display: none; }
@media (max-width: 820px) {
  .tr-page .tr-head { padding: 12px 16px 0; }
  .tr-page .tr-head p { display: none; }
  .tr-page .tr-head h1 { font-size: 20px; }
  .tr-page .fb-bar { display: flex; padding: 8px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
  .tr-page .fb-toggle.on { border-color: var(--pink); color: var(--pink); }
  .tr-page .filterbar { display: none; padding: 10px 16px; }
  .tr-page .filterbar.open { display: flex; }
  .tr-page .filterbar .search { flex: 1 1 100%; min-width: 0; max-width: none; }
  .tr-page .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 0 8px; }
  .tr-page .tabs::-webkit-scrollbar { display: none; }
  .tr-page .tab, .tr-page .tab-note { flex: none; }
  .tr-page .range-hint { margin: 10px 12px 0; }
  .tr-page main { padding: 12px 12px 48px; }
  .tr-page .row { min-width: 0; grid-template-columns: 64px minmax(0, 1fr) 28px; gap: 8px 12px; padding: 12px; }
  .tr-page .row > * { min-width: 0; }
  .tr-page .row:not(.row-merge) > .c-thumb { grid-column: 1; grid-row: 1; }
  .tr-page .row:not(.row-merge) > .c-thumb img, .tr-page .row:not(.row-merge) > .c-thumb .ph { width: 64px; height: 64px; }
  .tr-page .row:not(.row-merge) > .c-goods { grid-column: 2; grid-row: 1; }
  .tr-page .row:not(.row-merge) > .c-act { grid-column: 3; grid-row: 1; }
  .tr-page .row:not(.row-merge) > .c-recipient { grid-column: 1 / -1; grid-row: 2; }
  .tr-page .row:not(.row-merge) > .c-order { grid-column: 1 / -1; grid-row: 3; }
  .tr-page .row:not(.row-merge) > .c-date { grid-column: 1 / -1; grid-row: 4; text-align: left; }
  .tr-page .row .step { grid-row: 5; }
  .tr-page .row .step .t { display: none; }
  .tr-page .row .step .n::before { top: 6px; }
  .tr-page .row .step { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .tr-page .row .step-now { display: block; grid-column: 1 / -1; margin-top: 6px; font-size: 12px; color: var(--text); font-weight: 600; }
  .tr-page .row .step.ex .step-now { color: var(--red); }
  .tr-page .c-order .mono, .tr-page .c-goods .art, .tr-page .c-date .track { overflow-wrap: anywhere; }
  .tr-page .row-merge .mg-head { grid-template-columns: minmax(0, 1fr) 38px; }
  .tr-page .order-detail { padding: 14px; }
}

/* momo 金鑰失效紅條（gate.js 依 /api/auth/status 的 momoAlert 掛上，每頁最上方；和 .trial-ban 同位置，兩條同時出現時疊在它下面） */
.momo-ban { position: fixed; top: 0; left: 216px; right: 0; z-index: 43; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; background: var(--red); color: #fff; padding: 7px 16px; font-size: 13px; font-weight: 600; text-align: center; }
.momo-ban .btn { background: #fff; color: var(--red); border-color: #fff; }
body.has-momo-ban { padding-top: 44px; }
body.has-trial-ban .momo-ban { top: 38px; }
body.has-momo-ban.has-trial-ban { padding-top: 82px; }
@media (max-width: 820px) { .momo-ban { left: 0; top: 56px; } body.has-trial-ban .momo-ban { top: 94px; } body.has-sidebar.has-momo-ban { padding-top: 100px; } body.has-sidebar.has-momo-ban.has-trial-ban { padding-top: 138px; } }

/* 物流頁：得物單「已到倉（得物沒更新）」人工標記按鈕（掛在 .tt-ship 裡）。手機版不撐滿整列。 */
@media (max-width: 820px) { .tr-page .tt-ship .btn { flex: none; width: auto; max-width: 100%; } }

/* 商品管理：momo 查不到的商品。狀態旁小標＋同步後的提示列（含下載清單連結） */
.pm-mm { display: inline-block; margin-left: 8px; padding: 1px 8px; border: 1px solid var(--amber-line); border-radius: 999px; background: var(--amber-tint); color: var(--amber-text); font-size: 12px; white-space: nowrap; }
.pm-mmbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

/* 商品管理→上傳清單下架（開發者專用面板，2026/11/18）：沿用 .orph 版型，只多貼上貨號的輸入框 */
.list-text { display: block; width: 100%; min-height: 90px; margin-top: 10px; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); font: inherit; font-size: 13px; resize: vertical; box-sizing: border-box; }

/* 滯銷清單頁（slow.html，開發者）：分頁列右側的說明與匯出按鈕、可點的表頭 */
.sl-meta { margin-left: auto; align-self: center; font-size: 12.5px; color: var(--muted); }
.sl-meta + .btn { align-self: center; margin-left: 8px; }
.sl-table table { min-width: 560px; }
.sl-sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; white-space: nowrap; }
.sl-sort:hover, .sl-sort.on { color: var(--text); }

/* 商品管理頁「上傳清單下架」預覽：樣本收合成一行逗號分隔（可換行）、開發者才看得到的縮減提示 */
.orph-details { margin: 6px 0; font-size: 12px; color: var(--muted); }
.orph-details summary { cursor: pointer; }
.orph-codes { margin-top: 4px; line-height: 1.6; word-break: break-all; }
.orph-hint { color: var(--muted); font-size: 12px; margin: 6px 0; }

/* 單品精細上架／批量上架：尺碼價差過大提醒。價差最低、最高的尺碼列用淡琥珀底標出來；批量任務的「待確認」列與清單。 */
.sku-table.price-edit tr.p-spread { background: var(--amber-tint); }
.ptag.spread { background: var(--amber-tint); color: var(--amber-text); border: 1px solid var(--amber-line); }
.bulk-item.held > span:first-child { color: var(--amber); font-weight: 700; }
.job-held { margin: 8px 0; }

/* 單品精細上架：尺碼列勾選框（取消勾選的尺碼不上架，整列淡化）與價差警告旁的快捷鈕 */
.sku-table .sku-pick { width: 44px; text-align: center; }
.sku-table tr.sku-off > td:not(.sku-pick) { opacity: .45; }
#spreadBox .btn { margin-left: 6px; vertical-align: baseline; }


/* 商品管理→每件利潤（得物商品；負數用警示色） */
.pm-profit { font-size: 12px; color: var(--green); margin-top: 2px; }
.pm-profit.neg { color: var(--red); font-weight: 600; }
.th-tip { font-size: 11px; font-weight: 400; color: var(--muted); margin-left: 4px; cursor: help; }

/* 商品管理→上傳清單下架面板改版（步驟式卡片：準備清單→上傳→檢查→下架）。沿用 .orph 的檢查結果與任務進度樣式 */
.ld { padding: 20px; }
.ld h2 { margin-bottom: 4px; }
.ld-steps { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 12px; }
.ld-step { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px 16px; background: var(--card); min-width: 0; }
.ld-step.done { background: var(--bg); }
.ld-sh { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 14px; }
.ld-num { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 999px; background: var(--pink); color: #fff; font-size: 13px; font-weight: 600; flex: none; }
.ld-step.done .ld-num { background: var(--green); }
.ld-desc { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.ld-sub { font-size: 12px; color: var(--muted); margin-top: 6px; }
.orph-row .ld-sub { margin-top: 0; }
.ld-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 110px; padding: 16px; border: 2px dashed var(--line-strong); border-radius: var(--r-lg); background: var(--card); text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.ld-drop:hover, .ld-drop.over, .ld-drop:focus-within { border-color: var(--pink); background: var(--pink-tint); }
.ld-drop-t { font-size: 15px; font-weight: 600; color: var(--text); }
.ld-drop-s { font-size: 12px; color: var(--muted); }
.ld-read { font-size: 13px; color: var(--green); word-break: break-all; }
.ld-read[hidden], .ld-drop-s[hidden] { display: none; }
.ld-drop-t { word-break: break-all; }
.ld-drop-s.change { text-decoration: underline; cursor: pointer; }
.ld-paste, .ld-adv { margin-top: 10px; font-size: 13px; color: var(--muted); }
.ld-paste summary, .ld-adv summary { cursor: pointer; }
.ld-adv { margin: 0 0 10px; }
.ld-adv-f { display: block; margin-top: 8px; color: var(--text); }
.ld-adv-f input { width: 80px; }
.ld .list-text { margin-top: 8px; }
.ld-cards { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 10px; }
.ld-card { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; background: var(--card); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ld-card b { font-size: 20px; font-variant-numeric: tabular-nums; }
.ld-card span { font-size: 12px; color: var(--muted); }
.ld-card.main { border-color: var(--pink); background: var(--pink-tint); }
.ld-card.main b { font-size: 28px; color: var(--pink-dark); }
@media (max-width: 600px) {
  .ld { padding: 14px; }
  .ld-cards { grid-template-columns: 1fr 1fr; }
  .ld-card.main { grid-column: 1 / -1; }
}

/* 商品詳情頁（product.html）：基本資訊／可修改參數／momo 上的商品圖。從商品管理點商品名稱或縮圖進來。 */
a.pm-link { color: inherit; text-decoration: none; }
.goods-name a.pm-link:hover { color: var(--pink-dark); text-decoration: underline; }
a.pm-thumb { display: block; }
.pd-sec { padding-bottom: 16px; }
.pd-h { margin: 0; padding: 16px 20px 4px; font-size: 16px; font-weight: 600; }
.pd-note { margin: 0; padding: 0 20px 10px; font-size: 13px; color: var(--muted); }
.pd-basic { display: flex; gap: 20px; padding: 12px 20px 4px; align-items: flex-start; }
.pd-thumb img, .pd-thumb .ph { width: 140px; height: 140px; border-radius: var(--r-sm); border: 1px solid var(--line); background: #fff; object-fit: contain; display: flex; align-items: center; justify-content: center; color: #b5adbc; }
.pd-info { min-width: 0; flex: 1; }
.pd-title { font-size: 18px; font-weight: 600; line-height: 1.4; word-break: break-word; }
.pd-dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 20px; margin: 12px 0; }
.pd-dl dt { font-size: 12px; color: var(--muted); }
.pd-dl dd { margin: 2px 0 0; font-size: 14px; word-break: break-all; }
.pd-status { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
#pdEdit .pm-table { border-top: 0; }
.pm-table .pd-skus { min-width: 640px; }   /* 要比 .pm-table table 的 960px 更具體，詳情頁表格才不會被撐寬 */
.pd-skus input[type=number] { width: 96px; font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); text-align: right; }
.pd-skus input[type=checkbox] { width: 16px; height: 16px; }
.pd-skus td.pd-sz { white-space: nowrap; }
.pd-warn { margin-top: 2px; font-size: 12px; color: var(--red); }
.pd-hint { margin: 8px 20px 0; font-size: 12px; color: var(--muted); }
.pd-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 20px 0; }
.pd-hist-t { margin: 18px 20px 8px; }
.pd-hist { max-height: 220px; overflow-y: auto; margin: 0 20px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.pd-hist-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 11px; border-bottom: 1px solid var(--line); font-size: 12px; }
.pd-hist-row:last-child { border-bottom: 0; }
.pd-hist-d { color: var(--muted); white-space: nowrap; }
.pd-imgs-bar, .pd-imgs-empty { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 0 20px 12px; font-size: 13px; color: var(--muted); }
.pd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; padding: 0 20px; }
.pd-img { padding: 0; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; cursor: zoom-in; aspect-ratio: 1; overflow: hidden; }
.pd-img:hover, .pd-img:focus-visible { border-color: var(--pink); }
.pd-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
@media (max-width: 820px) {
  .pd-basic { flex-direction: column; }
  .pd-thumb img, .pd-thumb .ph { width: 100px; height: 100px; }
}

/* 商品詳情頁（平板、手機）：表格放不下時，尺碼表改成一個尺碼一張卡片，改價不用左右捲。 */
@media (max-width: 1000px) {
  .pd-dl { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pm-table .pd-skus { min-width: 0; width: 100%; }
  .pd-skus { display: block; }
  .pd-skus tbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; padding: 0 12px 2px; }
  .pd-skus thead { display: none; }
  .pd-skus tr { display: block; margin: 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); }
  .pd-skus td { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 0; border: 0; }
  .pd-skus td::before { content: attr(data-l); font-size: 12px; color: var(--muted); }
  .pd-skus td.pd-sz { display: block; font-weight: 600; padding-bottom: 6px; }
  .pd-skus td.pd-sz::before { content: none; }
  .pd-skus td.dewu-only { display: none; }
  body.shop-dewu .pd-skus td.dewu-only { display: flex; }
}
@media (max-width: 480px) { .pd-dl { grid-template-columns: minmax(0, 1fr); } }

/* 上架時標「曾滯銷」（只有開發者看得到）：商品卡片、單品抽屜、淘天採集箱列共用的小徽章，只提醒不擋上架 */
.slow-badge { display: inline-block; margin: 4px 6px 0 0; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--amber-line); background: var(--amber-tint); color: var(--amber-text); font-size: 11px; font-weight: 600; }

/* 店群重複款頁（group.html，開發者）：摘要表、重複款表的小樣式；超過 2 天沒送達標紅 */
.gp-stale { color: var(--red); font-weight: 600; }
.gp-warn { display: inline-block; margin-left: 6px; font-size: 12px; color: var(--amber-text); }
.gp-sum { margin-left: 12px; font-weight: 400; font-size: 13px; color: var(--muted); }
.gp-name { max-width: 280px; }

/* 清單下架面板：勾選「不記進滯銷清單」 */
.ld-noslow { display: flex; align-items: center; gap: 8px; width: 100%; font-size: 14px; color: var(--text); }
.ld-noslow input { width: 16px; height: 16px; }

/* 商品管理頁頂端「店群去重」一行（只有設了店群的店有；自動下架重複款後的結果與明細下載） */
.gp-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin: 0 0 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card); font-size: 13px; color: var(--muted); }
.gp-line a { color: var(--pink-dark); font-weight: 600; }

/* 店群頁（group.html，開發者）：自動下架開關、兩個略過清單 */
.gp-auto .opt { cursor: default; }
.gp-err { color: var(--red); }

/* 店群加固（2026/11/23）：商品管理頁開發者的下架紀錄選單、清單下架面板的「店群去重（系統自動）」標示；group.html 的紅字警示與名單外快照 */
.gp-log { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.gp-log select { height: 30px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--card); font-size: 13px; color: var(--text); }
.gp-src { display: inline-block; padding: 0 8px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.gp-over { color: var(--red); font-weight: 600; }
.gp-err-box { margin-bottom: 12px; padding: 8px 12px; border: 1px solid var(--red); border-radius: var(--r-sm); background: var(--card); color: var(--red); font-size: 13px; line-height: 1.6; }
.gp-outsider table, .gp-gone table { min-width: 640px; }

/* 店群頁重做（group.html，2026/11/25，開發者）：試算頁。三張卡、店與店同款熱度表、各店狀況、重複款清單（每店一張小卡）。區塊間距 24px、標題 16px、說明 13px 灰 */
.gp-page { gap: 24px; }
.opt-t > .gp-note { font-size: 12px; color: var(--faint); }
.gp-sec { padding: 16px 16px 12px; }
.gp-sec-row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.gp-h { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.4; }
.gp-desc { margin: 2px 0 0; font-size: 13px; color: var(--muted); line-height: 1.6; }
.gp-same { margin: 0; padding: 10px 16px 14px; border-top: 1px solid var(--line); }
.gp-latebox { display: flex; flex-direction: column; gap: 8px; }
.gp-latebox:empty { display: none; }
/* 三張卡：同高、同內距 */
.gp-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.gp-card { display: flex; flex-direction: column; gap: 6px; min-height: 168px; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); }
.gp-card-t { font-size: 13px; color: var(--muted); }
.gp-card-n { font-size: 40px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.gp-card-n small { font-size: 16px; font-weight: 600; }
.gp-card-s { font-size: 13px; color: var(--muted); line-height: 1.6; }
.gp-card-s.faint { color: var(--faint); }
.gp-card.out .gp-card-n { color: var(--red); }
.gp-card.skip .gp-card-n { color: var(--muted); }
.gp-reasons { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); line-height: 1.6; }
.gp-reasons li { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; padding-left: 14px; }
.gp-reasons li::before { content: ""; position: absolute; left: 2px; top: .65em; width: 5px; height: 5px; border-radius: 50%; background: var(--line-strong); }
.gp-reasons li.none::before { display: none; }
.gp-reason { padding: 0; border: 0; background: none; font: inherit; font-size: 13px; line-height: 1.6; color: var(--text); cursor: pointer; text-align: left; }
.gp-reason:hover { color: var(--pink-dark); text-decoration: underline; }
.gp-reason-n { font-weight: 600; color: var(--muted); white-space: nowrap; }
/* 熱度表：格子是款數，底色依數值（品牌色 5 階），0 與對角線顯示「–」 */
.gp-matrix table { min-width: 460px; width: 100%; table-layout: fixed; }
.gp-matrix th, .gp-matrix td { padding: 6px; text-align: center; font-size: 14px; white-space: nowrap; }
.gp-matrix thead th { color: var(--muted); font-weight: 600; background: var(--hover); }
.gp-matrix tbody th { width: 96px; text-align: left; padding-left: 16px; font-weight: 600; }
.gp-hc { height: 48px; }
.gp-cell { display: block; width: 100%; height: 36px; padding: 0; border: 1px solid transparent; border-radius: var(--r-sm); background: transparent; font: inherit; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--text); cursor: pointer; }
.gp-cell:hover { border-color: var(--pink); }
.gp-cell.on { border-color: var(--pink-dark); box-shadow: 0 0 0 2px var(--pink-line); font-weight: 700; }
.gp-heat-0 { background: color-mix(in srgb, var(--pink) 8%, transparent); }
.gp-heat-1 { background: color-mix(in srgb, var(--pink) 18%, transparent); }
.gp-heat-2 { background: color-mix(in srgb, var(--pink) 32%, transparent); }
.gp-heat-3 { background: color-mix(in srgb, var(--pink) 50%, transparent); }
.gp-heat-4 { background: var(--pink); color: var(--card); font-weight: 700; }
.gp-zero { color: var(--faint); }
.gp-diag { display: block; line-height: 36px; border-radius: var(--r-sm); background: var(--hover); color: var(--faint); }
.gp-pair { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 16px 12px; font-size: 13px; color: var(--muted); }
/* 各店狀況 */
.gp-shops table { min-width: 900px; }
.gp-shops td:last-child, .gp-shops th:last-child { width: 72px; padding-right: 12px; }
.gp-shops th { background: var(--hover); color: var(--muted); font-weight: 600; white-space: nowrap; }
.gp-shops td, .gp-shops th { height: 56px; padding: 8px 10px; }
.gp-shops .num { font-variant-numeric: tabular-nums; }
.gp-shopname { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.gp-late { display: inline-block; padding: 0 8px; border-radius: 999px; border: 1px solid var(--red); color: var(--red); font-size: 12px; font-weight: 600; white-space: nowrap; }
.gp-since { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); font-weight: 400; }
.gp-over small { display: block; font-size: 12px; font-weight: 400; }
.gp-ln { color: var(--text); white-space: nowrap; }
.gp-ln.done { color: var(--green); font-weight: 600; }
.gp-ln.bad { color: var(--red); }
.gp-ln.none { color: var(--faint); }
.gp-acts { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
/* 重複款清單 */
.gp-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 0 16px 14px; }
.gp-f { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.gp-f select { font: inherit; font-size: 14px; height: 38px; max-width: 220px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--card); color: var(--text); }
.gp-search { flex: 1 1 240px; min-width: 200px; }
.gp-search input { width: 100%; font: inherit; font-size: 14px; height: 38px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--card); color: var(--text); }
.gp-dups table { min-width: 880px; }
.gp-dups th { background: var(--hover); color: var(--muted); font-weight: 600; }
.gp-dups td { vertical-align: top; }
.gp-scs { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.gp-dups td:nth-child(3), .gp-dups th:nth-child(3) { width: 48%; }
.gp-sc { padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--card); min-width: 0; }
.gp-sc.keep { border-color: var(--green); }
.gp-sc.out { border-color: var(--red); }
.gp-sc.tmp { border-color: var(--line-strong); }
.gp-sc-t { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.gp-sc-s { margin-top: 2px; font-size: 12px; color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
.gp-tag { display: inline-block; padding: 0 8px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; font-weight: 600; }
.gp-tag.keep { border-color: var(--green); color: var(--green); }
.gp-tag.out { border-color: var(--red); color: var(--red); }
.gp-sc.tmp .gp-tag { border-color: var(--line-strong); color: var(--muted); font-weight: 400; }
.gp-period { white-space: nowrap; }
.gp-st { display: inline-flex; align-items: baseline; gap: 7px; line-height: 1.5; }
.gp-st::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; transform: translateY(-1px); }
.gp-st.out { color: var(--red); font-weight: 600; } .gp-st.out::before { background: var(--red); }
.gp-st.skip { color: var(--muted); } .gp-st.skip::before { background: var(--line-strong); }
.gp-outsider table, .gp-gone table, .gp-skip table { min-width: 640px; }
@media (max-width: 820px) {
  .gp-page { gap: 20px; }
  .gp-cards { grid-template-columns: 1fr; gap: 12px; }
  .gp-card { min-height: 0; padding: 16px; }
  .gp-matrix table { min-width: 0; }
  .gp-matrix th, .gp-matrix td { padding: 4px 3px; font-size: 13px; }
  .gp-matrix thead th { font-size: 12px; }
  .gp-matrix tbody th { width: 78px; padding-left: 8px; font-size: 12px; }
  .gp-f { flex: 1 1 140px; }
  .gp-f select { flex: 1; max-width: none; min-width: 0; }
  .gp-search { flex-basis: 100%; }
  .gp-dups .pm-table { overflow-x: visible; }
  .gp-dups table, .gp-dups tbody, .gp-dups tr, .gp-dups td { display: block; min-width: 0; width: 100%; }
  .gp-dups thead { display: none; }
  .gp-dups tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .gp-dups td { padding: 2px 0; border: 0; width: 100%; }
  .gp-dups td[data-l]::before { content: attr(data-l); display: block; font-size: 12px; color: var(--faint); }
  .gp-name { max-width: none; }
}
.gp-time { white-space: nowrap; }
