:root {
  --brand: #0cc0df;        /* 三鴨藍 */
  --brand-2: #39d0ea;
  --brand-ink: #0a7d97;    /* 白底上的藍字 */
  --brand-soft: #e3f7fb;
  --duck: #f5e600;         /* 鴨子黃 */
  --duck-2: #ebdc00;
  --ink: #1f2330;
  --muted: #6b7280;
  --bg: #f3fafc;
  --card: #fff;
  --line: #e0edf1;
  --green: #12b76a;
  --green-soft: #e7f8ef;
  --blue: #3b82f6;
  --blue-soft: #e8f0fe;
  --amber: #f59e0b;
  --amber-soft: #fff6e0;
  --red: #ef4444;
  --red-soft: #fdecec;
  --gray-soft: #f0f0f2;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(31, 35, 48, .04), 0 6px 24px rgba(31, 35, 48, .06);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 -apple-system, "Segoe UI", "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-ink); }

/* ── 左側工具列 ── */
:root { --side-w: 232px; }
.side-mini { --side-w: 76px; }
.with-side body { padding-left: var(--side-w); transition: padding-left .2s; }
.side {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--side-w); z-index: 30; background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 14px 12px; transition: width .2s, transform .25s; overflow: hidden;
}
.side-head { position: relative; display: flex; justify-content: center; margin: 4px 0 18px; }
.logo { display: block; text-decoration: none; line-height: 0; }
.logo img { width: 136px; height: 136px; border-radius: 50%; box-shadow: 0 6px 18px rgba(12, 192, 223, .35); transition: width .2s, height .2s; }
.side-toggle { position: absolute; top: -4px; right: -4px; background: var(--gray-soft); color: var(--muted); box-shadow: none; padding: 3px 8px; font-size: 15px; border-radius: 10px; }
.side-toggle:hover { background: var(--brand-soft); color: var(--brand-ink); }
.side nav { display: flex; flex-direction: column; gap: 4px; }
.side nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 14px; text-decoration: none;
  color: #4b5563; font-weight: 700; font-size: 15.5px; position: relative; white-space: nowrap;
}
.side nav a .ic { font-size: 20px; width: 26px; text-align: center; flex: none; }
.side nav a:hover { background: var(--gray-soft); color: var(--ink); }
.side nav a.on { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(12, 192, 223, .35); }
.side .side-bottom { margin-top: auto; border-top: 1px solid var(--line); padding-top: 10px; }
.side nav a.in .ic::after { content: ""; position: absolute; left: 32px; top: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--green); border: 2px solid #fff; }
.cart-n { display: inline-block; min-width: 20px; height: 20px; line-height: 20px; padding: 0 6px; border-radius: 99px; background: var(--duck); color: var(--ink); font-size: 12px; text-align: center; margin-left: auto; }
/* 收合：只剩圖示 */
.side-mini .side .tx { display: none; }
.side-mini .side-head { flex-direction: column; align-items: center; gap: 8px; }
.side-mini .side-toggle { position: static; }
.side-mini .side-toggle { transform: rotate(180deg); }
.side-mini .side nav a { justify-content: center; padding: 11px 0; }
.side-mini .side nav a .cart-n { position: absolute; top: 2px; right: 2px; margin: 0; }
.side-mini .side .logo img { width: 48px; height: 48px; }
/* 手機：頂欄＋抽屜 */
.topbar, .scrim { display: none; }
@media (max-width: 820px) {
  .with-side body { padding-left: 0; }
  :root, .side-mini { --side-w: 260px; }
  .side { transform: translateX(-105%); box-shadow: 10px 0 40px rgba(0, 0, 0, .15); }
  .side-open .side { transform: none; }
  .side-mini .side .tx { display: initial; }
  .side-mini .side .logo img { width: 120px; height: 120px; }
  .side-mini .side-head { flex-direction: row; }
  .side-mini .side nav a { justify-content: flex-start; padding: 11px 12px; }
  .side-mini .side nav a .cart-n { position: static; margin-left: auto; }
  .side-toggle { display: none; }
  .topbar {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; padding: 8px 12px;
    background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
  }
  .topbar .logo img { height: 42px; width: 42px; box-shadow: none; }
  .menu-btn { background: none; color: var(--ink); box-shadow: none; font-size: 24px; padding: 2px 8px; }
  .menu-btn:hover { background: var(--gray-soft); }
  .top-cart { margin-left: auto; font-size: 22px; text-decoration: none; position: relative; padding: 4px 8px; }
  .top-cart .cart-n { position: absolute; top: -2px; right: -4px; }
  .scrim { position: fixed; inset: 0; background: rgba(15, 23, 42, .35); z-index: 25; opacity: 0; pointer-events: none; transition: .2s; display: block; }
  .side-open .scrim { opacity: 1; pointer-events: auto; }
}

main { max-width: 1040px; margin: 0 auto; padding: 28px 18px 80px; }
h1 { font-size: 28px; margin: 0 0 6px; letter-spacing: -.3px; }
h2 { font-size: 19px; margin: 0 0 14px; }
.sub { color: var(--muted); margin: 0 0 22px; }
.muted { color: var(--muted); }
.hide { display: none !important; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 18px; box-shadow: var(--shadow); }
.row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.grow { flex: 1; min-width: 200px; }

/* ── 首頁橫幅 ── */
.hero {
  border-radius: 24px; padding: 30px 30px 26px; margin-bottom: 22px; color: #fff; position: relative; overflow: hidden;
  background: var(--brand);
}
.hero { display: flex; align-items: center; gap: 20px; padding: 30px 34px; }
.hero .txt { flex: 1; position: relative; z-index: 1; }
.hero .duck { width: 230px; flex: none; filter: drop-shadow(0 8px 14px rgba(0, 80, 100, .25)); }
.hero h1 { font-size: 34px; margin-bottom: 6px; font-weight: 900; text-shadow: 0 2px 0 rgba(0, 90, 110, .18); }
.hero .links { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
.hero .links a { color: #fff; font-weight: 700; text-decoration: none; background: rgba(0, 70, 90, .18); padding: 7px 14px; border-radius: 99px; font-size: 14px; }
.hero .links a:hover { background: rgba(0, 70, 90, .3); }
@media (max-width: 600px) { .hero { flex-direction: column-reverse; text-align: center; padding: 22px 18px; } .hero .duck { width: 160px; } .hero .rule, .hero .links { justify-content: center; } }
.hero p { margin: 0; opacity: .92; }
.hero .rule { margin-top: 14px; display: inline-flex; gap: 8px; flex-wrap: wrap; }
.hero .rule span { background: rgba(255, 255, 255, .22); padding: 4px 12px; border-radius: 99px; font-size: 14px; font-weight: 600; }

/* ── 步驟標題 ── */
.step-title { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 18px; font-weight: 700; }
.step-title b {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 14px;
  background: var(--brand); color: #fff; flex: none;
}

/* ── 表單 ── */
label { font-weight: 600; display: block; margin-bottom: 8px; }
input:not([type]), input[type=text], input[type=email], input[type=tel], input[type=number], input[type=password], select, textarea {
  font: inherit; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; width: 100%;
  transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(12, 192, 223, .18); }
textarea { min-height: 70px; resize: vertical; }

button, .btn {
  font: inherit; font-weight: 700; border: 0; border-radius: 12px; padding: 11px 20px; cursor: pointer;
  background: var(--duck); color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
  transition: transform .1s, background .15s, box-shadow .15s;
}
button:hover, .btn:hover { background: var(--duck-2); }
button:active { transform: scale(.98); }
button:disabled { background: #c9c4be; cursor: wait; }
button.big { font-size: 18px; padding: 15px 34px; border-radius: 14px; box-shadow: 0 6px 18px rgba(190, 175, 0, .35); }
button.ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
button.ghost:hover { background: var(--gray-soft); }
button.danger { background: var(--red); }
button.danger:hover { background: #dc2626; }
button.green { background: var(--green); }
button.green:hover { background: #0e9f5b; }
button.small { padding: 6px 12px; font-size: 14px; border-radius: 10px; }

/* 選項按鈕（取代下拉選單） */
.choices { display: flex; gap: 10px; flex-wrap: wrap; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
  display: block; padding: 10px 18px; border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer;
  background: #fff; font-weight: 600; transition: .15s; text-align: center; min-width: 110px;
}
.choice span small { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }
.choice span:hover { border-color: #9fe3f0; }
.choice input:checked + span { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-ink); }
.choice input:checked + span small { color: var(--brand-ink); }
.choice input:focus-visible + span { box-shadow: 0 0 0 3px rgba(12, 192, 223, .3); }
.choice.machine span { width: 170px; padding: 12px 12px 10px; }
.choice.machine img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; mix-blend-mode: multiply; margin-bottom: 6px; }
.choice.machine b { display: block; font-size: 17px; }
.opt-group { margin-bottom: 18px; }
.opt-group:last-child { margin-bottom: 0; }

/* 上傳區 */
.drop {
  border: 2.5px dashed #8fdcec; border-radius: var(--radius); padding: 40px 20px; text-align: center;
  color: var(--muted); cursor: pointer; transition: .15s; background: #f8fdfe;
}
.drop:hover, .drop.over { border-color: var(--brand); background: var(--brand-soft); }
.drop .icon { font-size: 44px; line-height: 1; margin-bottom: 8px; }
.drop b { color: var(--ink); font-size: 18px; }
.files { margin: 14px 0 0; padding: 0; list-style: none; }
.files li {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; background: var(--bg); margin-bottom: 8px;
}
.files li .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.qty { display: flex; align-items: center; gap: 6px; }
.qty button { width: 32px; height: 32px; padding: 0; justify-content: center; border-radius: 9px; }
.qty input { width: 56px; text-align: center; padding: 6px; }

/* ── 價格 ── */
.price-card {
  border-radius: var(--radius); padding: 24px; color: #fff; margin-bottom: 18px;
  background: linear-gradient(135deg, #0cc0df, #08a7c4); box-shadow: 0 10px 30px rgba(12, 192, 223, .28);
}
.price-card .top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.price-card .qid { background: rgba(255, 255, 255, .25); padding: 4px 12px; border-radius: 99px; font-weight: 700; letter-spacing: 1px; }
.price { font-size: 52px; font-weight: 800; line-height: 1.1; margin-top: 10px; }
.price small { font-size: 20px; font-weight: 700; margin-left: 4px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 18px; }
.stat { background: rgba(255, 255, 255, .18); border-radius: 12px; padding: 10px 14px; }
.stat b { display: block; font-size: 18px; }
.stat span { font-size: 13px; opacity: .9; }

/* 進度追蹤 */
.tracker { display: flex; justify-content: space-between; position: relative; margin: 6px 0 4px; }
.tracker::before { content: ""; position: absolute; left: 20px; right: 20px; top: 17px; height: 4px; background: var(--line); border-radius: 4px; }
.tracker .fill { position: absolute; left: 20px; top: 17px; height: 4px; background: var(--green); border-radius: 4px; transition: width .4s; }
.tracker .s { position: relative; text-align: center; flex: 1; font-size: 13px; color: var(--muted); font-weight: 600; }
.tracker .s i {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 6px; font-style: normal;
  background: #fff; border: 3px solid var(--line); font-size: 16px; position: relative;
}
.tracker .s.done i { background: var(--green); border-color: var(--green); color: #fff; }
.tracker .s.now i { border-color: var(--brand); background: var(--brand-soft); }
.tracker .s.now { color: var(--brand-ink); }
.tracker .s.done { color: var(--ink); }

.eta { font-size: 34px; font-weight: 800; color: var(--green); line-height: 1.2; }
.pay-steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.pay-steps li { counter-increment: s; position: relative; padding: 10px 0 10px 46px; border-bottom: 1px dashed var(--line); }
.pay-steps li:last-child { border: 0; }
.pay-steps li::before {
  content: counter(s); position: absolute; left: 0; top: 8px; width: 32px; height: 32px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand-ink); font-weight: 800; display: grid; place-items: center;
}
.code { font-family: Consolas, "SF Mono", monospace; font-weight: 800; background: var(--amber-soft); color: #9a5b00; padding: 2px 10px; border-radius: 8px; font-size: 1.05em; }
.copy { cursor: pointer; }
.copy:hover { background: #fff8a6; }

/* ── 狀態標籤 ── */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 99px; font-size: 13px; font-weight: 700; background: var(--gray-soft); color: var(--muted); white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.b-idle, .b-done { background: var(--green-soft); color: #0b8a50; }
.b-printing, .b-busy, .b-paid, .b-queued { background: var(--blue-soft); color: #1d64d8; }
.b-assigned, .b-overdue, .b-needs_clear, .b-paused_print, .b-quoted, .b-waiting { background: var(--amber-soft); color: #a86400; }
.b-paused, .b-offline { background: var(--gray-soft); color: var(--muted); }
.b-cancelled, .b-failed, .b-error { background: var(--red-soft); color: #c62828; }
.b-printing::before, .b-busy::before { animation: pulse 1.6s infinite; }

/* ── 機台卡片 ── */
.summary { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.summary .chip { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px 18px; box-shadow: var(--shadow); min-width: 120px; }
.summary .chip b { display: block; font-size: 26px; line-height: 1.2; }
.summary .chip span { color: var(--muted); font-size: 14px; }
.summary .chip.c-green b { color: var(--green); }
.summary .chip.c-blue b { color: var(--blue); }
.summary .chip.c-amber b { color: var(--amber); }

.printers { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.printer {
  background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; text-align: center; position: relative; overflow: hidden;
  border-top: 5px solid var(--line);
}
.printer.s-idle { border-top-color: var(--green); }
.printer.s-printing, .printer.s-busy { border-top-color: var(--blue); }
.printer.s-assigned, .printer.s-overdue, .printer.s-needs_clear, .printer.s-paused_print { border-top-color: var(--amber); }
.printer.s-error { border-top-color: var(--red); }
.printer .photo {
  width: 100%; aspect-ratio: 4 / 3; display: grid; place-items: center; border-radius: 16px; margin: 4px 0 14px;
  background: radial-gradient(circle at 50% 60%, #fff 0%, #eaf5f8 70%);
}
.printer .photo img { max-width: 78%; max-height: 92%; object-fit: contain; mix-blend-mode: multiply; }
.printer.s-offline .photo img { filter: grayscale(1) opacity(.5); }
.printer .name { font-size: 18px; font-weight: 800; }
.printer .meta { color: var(--muted); font-size: 14px; margin-bottom: 10px; }
.printer .state-line { min-height: 46px; width: 100%; }
.bar { height: 10px; background: var(--gray-soft); border-radius: 99px; overflow: hidden; margin: 12px 0 6px; width: 100%; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), #60a5fa); border-radius: 99px; transition: width .6s; }
.printer .actions { margin-top: 12px; display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; width: 100%; }

/* ── 3D 預覽 ── */
.plates { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.v3d { position: relative; border-radius: 14px; overflow: hidden; background: #eef1f4; min-height: 320px; }
.v3d canvas { display: block; touch-action: none; cursor: grab; }
.v3d canvas:active { cursor: grabbing; }
.v3d-loading { padding: 140px 20px; text-align: center; color: var(--muted); }
.v3d-bar { position: absolute; left: 10px; right: 10px; top: 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; pointer-events: none; }
.v3d-bar > * { pointer-events: auto; }
.v3d-bar label { font-weight: 600; margin: 0; background: rgba(255, 255, 255, .9); padding: 5px 12px; border-radius: 10px; }
.v3d-help { margin-left: auto; background: rgba(255, 255, 255, .8); padding: 4px 10px; border-radius: 8px; }

/* ── 表格（後台） ── */
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
.err { color: var(--red); margin-top: 12px; font-weight: 600; }
.hint { background: var(--amber-soft); border-radius: 12px; padding: 10px 14px; font-size: 14px; margin-top: 10px; text-align: left; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--green); margin-right: 6px; animation: pulse 2s infinite; vertical-align: middle; }
.spinner { display: inline-block; width: 18px; height: 18px; border: 3px solid #bfeef7; border-top-color: var(--brand); border-radius: 50%; animation: spin 1s linear infinite; vertical-align: middle; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .35; } }

/* 載入中遮罩 */
.working {
  display: flex; align-items: center; gap: 14px; background: var(--brand-soft); border-radius: 14px; padding: 14px 18px; margin-top: 16px; color: var(--brand-ink); font-weight: 600;
}

@media (max-width: 600px) {
  main { padding: 18px 12px 60px; }
  .hero { padding: 22px 20px; }
  .hero h1 { font-size: 26px; }
  .price { font-size: 42px; }
  .card { padding: 18px; }
  .tracker .s { font-size: 11px; }
  .tracker .s i { width: 32px; height: 32px; font-size: 14px; }
}

/* 結帳 */
#checkout .step-title { margin: 20px 0 10px; font-size: 16px; }
#checkout input:not([type=radio]) { width: 100%; box-sizing: border-box; }
#checkout .row input { width: auto; }
.small { font-size: 13px; }
.test-note { background: #eef6ff; border: 1px dashed #93c5fd; color: #1e40af; border-radius: 12px; padding: 10px 14px; font-size: 14px; margin-bottom: 6px; }
.store-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding: 12px 14px; border-radius: 14px; background: var(--gray-soft); }
.store-box small, .info-grid small { display: block; color: var(--muted); font-size: 13px; font-weight: 400; }
.total-box { margin: 20px 0 12px; padding: 14px 16px; border-radius: 14px; background: var(--brand-soft); }
.total-box > div { display: flex; justify-content: space-between; padding: 3px 0; }
.total-box .sum { border-top: 1.5px dashed #9fe3f0; margin-top: 6px; padding-top: 8px; font-size: 20px; color: var(--brand-ink); }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.info-grid > div { background: var(--gray-soft); border-radius: 12px; padding: 10px 14px; }
.info-grid span { display: block; font-size: 13px; color: var(--muted); }

/* 購物車徽章 / 提示 */
#toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 50; box-shadow: 0 8px 30px rgba(0,0,0,.2); }
#toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast a { color: var(--duck); margin-left: 8px; }

/* 商店 */
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.pcard { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: .15s; display: flex; flex-direction: column; }
.pcard:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(31,35,48,.1); }
.pcard .pimg { aspect-ratio: 1; background: var(--gray-soft) center/cover no-repeat; display: grid; place-items: center; font-size: 46px; position: relative; }
.pcard .soldout { position: absolute; top: 10px; left: 10px; background: var(--ink); color: #fff; font-size: 13px; padding: 2px 10px; border-radius: 99px; }
.pcard .pbody { padding: 12px 14px 16px; }
.pcard .pname { font-weight: 700; }
.pcard .pprice { color: var(--brand-ink); font-weight: 800; font-size: 18px; margin-top: 4px; }
.pdetail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; }
.gallery .main { aspect-ratio: 1; border-radius: var(--radius); background: var(--gray-soft) center/contain no-repeat; display: grid; place-items: center; font-size: 80px; }
.gallery .thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.gallery .thumbs button { width: 64px; height: 64px; padding: 0; border-radius: 12px; background: var(--gray-soft) center/cover no-repeat; border: 2px solid transparent; box-shadow: none; }
.gallery .thumbs button.on { border-color: var(--brand); }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.qty button { background: none; color: var(--ink); box-shadow: none; padding: 6px 14px; border-radius: 0; font-size: 18px; }
.qty button:hover { background: var(--gray-soft); }
.qty span { min-width: 36px; text-align: center; font-weight: 700; }
.desc { white-space: pre-wrap; color: #374151; }
@media (max-width: 720px) { .pdetail { grid-template-columns: 1fr; } }

/* 購物車 */
.cart-line { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cart-line:last-child { border-bottom: 0; }
.cart-line .thumb { width: 72px; height: 72px; border-radius: 12px; background: var(--gray-soft) center/cover no-repeat; flex: none; display: grid; place-items: center; font-size: 30px; }
.cart-line .info { flex: 1; min-width: 0; }
.cart-line .info small { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cart-line .lprice { font-weight: 800; white-space: nowrap; }
.cart-line .warn { color: var(--red); font-size: 13px; }
.tag { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 99px; background: var(--blue-soft); color: var(--blue); margin-right: 6px; font-weight: 600; vertical-align: 1px; }
.tag.p { background: var(--green-soft); color: var(--green); }
.x { background: none; color: var(--muted); box-shadow: none; padding: 4px 8px; font-size: 18px; }
.x:hover { color: var(--red); background: var(--red-soft); }
.choice input:disabled + span { opacity: .45; cursor: not-allowed; }
.b-pending { background: var(--amber-soft); color: #a86400; }
.b-ready { background: var(--green-soft); color: #0b8a50; }
.b-shipped { background: #f1e8ff; color: #7c3aed; }
button.ghost:disabled { opacity: .45; background: #fff; cursor: not-allowed; box-shadow: none; }
button:disabled { cursor: not-allowed; box-shadow: none; }

/* 首頁：進階設定 */
details.adv { margin-top: 6px; border-top: 1px dashed var(--line); padding-top: 14px; }
details.adv summary { cursor: pointer; font-weight: 700; color: var(--brand-ink); list-style: none; display: flex; align-items: center; gap: 8px; }
details.adv summary::-webkit-details-marker { display: none; }
details.adv summary::before { content: "▸"; transition: .15s; }
details.adv[open] summary::before { transform: rotate(90deg); }
details.adv summary small { color: var(--muted); font-weight: 400; }
details.adv > div { margin-top: 16px; }
.submit-bar { position: sticky; bottom: 0; z-index: 5; padding: 14px 0 10px; text-align: center; background: linear-gradient(transparent, var(--bg) 35%); }

/* 後台頂欄 */
.admin-head { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.admin-head .wrap { max-width: 1200px; margin: 0 auto; padding: 10px 18px; display: flex; align-items: center; gap: 12px; }
.admin-head img { width: 44px; height: 44px; border-radius: 50%; }
.admin-head b { font-size: 18px; }
.admin-head nav { margin-left: auto; display: flex; gap: 14px; }
.admin-head nav a { color: var(--muted); text-decoration: none; font-weight: 600; }

/* 買四送一 */
.promo-tag { display: inline-block; background: var(--duck); color: #3a3300; font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 999px; margin-left: 4px; vertical-align: 1px; }
.pcard .promo-tag { margin: 4px 0 0; }
.promo-bar { background: #fffbd1; border: 1px solid #f0e27a; color: #5a4d00; border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; font-size: 14px; }
.free-note { color: #c2410c; font-weight: 700; }
.total-box .disc b, .total-box .disc span { color: #c2410c; }

/* 購物車勾選 */
.cart-line .pick { flex: none; display: grid; place-items: center; cursor: pointer; padding: 4px; }
.cart-line .pick input, .pick-all input { width: 20px; height: 20px; accent-color: var(--brand-ink); cursor: pointer; margin: 0; }
.cart-line.off .thumb, .cart-line.off .info, .cart-line.off .lprice { opacity: .45; }
.pick-all { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pick-all label { display: flex; align-items: center; gap: 8px; font-weight: 700; cursor: pointer; }
.sold { color: var(--muted); font-size: 12px; }

/* 估價進度浮窗 */
#quoteTrack { position: fixed; right: 16px; bottom: 16px; z-index: 40; display: flex; flex-direction: column; gap: 10px; width: min(320px, calc(100vw - 32px)); }
#quoteTrack .qt { position: relative; display: block; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px 16px; box-shadow: 0 8px 30px rgba(31,35,48,.16); text-decoration: none; color: var(--ink); }
#quoteTrack .qt a { color: inherit; text-decoration: none; display: block; padding-right: 22px; }
#quoteTrack .qt small { display: block; color: var(--muted, #667); margin-top: 2px; }
#quoteTrack .qt .bar { margin: 8px 0 4px; }
#quoteTrack .qt.ok { border-color: #86d9a0; }
#quoteTrack .qt.bad { border-color: #f2a5a5; }
#quoteTrack .qt button { position: absolute; top: 6px; right: 8px; border: 0; background: none; cursor: pointer; font-size: 15px; color: #889; padding: 4px; }
.slicing-card .bar { height: 14px; }
.slicing-card .big-pct { font-size: 40px; font-weight: 800; color: var(--brand-ink); }

/* ── 首頁 / 說明頁 / 頁尾 ── */
.hero.home-hero { flex-direction: column; justify-content: center; text-align: center; padding: 38px 24px; gap: 4px; }
.hero.home-hero .duck { width: 120px !important; margin: 0 0 4px !important; }
.home-hero h1 { font-size: 40px; margin: 0 0 8px; }
.home-hero .cta { margin-top: 22px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.home-hero .cta a { text-decoration: none; font-weight: 800; padding: 12px 26px; border-radius: 99px; font-size: 17px; }
.home-hero .cta .y { background: var(--duck); color: var(--ink); }
.home-hero .cta .w { background: rgba(255,255,255,.9); color: var(--brand-ink); }
.entry { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin-bottom: 18px; }
.entry a { display: block; text-decoration: none; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); transition: transform .15s; }
.entry a:hover { transform: translateY(-3px); }
.entry .ic { font-size: 40px; }
.entry h3 { margin: 8px 0 4px; }
.entry p { margin: 0; color: var(--muted); font-size: 15px; }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-top: 14px; }
.steps div { background: var(--brand-soft); border-radius: 14px; padding: 14px 16px; font-size: 15px; }
.steps b { display: block; color: var(--brand-ink); margin-bottom: 2px; }
.doc h2 { margin-top: 28px; font-size: 21px; }
.doc h2:first-child { margin-top: 0; }
.doc li { margin: 4px 0; }
.doc .warn { background: var(--amber-soft); border-radius: 12px; padding: 12px 16px; }
.toc { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.toc a { background: var(--brand-soft); border-radius: 99px; padding: 5px 14px; text-decoration: none; font-size: 14px; font-weight: 600; }
.site-foot { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); }
.site-foot .fl { display: flex; gap: 6px 18px; justify-content: center; flex-wrap: wrap; margin: 8px 0; }
.site-foot .fl a { color: var(--muted); font-size: 14px; }
@media (max-width: 600px) { .home-hero h1 { font-size: 30px; } }

.acc details { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 12px; padding: 0 20px; }
.acc summary { cursor: pointer; font-weight: 800; font-size: 17px; padding: 15px 0; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { content: '＋'; color: var(--brand-ink); font-size: 20px; transition: transform .2s; }
.acc details[open] summary::after { content: '－'; }
.acc details > :not(summary) { margin-top: 0; padding-bottom: 16px; }
.acc ul { padding-left: 20px; margin: 0 0 8px; }

/* ── 估價動畫：工具頭一層層印出進度條 ── */
.rig { --hw: 96px; --bh: 18px; --yel: #FAAD20; padding: 4px 0 6px; }
.rig.mini { --hw: 46px; --bh: 10px; }
.rig-in { position: relative; margin: 0 calc(var(--hw) * .6); height: calc(var(--hw) * 1.277 + var(--bh) - 3px); }
.rig-head { position: absolute; top: 0; left: var(--p); width: var(--hw); aspect-ratio: 920 / 1175; transform: translateX(-44.6%); transition: left .8s linear; z-index: 2; }
.rig-shake { position: absolute; inset: 0; animation: rigShake .3s ease-in-out infinite alternate; animation-delay: var(--ph, 0ms); }
.rig-body { position: absolute; inset: 0; overflow: hidden; }
.rig-body img { position: absolute; inset: 0; width: 100%; height: 100%; }
.rig-logo { position: absolute; left: 45.4%; top: 45.1%; width: 34%; transform: translate(-50%, -50%); animation: rigSpin 3s linear infinite; animation-delay: var(--ph, 0ms); }
.rig-bed { position: absolute; left: 0; right: 0; bottom: 0; height: var(--bh); background: #2a2a2e; border-radius: 99px; overflow: hidden; box-shadow: inset 0 1px 3px rgba(0,0,0,.5); }
.rig-fill { position: absolute; left: 0; top: 0; bottom: 0; width: var(--p); border-radius: 99px; transition: width .8s linear;
  background: linear-gradient(180deg, rgba(255,255,255,.28), rgba(255,255,255,0) 55%), linear-gradient(90deg, #08a9c6, #0CC0DF 75%, #2fd2ec); }
.rig-fill::after { content: ""; position: absolute; right: 0; top: 0; bottom: 0; width: 26px; background: linear-gradient(90deg, transparent, rgba(190,246,255,.95)); animation: rigHot .6s ease-in-out infinite alternate; }
@keyframes rigSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes rigShake { from { transform: translate(-2px, 0); } to { transform: translate(2px, -1px); } }
@keyframes rigHot { from { opacity: .45; } to { opacity: 1; } }
#quoteTrack .qt .rig { margin: 4px 0 0; }

/* 耗材線（只在估價框內，蓋在文字前面） */
.slicing-card { position: relative; }
.fil { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 1; }
.fil path { fill: none; stroke-linecap: round; }
.fil-bg { stroke: #0894ae; stroke-width: 5; }
.fil-hi { stroke: #0CC0DF; stroke-width: 3; }
.fil-flow { stroke: rgba(255,255,255,.75); stroke-width: 1.4; stroke-dasharray: 5 16; animation: filFlow .7s linear infinite; }
@keyframes filFlow { to { stroke-dashoffset: -21; } }
