:root {
  --bg: #f1f1f1; --card: #fff; --ink: #303030; --muted: #616161; --line: #e3e3e3; --soft: #f7f7f7;
  --good: #29845a; --good-bg: #cdfee1; --warn-bg: #fff1e3; --bad: #8e1f0b; --bad-bg: #fee9e8; --accent: #303030; --auto: #e3f7ea; --hl: #f4fbf6;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 13px/1.5 -apple-system, BlinkMacSystemFont, "San Francisco", "Segoe UI", "PingFang TC", "Noto Sans TC", sans-serif; }
#app { max-width: 1200px; margin: 0 auto; padding: 16px 16px 48px; }
.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.top h1 { font-size: 20px; margin: 2px 0; font-weight: 650; }
.eyebrow { color: var(--muted); font-size: 12px; }
.sub { color: var(--muted); }
.top-side { display: flex; gap: 8px; align-items: center; }
.tabs { display: flex; gap: 4px; margin: 14px 0 12px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.tab { border: 0; background: none; padding: 8px 14px; font: inherit; font-weight: 550; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab.on { color: var(--ink); border-bottom-color: var(--ink); }
.tab:focus-visible, .chip:focus-visible, .x:focus-visible { outline: 2px solid #005bd3; outline-offset: 1px; }
.devbar { background: #fff8db; border: 1px solid #f1d28a; padding: 6px 10px; border-radius: 8px; margin-bottom: 10px; font-size: 12px; }
.body { display: grid; gap: 12px; }
.body > s-banner, .top + nav + s-banner { display: block; }
s-banner { display: block; margin-bottom: 4px; }
.card { background: var(--card); border-radius: 12px; padding: 14px 16px; box-shadow: 0 1px 0 rgba(0,0,0,.07), inset 0 0 0 1px rgba(0,0,0,.03); min-width: 0; }
.card h2 { font-size: 14px; margin: 0 0 10px; font-weight: 650; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--card); border-radius: 12px; padding: 12px 14px; box-shadow: 0 1px 0 rgba(0,0,0,.07); }
.stat-l { color: var(--muted); font-size: 12px; }
.stat-v { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; }
.stat-h { color: var(--muted); font-size: 12px; }
.stat.good .stat-v { color: var(--good); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.step { display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; align-items: center; }
.step p { margin: 0; color: var(--muted); }
.dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #c9c9c9; display: grid; place-items: center; font-size: 12px; color: #fff; }
.step.done .dot { background: var(--good); border-color: var(--good); }
.tbl { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: left; font-weight: 550; color: var(--muted); background: var(--soft); padding: 7px 8px; white-space: nowrap; border-bottom: 1px solid var(--line); }
td { padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.num { text-align: right; white-space: nowrap; }
th.num { text-align: right; }
.strong { font-weight: 700; }
.muted { color: var(--muted); }
tr.hl td { background: var(--hl); }
.in { font: inherit; border: 1px solid #8a8a8a; border-radius: 8px; padding: 5px 8px; min-width: 0; width: 100%; background: #fff; color: var(--ink); }
.in:focus { outline: 2px solid #005bd3; outline-offset: 0; border-color: #005bd3; }
select.in { padding-right: 24px; }
.in.auto { background: var(--auto); }
table.edit td { padding: 4px 4px; }
table.edit .in { min-width: 110px; }
table.edit .in.w-s { min-width: 80px; }
table.edit .in.w-xs { min-width: 56px; }
table.edit .w-map { min-width: 190px; }
table.edit select.in { min-width: 190px; }
.x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 14px; padding: 4px 6px; border-radius: 6px; }
.x:hover { background: var(--bad-bg); color: var(--bad); }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.hint { color: var(--muted); font-size: 12px; margin: 6px 0; }
.hint.right { text-align: right; }
.empty { color: var(--muted); margin: 4px 0; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 4px 12px; font: inherit; cursor: pointer; }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.grp-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.grp-head h3 { margin: 0; font-size: 14px; }
table.cnt th, table.cnt td { padding: 5px 6px; }
.in.big { width: 72px; font-size: 15px; padding: 6px 8px; text-align: right; }
.reason { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--muted); }
.reason select { max-width: 260px; }
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.form label { display: grid; gap: 4px; color: var(--muted); }
.lnk { color: #005bd3; text-decoration: none; font-weight: 550; }
.lnk:hover { text-decoration: underline; }
.loading { display: grid; place-items: center; padding: 60px 0; color: var(--muted); }
.dlg { border: 0; border-radius: 12px; padding: 18px 20px; max-width: 420px; width: calc(100% - 32px); box-shadow: 0 10px 40px rgba(0,0,0,.2); }
.dlg h2 { font-size: 16px; margin: 0 0 8px; }
.dlg-act { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.btn { font: inherit; font-weight: 550; padding: 6px 14px; border-radius: 8px; border: 1px solid #c9c9c9; background: #fff; cursor: pointer; }
.btn.primary { background: #303030; color: #fff; border-color: #303030; }
@media (max-width: 600px) {
  #app { padding: 12px 12px 40px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .step { grid-template-columns: 24px 1fr; }
  .step s-button { grid-column: 2; justify-self: start; }
}
/* 按鈕、標籤、提示框（仿 Shopify 後台） */
.btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 550; padding: 6px 12px; border-radius: 8px; border: 0; background: #fff; color: var(--ink); cursor: pointer; box-shadow: 0 0 0 1px #d4d4d4 inset, 0 1px 0 rgba(0,0,0,.08); white-space: nowrap; }
.btn:hover { background: #f7f7f7; }
.btn.primary { background: #303030; color: #fff; box-shadow: 0 1px 0 rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.2); }
.btn.primary:hover { background: #1a1a1a; }
.btn.plain { background: none; box-shadow: none; color: #005bd3; padding-inline: 6px; }
.btn.plain:hover { background: #f0f5ff; }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.busy::after { content: ""; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn:focus-visible { outline: 2px solid #005bd3; outline-offset: 2px; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 8px; font-size: 12px; font-weight: 550; background: #ebebeb; color: #303030; }
.badge.success { background: var(--good-bg); color: #0c5132; }
.badge.warning { background: #ffd6a4; color: #5e4200; }
.badge.critical { background: #fedad9; color: var(--bad); }
.badge.info { background: #e0f0ff; color: #00527c; }
.banner { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: #fff; box-shadow: 0 1px 0 rgba(0,0,0,.07); border-left: 4px solid #8a8a8a; margin-bottom: 6px; line-height: 1.6; }
.banner.success { background: #f1fdf5; border-left-color: var(--good); }
.banner.warning { background: var(--warn-bg); border-left-color: #e8a33a; }
.banner.critical { background: var(--bad-bg); border-left-color: #c5280c; }
.banner.info { background: #f0f8ff; border-left-color: #2e8ae0; }
.spin { width: 28px; height: 28px; border: 3px solid #c9c9c9; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin, .btn.busy::after { animation-duration: 3s; } }
table.cnt { width: auto; min-width: min(560px, 100%); }
table.cnt th, table.cnt td { padding: 5px 14px 5px 6px; }
.filters + .tbl { margin-top: 10px; }
@media (max-width: 600px) {
  table.cnt { min-width: 0; width: 100%; }
  table.cnt th, table.cnt td { padding: 5px 4px; }
  .in.big { width: 58px; }
  .card { padding: 12px; }
}
.tabs { scrollbar-width: none; } .tabs::-webkit-scrollbar { display: none; }
.th-cell { width: 48px; }
.thumb { display: grid; place-items: center; width: 36px; height: 48px; border-radius: 8px; overflow: hidden; background: var(--soft); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); font-weight: 600; text-decoration: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
a.thumb:hover { box-shadow: inset 0 0 0 2px #005bd3; }
a.thumb:focus-visible { outline: 2px solid #005bd3; outline-offset: 1px; }
.thumb.empty { box-shadow: inset 0 0 0 1px dashed var(--line); background: none; }
.grp-note { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.reason { flex-wrap: wrap; }
.chip.sm { padding: 3px 10px; font-size: 12px; }
table.edit .in.map { min-width: 220px; }
.in.bad { border-color: #c5280c; background: var(--bad-bg); }
.btn.danger-fill { background: #c5280c; color: #fff; box-shadow: none; } .btn.danger-fill:disabled { opacity: .4; }
