/* 播單 BoTally 設計系統 v3
   風格：明亮黃 × 黑描邊 × 硬陰影的活潑卡片（參考老闆提供的 App 範例），
   留白與字級層次維持專業感；手機優先 RWD。 */
:root{
  --bg:#F7F2E6;--paper:#FFFFFF;--paper-2:#FBF7EE;--ink:#141210;--ink-2:#3A3630;--muted:#7A7468;--line:#E8E2D4;--line-2:#D9D2C2;
  --brand:#F9D94E;--brand-2:#FFE98A;--mint:#BFE9D3;--pink:#F9BFCF;--sky:#BFDCF2;--sun:#FBE38F;--orange:#F8B36B;--lav:#D9D2F2;--gray:#ECE8DF;
  --red:#D6453D;--green:#1F8F5F;--blue:#2A6FB0;
  --r-sm:10px;--r:14px;--r-lg:18px;--bw:2px;
  --sh:3px 3px 0 var(--ink);--sh-lg:5px 5px 0 var(--ink);--sh-soft:0 1px 2px rgba(20,18,16,.05),0 8px 24px rgba(20,18,16,.06);
  --font:"Noto Sans TC","PingFang TC","Microsoft JhengHei",system-ui,sans-serif;--mono:ui-monospace,"JetBrains Mono",Consolas,monospace;
}
*{box-sizing:border-box}
/* hidden 一定要藏：.row / .field 這類有 display 的 class 會蓋掉瀏覽器預設的 [hidden] */
[hidden]{display:none!important}html,body{margin:0;background:var(--bg);color:var(--ink);font:14px/1.55 var(--font);-webkit-font-smoothing:antialiased;overflow-x:hidden}
a{color:inherit}h1,h2,h3,h4{margin:0;font-weight:900;letter-spacing:.01em;line-height:1.25}
h1{font-size:24px}h2{font-size:20px}h3{font-size:16px}h4{font-size:14px}
p{margin:0 0 8px}code{font-family:var(--mono);font-size:12px;background:var(--paper-2);padding:1px 5px;border-radius:4px}
.wrap{max-width:1560px;margin:0 auto;padding:20px 24px 56px}
.muted{color:var(--muted)}.right{text-align:right}.center{text-align:center}.mono{font-family:var(--mono);font-variant-numeric:tabular-nums}
.num{font-variant-numeric:tabular-nums;text-align:right}.sp{flex:1}.nowrap{white-space:nowrap}.small{font-size:12px}
/* ---------- 導覽 ---------- */
.nav{display:flex;gap:6px;align-items:center;height:60px;padding:0 20px;background:var(--brand);border-bottom:var(--bw) solid var(--ink);position:sticky;top:0;z-index:20}
.nav .brand{display:flex;align-items:center;gap:8px;font-weight:900;font-size:19px;margin-right:10px;text-decoration:none;white-space:nowrap}
.nav .brand .logo{width:36px;height:36px;border-radius:10px;display:block;flex:none;object-fit:contain}
.nav-items{display:flex;gap:4px;align-items:center;overflow-x:auto;scrollbar-width:none;min-width:0}.nav-items::-webkit-scrollbar{display:none}
.nav a.item{display:flex;align-items:center;gap:6px;height:38px;padding:0 13px;border-radius:999px;text-decoration:none;font-weight:800;color:var(--ink);white-space:nowrap;border:var(--bw) solid transparent;flex:none}
.nav a.item:hover{background:var(--brand-2);border-color:var(--ink)}.nav a.item.on{background:var(--ink);color:#fff;border-color:var(--ink);box-shadow:2px 2px 0 rgba(0,0,0,.25)}
.nav a.item svg{width:16px;height:16px;flex:none}
.nav .me{display:flex;align-items:center;gap:8px;font-size:13px;white-space:nowrap;flex:none}
.nav .avatar{width:32px;height:32px;border-radius:50%;background:var(--paper);border:var(--bw) solid var(--ink);display:grid;place-items:center;font-weight:900;flex:none}
/* ---------- 版面 ---------- */
.page-head{display:flex;align-items:center;gap:12px;margin-bottom:16px;flex-wrap:wrap}
.page-head h1{margin-right:6px}.page-head .actions{margin-left:auto;display:flex;gap:8px;flex-wrap:wrap}
.toolbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.toolbar input,.toolbar select{width:auto}
.toolbar input[type=text],.toolbar input:not([type]){min-width:200px}
.row{display:flex;gap:12px;flex-wrap:wrap;align-items:flex-end}.row>.field{flex:1;min-width:140px}
.grid{display:grid;gap:16px}.g2{grid-template-columns:repeat(2,minmax(0,1fr))}.g3{grid-template-columns:repeat(3,minmax(0,1fr))}
/* ---------- 卡片 ---------- */
.card{background:var(--paper);border:var(--bw) solid var(--ink);border-radius:var(--r-lg);box-shadow:var(--sh);padding:18px}
.card.tight{padding:12px}.card.flat{box-shadow:none;border-color:var(--line-2);border-width:1px}.card>h3{margin-bottom:12px}
.card.hero{box-shadow:var(--sh-lg)}
.card.mint{background:var(--mint)}.card.pink{background:var(--pink)}.card.sky{background:var(--sky)}.card.sun{background:var(--sun)}.card.paper2{background:var(--paper-2)}.card.brand{background:var(--brand)}
.notice{padding:10px 14px;border-radius:var(--r);border:1.5px solid var(--line-2);background:var(--paper-2);font-size:13px}
.notice.warn{background:#FFF4DA;border-color:#EFC46A}.notice.err{background:#FDECEB;border-color:#EFA9A4}.notice.ok{background:#E7F6EE;border-color:#9ED9BF}
/* ---------- 按鈕 ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;height:38px;padding:0 16px;border:var(--bw) solid var(--ink);border-radius:999px;background:var(--paper);color:var(--ink);font:800 13px/1 var(--font);cursor:pointer;text-decoration:none;white-space:nowrap;box-shadow:2px 2px 0 var(--ink);transition:transform .05s,box-shadow .05s,background .1s}
.btn:hover{background:var(--paper-2)}.btn:active{transform:translate(2px,2px);box-shadow:none}
.btn.primary{background:var(--ink);color:#fff}.btn.primary:hover{background:var(--ink-2)}
.btn.hero{font-size:15px;height:46px;padding:0 22px;box-shadow:var(--sh)}
.btn.brand{background:var(--brand)}.btn.mint{background:var(--mint)}.btn.pink{background:var(--pink)}.btn.sky{background:var(--sky)}.btn.sun{background:var(--sun)}.btn.orange{background:var(--orange)}
.btn.ghost{border-color:transparent;background:transparent;box-shadow:none}.btn.ghost:hover{background:var(--paper-2);border-color:var(--ink)}
.btn.sm{height:32px;padding:0 12px;font-size:12px;box-shadow:2px 2px 0 var(--ink)}.btn.xs{height:26px;padding:0 9px;font-size:11px;border-width:1.5px;box-shadow:1.5px 1.5px 0 var(--ink)}
.btn.big{height:58px;font-size:20px;padding:0 30px;border-radius:var(--r-lg);box-shadow:var(--sh-lg)}.btn.big:active{transform:translate(4px,4px);box-shadow:none}
.btn.danger{color:var(--red)}.btn[disabled]{opacity:.35;pointer-events:none;box-shadow:none}
.btn svg{width:16px;height:16px;flex:none}.btn.xs svg{width:12px;height:12px}
.fb{background:#1877F2;color:#fff}.fb:hover{background:#1466d8}
/* ---------- 表單 ---------- */
input,select,textarea{font:inherit;color:var(--ink);padding:0 12px;height:40px;border:var(--bw) solid var(--ink);border-radius:var(--r-sm);background:var(--paper);width:100%;transition:box-shadow .1s}
textarea{height:auto;padding:8px 12px;min-height:72px}input:focus,select:focus,textarea:focus{outline:none;box-shadow:3px 3px 0 var(--ink)}
input[readonly]{background:var(--paper-2);color:var(--muted)}
input[type=checkbox],input[type=radio]{width:18px;height:18px;accent-color:var(--ink);vertical-align:-4px;margin-right:6px;padding:0}
label{font-weight:800;font-size:12px;color:var(--ink-2);display:block;margin-bottom:5px}label.inline{display:inline-flex;align-items:center;gap:4px;font-weight:700;font-size:13px;margin:4px 14px 4px 0}
.field{margin-bottom:12px}.field .help{font-size:12px;color:var(--muted);margin-top:3px}
.seg{display:inline-flex;flex:none;border:var(--bw) solid var(--ink);border-radius:999px;overflow:hidden;background:var(--paper);white-space:nowrap;box-shadow:2px 2px 0 var(--ink)}
.seg label{margin:0;padding:0 14px;height:36px;display:flex;align-items:center;font-weight:900;cursor:pointer;font-size:13px;white-space:nowrap}
.seg input{display:none}.seg input:checked+span{background:var(--ink);color:#fff;margin:0 -14px;padding:0 14px;height:100%;display:flex;align-items:center}
/* ---------- 表格 ---------- */
.table-wrap{overflow:auto;border:var(--bw) solid var(--ink);border-radius:var(--r);background:var(--paper);box-shadow:var(--sh);-webkit-overflow-scrolling:touch}
table{width:100%;border-collapse:collapse;background:var(--paper);font-size:13px;min-width:640px}
th{position:sticky;top:0;background:var(--sun);border-bottom:var(--bw) solid var(--ink);font-size:12px;color:var(--ink);font-weight:900;padding:10px 12px;text-align:left;white-space:nowrap;z-index:1}
td{padding:10px 12px;border-bottom:1px solid var(--line);vertical-align:middle}tr:last-child td{border-bottom:none}
tbody tr:hover td{background:#FFFBEA}td.num,th.num{text-align:right;font-variant-numeric:tabular-nums}
td .sub{display:block;font-size:11px;color:var(--muted);font-family:var(--mono)}
.empty{padding:40px 16px;text-align:center;color:var(--muted)}.empty .ico{font-size:34px;margin-bottom:6px}
/* ---------- 標籤 / 狀態 ---------- */
.tag{display:inline-flex;align-items:center;gap:3px;height:22px;padding:0 9px;border-radius:999px;font-size:11px;font-weight:900;background:var(--gray);color:var(--ink);white-space:nowrap;border:1.5px solid var(--ink)}
.tag.sun{background:var(--sun)}.tag.mint{background:var(--mint)}.tag.sky{background:var(--sky)}.tag.pink{background:var(--pink)}.tag.lav{background:var(--lav)}.tag.orange{background:var(--orange)}
.tag.red{background:var(--red);color:#fff;border-color:var(--red)}.tag.ink{background:var(--ink);color:#fff}.tag.line{background:var(--paper)}
.st-pending{background:var(--sun)}.st-preorder{background:var(--pink)}.st-established{background:var(--mint)}.st-paid{background:var(--sky)}.st-shipped{background:var(--lav)}.st-closed{background:var(--gray)}
.st-trashed_seller,.st-trashed_buyer,.st-cancelled{background:var(--gray);color:var(--muted);border-color:var(--line-2)}.st-unpaid{background:var(--sun)}.st-pending_confirm{background:var(--orange)}
/* ---------- 直播小幫手 ---------- */
.console{display:grid;grid-template-columns:minmax(0,1fr) 440px;gap:16px;align-items:start}
.livebar{display:flex;align-items:center;gap:10px;padding:10px 14px;background:var(--paper);border:var(--bw) solid var(--ink);border-radius:var(--r);margin-bottom:14px;box-shadow:var(--sh);flex-wrap:wrap}
.livebar .dotlive{width:10px;height:10px;border-radius:50%;background:var(--red);border:1.5px solid var(--ink);animation:pulse 1.4s infinite;flex:none}
@keyframes pulse{0%{box-shadow:0 0 0 0 rgba(214,69,61,.45)}70%{box-shadow:0 0 0 7px rgba(214,69,61,0)}100%{box-shadow:0 0 0 0 rgba(214,69,61,0)}}
.lot-hero{border:var(--bw) solid var(--ink);border-radius:var(--r-lg);background:var(--brand);box-shadow:var(--sh-lg);padding:16px 18px;display:flex;gap:16px;align-items:center;margin-bottom:14px;flex-wrap:wrap}
.lot-hero.auction{background:var(--orange)}.lot-hero.discount{background:var(--pink)}
.lot-hero .no{font-size:12px;font-weight:900;letter-spacing:.08em;opacity:.75}.lot-hero .name{font-size:24px;font-weight:900}.lot-hero .meta{font-size:13px;margin-top:2px}
.lot-hero .cd{font-family:var(--mono);font-size:28px;font-weight:900;color:var(--red);min-width:76px;text-align:center;background:var(--paper);border:var(--bw) solid var(--ink);border-radius:12px;padding:4px 8px}
.stat{border:var(--bw) solid var(--ink);border-radius:var(--r-lg);background:var(--pink);box-shadow:var(--sh-lg);padding:14px 16px;text-align:center}
.stat.auction{background:var(--orange)}.stat .l{font-size:12px;font-weight:900;letter-spacing:.08em}.stat .n{font-size:54px;font-weight:900;line-height:1;font-variant-numeric:tabular-nums;margin:4px 0}
.stat .n small{font-size:18px}.stat .sub{font-size:14px;font-weight:900}.stat .meta{font-size:12px;color:var(--ink-2);margin-top:6px}
.panel{display:flex;flex-direction:column;height:calc(100vh - 220px);min-height:480px;padding:12px}
.panel #panel{flex:1;min-height:0;display:flex;flex-direction:column}
.panel .list{flex:1;min-height:0;overflow-y:auto;padding:2px 4px 2px 0;margin:8px 0;overscroll-behavior:contain}
.cm{display:flex;gap:8px;align-items:flex-start;padding:7px 9px;border-radius:12px;border:1.5px solid var(--line-2);margin-bottom:5px;background:var(--paper);font-size:13px}
.cm .dot{width:9px;height:9px;border-radius:50%;background:var(--line-2);flex:none;margin-top:7px;border:1px solid var(--ink)}
.cm .who{font-weight:900;white-space:nowrap;max-width:110px;overflow:hidden;text-overflow:ellipsis}.cm .txt{flex:1;word-break:break-all;line-height:1.45}
.cm .act{white-space:nowrap;display:flex;gap:4px;align-items:center}.cm .act input,.cm .act select{height:26px;padding:0 5px;font-size:12px;border-radius:7px;border-width:1.5px}
.cm.page{background:#EEF5FB;border-color:#9FC3DE;color:var(--ink-2)}.cm.page .dot{background:var(--blue)}
.cm.matched{background:#E9F7F0;border-color:#8ED4B4}.cm.matched .dot{background:var(--green)}
.cm.bid{background:#FFF4DA;border-color:#EFC46A}.cm.bid .dot{background:#E39A2B}
.cm.manual{background:#FDECEB;border-color:#EFA9A4}.cm.manual .dot{background:var(--red)}
.cm.rejected{opacity:.55}.cm.ignored .dot{background:var(--line-2)}
.cm.superseded{background:var(--paper-2);border-color:var(--line-2)}.cm.superseded .dot{background:#fff;border-style:dashed}
.win{display:flex;align-items:center;gap:10px;padding:8px 4px;border-bottom:1px dashed var(--line-2);flex-wrap:wrap}.win:last-child{border-bottom:none}
.win .amt{font-family:var(--mono);font-weight:900;font-size:15px;min-width:70px}.win .name{font-weight:900}.win .note{color:var(--muted);font-size:12px}
.win input[type=number]{width:62px;height:28px;padding:0 6px;font-size:12px;border-radius:7px;border-width:1.5px}
.hist{display:flex;gap:12px;align-items:center;padding:10px 4px;border-bottom:1px dashed var(--line-2);flex-wrap:wrap}.hist:last-child{border-bottom:none}
.hist .thumb{width:44px;height:44px;border:var(--bw) solid var(--ink);border-radius:10px;background:var(--sun);flex:none;display:grid;place-items:center;font-weight:900;font-size:12px}
.kbd{display:inline-block;border:1px solid currentColor;border-radius:5px;padding:0 5px;font-size:10px;font-family:var(--mono);opacity:.7;margin-left:4px}
.modal{position:fixed;inset:0;background:rgba(20,18,16,.5);display:flex;align-items:center;justify-content:center;z-index:40;padding:12px}
.modal .card{width:min(760px,96vw);max-height:92vh;overflow:auto}
.toast{position:fixed;right:16px;bottom:16px;background:var(--ink);color:#fff;padding:10px 16px;border-radius:12px;z-index:50;box-shadow:var(--sh-soft);font-weight:800;font-size:13px;border:var(--bw) solid #fff}
.toast.err{background:var(--red)}.toast:empty{display:none}
.auth{max-width:420px;margin:48px auto;padding:0 8px}.auth .logo{width:84px;height:84px;display:block;object-fit:contain;margin-bottom:14px}
.kv{display:grid;grid-template-columns:110px 1fr;gap:6px 12px;font-size:13px}.kv dt{color:var(--muted)}.kv dd{margin:0}
details>summary{cursor:pointer;list-style:none}details>summary::-webkit-details-marker{display:none}
.skeleton{background:linear-gradient(90deg,var(--paper-2),#F1ECE0,var(--paper-2));background-size:200% 100%;animation:sk 1.2s infinite;border-radius:8px;height:14px}
@keyframes sk{0%{background-position:200% 0}100%{background-position:-200% 0}}
/* ---------- RWD ---------- */
@media(max-width:1150px){.console{grid-template-columns:1fr}.panel{height:auto;min-height:0}.panel .list{max-height:52vh}}
@media(max-width:1000px){.g2,.g3{grid-template-columns:1fr}}
@media(max-width:820px){
  .wrap{padding:12px 12px 40px}
  .nav{height:56px;padding:0 10px;gap:4px}.nav .brand{font-size:17px;margin-right:4px}.nav .brand-text{display:none}
  .nav a.item{padding:0 10px;height:34px}.nav a.item span{display:none}.nav a.item.on span{display:inline}
  .nav .me-text{display:none}
  .page-head h1{font-size:20px}.page-head .actions{margin-left:0;width:100%}
  .toolbar input[type=text],.toolbar input:not([type]){min-width:0;flex:1}
  .card{padding:14px;border-radius:var(--r)}.lot-hero{padding:12px 14px}.lot-hero .name{font-size:20px}
  .btn.big{height:52px;font-size:18px;padding:0 20px;width:100%}.btn.hero{width:100%}
  .stat .n{font-size:44px}
  .row>.field{min-width:100%}
  .kv{grid-template-columns:1fr}
}
@media print{.nav,.noprint{display:none}body{background:#fff}.card{box-shadow:none;border:none}}

/* 得標區數量控制 */
.qtyctl{display:inline-flex;align-items:center;border:var(--bw) solid var(--ink);border-radius:999px;overflow:hidden;background:var(--paper);height:30px}
.qtyctl button{border:none;background:transparent;width:30px;height:30px;font-weight:900;font-size:16px;cursor:pointer;color:var(--ink)}
.qtyctl button:hover{background:var(--paper-2)}.qtyctl button[disabled]{opacity:.3;cursor:default}
.qtyctl input{width:52px;height:30px;border:none;border-left:1.5px solid var(--line-2);border-right:1.5px solid var(--line-2);border-radius:0;text-align:center;font:900 14px var(--mono);padding:0;box-shadow:none;-moz-appearance:textfield}
.qtyctl input::-webkit-outer-spin-button,.qtyctl input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.qtyctl input:focus{box-shadow:none;background:var(--sun)}
/* 付款方式選項 */
.paygrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:8px}
.payopt{display:flex;gap:10px;align-items:center;padding:10px 12px;border:var(--bw) solid var(--ink);border-radius:var(--r);background:var(--paper);cursor:pointer;margin:0;font-weight:800;font-size:13px}
.payopt svg{width:22px;height:22px;flex:none}.payopt input{margin:0}
.payopt:has(input:checked){background:var(--sun);box-shadow:var(--sh)}
.payopt.off{opacity:.45;cursor:not-allowed;border-color:var(--line-2);box-shadow:none}
.payopt .sub{display:block;font-size:11px;color:var(--muted);font-weight:600}
/* 平台後台 */
.nav.admin{background:var(--ink)}.nav.admin .brand{color:#fff}.nav.admin .brand .logo{background:var(--brand);border-radius:50%}
.nav.admin a.item{color:#fff}.nav.admin a.item:hover{background:#333;border-color:#fff}
.nav.admin a.item.on{background:var(--brand);color:var(--ink);border-color:var(--brand);box-shadow:none}
.nav.admin .me{color:#fff}.nav.admin .me .btn{color:var(--ink)}
.impbar{position:sticky;top:60px;z-index:19;background:var(--red);color:#fff;padding:8px 16px;font-weight:800;display:flex;gap:10px;align-items:center;font-size:13px;border-bottom:var(--bw) solid var(--ink)}
.impbar .btn{color:var(--ink)}
.kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px;margin-bottom:16px}
.kpi{border:var(--bw) solid var(--ink);border-radius:var(--r-lg);background:var(--paper);box-shadow:var(--sh);padding:12px 14px}
.kpi .l{font-size:12px;color:var(--muted);font-weight:800}.kpi .n{font-size:30px;font-weight:900;line-height:1.1;font-variant-numeric:tabular-nums}
.kpi.sun{background:var(--sun)}.kpi.mint{background:var(--mint)}.kpi.sky{background:var(--sky)}.kpi.pink{background:var(--pink)}
.qr svg{width:200px;height:200px;border:var(--bw) solid var(--ink);border-radius:var(--r);background:#fff;display:block}
.dot{display:inline-block;width:10px;height:10px;border-radius:50%;background:var(--muted);vertical-align:middle;margin-right:6px}
.dot.ok{background:#2FBF71}.dot.bad{background:var(--red)}
th.sortth a{color:inherit;text-decoration:none;display:inline-flex;gap:4px;align-items:center;white-space:nowrap}
th.sortth .arrow{font-size:10px;opacity:.45}th.sortth.on .arrow{opacity:1}th.sortth.on a{text-decoration:underline;text-underline-offset:3px}
/* 頁尾 */
.foot{max-width:1560px;margin:0 auto;padding:18px 24px 28px;display:flex;gap:16px;align-items:center;flex-wrap:wrap;border-top:1.5px solid var(--line-2);font-size:13px;color:var(--muted)}
.foot-brand{display:flex;align-items:center;gap:8px;text-decoration:none;color:var(--ink)}.foot-brand img{width:26px;height:26px}
.foot-links{display:flex;gap:14px;flex-wrap:wrap}.foot-links a{color:var(--ink-2);text-decoration:none;font-weight:700}.foot-links a:hover{text-decoration:underline}
.foot-copy{margin-left:auto}
@media (max-width:640px){.foot{padding:14px 12px 24px}.foot-copy{margin-left:0;width:100%}}

/* 頁尾貼底：內容不夠高時頁尾仍在視窗底部 */
body{display:flex;flex-direction:column;min-height:100vh}
.wrap{flex:1 0 auto;width:100%;padding-bottom:28px}.foot{width:100%;margin-top:auto}
@media (max-width:640px){.wrap{padding-bottom:20px}}

/* 語系切換 */
.langsw{gap:4px;font-weight:900}.langsw-text{font-size:11px}
.foot-lang{display:inline-flex;align-items:center;gap:4px;color:var(--ink-2);text-decoration:none;font-weight:700}.foot-lang:hover{text-decoration:underline}
html.lang-en .nav a.item{padding:0 11px;font-size:13px}

/* 商品進階設定 */
.adv{border:1.5px solid var(--line-2);border-radius:var(--r);padding:10px 14px;margin:14px 0;background:var(--paper-2)}
.adv>summary{font-weight:900;font-size:14px}
.adv>summary .muted{font-weight:400;font-size:12px;margin-left:6px}
.adv[open]>summary{margin-bottom:12px;padding-bottom:8px;border-bottom:1px dashed var(--line-2)}
.flags{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:8px;margin-bottom:14px}
.flags .flag{display:flex;gap:8px;align-items:flex-start;padding:8px 10px;border:1.5px solid var(--line-2);
  border-radius:12px;background:var(--paper);cursor:pointer;font-weight:400}
.flags .flag:hover{border-color:var(--ink)}
.flags .flag input{margin-top:2px;flex:none}
.flags .flag b{display:block;font-size:13px}
.flags .flag em{display:block;font-style:normal;font-size:11px;color:var(--muted);line-height:1.4;margin-top:1px}
.field small.muted{display:block;font-size:11px;margin-top:3px}

/* 運費表 */
h4.sub{font-size:13px;font-weight:900;margin:16px 0 6px;color:var(--ink-2)}
h4.sub:first-of-type{margin-top:4px}
table.fee{width:100%;border-collapse:collapse;background:var(--paper);border:1.5px solid var(--line-2);border-radius:12px;overflow:hidden}
table.fee th{background:var(--paper-2);font-size:12px;text-align:left;padding:7px 10px;border-bottom:1.5px solid var(--line-2);font-weight:900}
table.fee th .muted{font-weight:400;font-size:11px}
table.fee td{padding:6px 10px;border-bottom:1px solid var(--line);font-size:13px;vertical-align:middle}
table.fee tr:last-child td{border-bottom:none}
table.fee td:first-child{white-space:nowrap;color:var(--ink-2)}
table.fee td .muted{font-size:11px}
table.fee input{margin:0;max-width:130px}
@media(max-width:640px){table.fee input{max-width:none}table.fee td,table.fee th{padding:5px 6px}}

/* 購物車金額明細 */
.sumbox{border:1.5px solid var(--line-2);border-radius:12px;padding:10px 12px;margin:12px 0;background:var(--paper-2)}
.sumbox>div{display:flex;justify-content:space-between;align-items:baseline;padding:3px 0;font-size:14px}
.sumbox>div span{color:var(--muted)}
.sumbox .tot{border-top:1px dashed var(--line-2);margin-top:5px;padding-top:7px}
.sumbox .tot span{color:var(--ink);font-weight:900}
.sumbox .tot b{font-size:22px}
.sumbox p{margin:6px 0 0;color:var(--red,#C0392B)}
.seg label.off{opacity:.45;cursor:not-allowed}

/* 付款細項表 / 星期選擇 */
table.fee.pay td:nth-child(n+4),table.fee.pay th:nth-child(n+4){text-align:center;width:88px}
table.fee.pay td:first-child,table.fee.pay th:first-child{text-align:center;width:52px}
table.fee.pay input[type=checkbox],table.fee.pay input[type=radio]{margin:0}
.wkdays{display:flex;gap:6px;flex-wrap:wrap}
.wkdays label{position:relative}
.wkdays input{position:absolute;opacity:0;width:0;height:0}
.wkdays span{display:grid;place-items:center;width:36px;height:36px;border:1.5px solid var(--line-2);
  border-radius:10px;background:var(--paper);font-weight:900;font-size:13px;cursor:pointer}
.wkdays input:checked+span{background:var(--ink);color:#fff;border-color:var(--ink)}

/* 自取點選單 */
.seg.col{display:flex;flex-direction:column;gap:6px;background:none;padding:0;border:none;border-radius:0}
.seg.col label{flex:none}
.seg.col label span{display:block;text-align:left;padding:9px 12px;border:1.5px solid var(--line-2);border-radius:12px;background:var(--paper)}
.seg.col label input:checked+span{background:var(--ink);color:#fff;border-color:var(--ink)}
.seg.col span em{display:block;font-style:normal;font-size:11px;opacity:.75;margin-top:2px}

/* ---------- 手機版：列表表格改成一列一張卡 ---------- */
@media(max-width:700px){
  /* 導覽列可以左右滑，右邊給一點漸層提示還有東西 */
  .nav-items{-webkit-overflow-scrolling:touch;
    mask-image:linear-gradient(to right,#000 calc(100% - 18px),transparent);
    -webkit-mask-image:linear-gradient(to right,#000 calc(100% - 18px),transparent)}
  .nav a.item span{display:none}
  .nav a.item.on span{display:inline}

  /* 篩選列吃滿整行，輸入框才不會被擠出畫面 */
  .page-head{gap:8px}
  .page-head>h1{width:100%;margin-right:0}
  .page-head .toolbar,.page-head form.toolbar{width:100%}
  .toolbar>select,.toolbar>input:not([type=checkbox]):not([type=radio]),.toolbar>.btn{height:40px}
  .toolbar>select{flex:1 1 100%;min-width:0;width:100%}
  .toolbar>input:not([type=checkbox]):not([type=radio]){flex:1 1 auto;min-width:0;width:auto}
  .toolbar>.btn{flex:0 0 auto}

  /* 表格 → 卡片。table 也要變 block，不然會保留原本的欄寬把內容推出畫面 */
  .table-wrap{overflow:visible;border:none;background:none;box-shadow:none;border-radius:0}
  .table-wrap table{display:block;width:100%;min-width:0;border-collapse:collapse;font-size:14px}
  .table-wrap tbody{display:block;width:100%}
  .table-wrap tr:first-child{display:none}          /* 表頭在卡片模式用不到 */
  .table-wrap tr{display:block;width:100%;box-sizing:border-box;margin-bottom:10px;
    border:var(--bw) solid var(--ink);border-radius:var(--r);
    background:var(--paper);box-shadow:var(--sh);padding:10px 12px}
  .table-wrap td{display:flex;align-items:baseline;justify-content:space-between;gap:12px;
    border:none;padding:3px 0;text-align:right;width:100%;box-sizing:border-box}
  .table-wrap td[data-label]::before{content:attr(data-label);color:var(--muted);font-size:12px;
    font-weight:800;text-align:left;flex:0 0 auto;white-space:nowrap}
  .table-wrap td:empty{display:none}
  .table-wrap td{flex-wrap:wrap}
  .table-wrap td .sub{flex:1 0 100%;text-align:right}   /* 副標自己一行，不要擠在值旁邊 */
  .table-wrap td[colspan]{display:block;text-align:center;width:100%}
  .table-wrap tr:has(td[colspan]){padding:0;border:none;box-shadow:none;background:none}
  /* 沒有標題的格子（勾選框、操作鈕）自己佔一行 */
  .table-wrap td:not([data-label]){justify-content:flex-start;text-align:left;flex-wrap:wrap}
  .table-wrap td.right:not([data-label]),.table-wrap td.nowrap:not([data-label]){justify-content:flex-end}
  .table-wrap td.nowrap{flex-wrap:wrap}
  .table-wrap td.nowrap .btn{flex:0 0 auto}
}

/* 手機版：商家設定的運費 / 付款 / 帳戶 / 自取點表也排成卡片，不然右邊幾欄會看不到 */
@media(max-width:700px){
  table.fee{display:block;width:100%;min-width:0;border:none;background:none;border-radius:0}
  table.fee tbody{display:block;width:100%}
  table.fee tr:first-child{display:none}
  table.fee tr{display:block;width:100%;box-sizing:border-box;margin-bottom:8px;padding:8px 10px;
    border:1.5px solid var(--line-2);border-radius:12px;background:var(--paper)}
  table.fee td{display:flex;align-items:center;justify-content:space-between;gap:10px;
    border:none;padding:4px 0;width:100%;box-sizing:border-box}
  table.fee td[data-label]::before{content:attr(data-label);font-size:12px;font-weight:800;
    color:var(--muted);flex:0 0 auto}
  table.fee td:not([data-label]){font-weight:900;font-size:14px;justify-content:flex-start;
    padding-bottom:6px;border-bottom:1px dashed var(--line-2);margin-bottom:4px}
  table.fee input{max-width:none;flex:0 1 150px}
  table.fee input[type=checkbox],table.fee input[type=radio]{flex:0 0 auto}
  table.fee.pay td:first-child{justify-content:space-between}
}
@media(max-width:700px){
  table.fee td[data-label]::before,.table-wrap td[data-label]::before{max-width:45%;white-space:normal}
}
