/* 擺租趣報價系統｜樣式
 * 概念「串燈亮起」：擺租趣主視覺的夜間活動現場 → 深夜藍、品牌藍、串燈暖黃；
 * 步驟標籤是活動現場的藍色膠帶；插畫沿用擺租趣官網線稿（細線＋藍色直條紋）。
 * 白天 / 夜晚兩種模式，呼應「陪你辦活動，白天夜晚都有趣」。
 */

/* ───────── 色票 ───────── */
:root {
  --navy-950: #040d22; --navy-900: #071733; --navy-800: #092042; --navy-700: #0f2b57;
  --blue: #3d62ad; --sky: #80afdb; --bulb-amber: #ffc24b; --coral-hex: #e37d61;

  --bg: #eef3fa; --bg-2: #e3ebf6;
  --surface: #ffffff; --surface-2: #f6f9fd; --input-bg: #ffffff;
  --ink: #0b1b3a; --ink-2: #334260; --muted: #67779a;
  --line: #d9e3f1; --line-strong: #bccbe2;
  --brand: #3d62ad; --brand-ink: #ffffff; --brand-strong: #2c4c8f;
  --sky-tint: #e6effa; --sel-bg: #eaf1fb; --ring: rgba(61, 98, 173, .28);
  --bulb: #f5b83d; --bulb-ink: #241800; --bulb-glow: rgba(245, 184, 61, .65);
  --coral: #d9694c; --good: #1f7f4f; --bad: #c8412f;
  --note-bg: #fff6e0; --note-line: #f0c76a; --pending-bg: #fffaf0;
  --warn-ink: #9a5b00;
  --stripe: #3d62ad; --stripe-bg: #e3edf9;
  --shadow: 0 1px 2px rgba(11, 27, 58, .05), 0 10px 30px -14px rgba(11, 27, 58, .22);
  --shadow-lift: 0 2px 4px rgba(11, 27, 58, .06), 0 22px 44px -18px rgba(11, 27, 58, .34);
  --tape: #3d62ad; --tape-ink: #ffffff;
  --hover: rgba(61, 98, 173, .07);
  --spot: rgba(61, 98, 173, .10);
  --f-display: "Unbounded", "Noto Sans TC", system-ui, sans-serif;
  --f-body: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="day"]) {
    --bg: #050f26; --bg-2: #081733;
    --surface: #0c1f45; --surface-2: #10275a; --input-bg: #0a1a3c;
    --ink: #eaf2fb; --ink-2: #c3d3ec; --muted: #8ea4c7;
    --line: #1b3468; --line-strong: #2a4a88;
    --brand: #80afdb; --brand-ink: #061430; --brand-strong: #a9c9ea;
    --sky-tint: #13306a; --sel-bg: #12306a; --ring: rgba(128, 175, 219, .35);
    --bulb: #ffc85a; --bulb-ink: #1d1300; --bulb-glow: rgba(255, 200, 90, .75);
    --coral: #f0907a; --good: #6fd09a; --bad: #ff8070;
    --note-bg: #2b2410; --note-line: #8a6a1f; --pending-bg: #1a2448;
    --warn-ink: #ffcf7a;
    --stripe: #80afdb; --stripe-bg: #163374;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 14px 34px -16px rgba(0, 0, 0, .6);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, .4), 0 26px 50px -18px rgba(0, 0, 0, .7), 0 0 0 1px rgba(128, 175, 219, .15);
    --tape: #80afdb; --tape-ink: #061430;
    --hover: rgba(128, 175, 219, .1);
    --spot: rgba(255, 200, 90, .10);
    color-scheme: dark;
  }
}
:root[data-theme="night"] {
  --bg: #050f26; --bg-2: #081733;
  --surface: #0c1f45; --surface-2: #10275a; --input-bg: #0a1a3c;
  --ink: #eaf2fb; --ink-2: #c3d3ec; --muted: #8ea4c7;
  --line: #1b3468; --line-strong: #2a4a88;
  --brand: #80afdb; --brand-ink: #061430; --brand-strong: #a9c9ea;
  --sky-tint: #13306a; --sel-bg: #12306a; --ring: rgba(128, 175, 219, .35);
  --bulb: #ffc85a; --bulb-ink: #1d1300; --bulb-glow: rgba(255, 200, 90, .75);
  --coral: #f0907a; --good: #6fd09a; --bad: #ff8070;
  --note-bg: #2b2410; --note-line: #8a6a1f; --pending-bg: #1a2448;
  --warn-ink: #ffcf7a;
  --stripe: #80afdb; --stripe-bg: #163374;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 14px 34px -16px rgba(0, 0, 0, .6);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, .4), 0 26px 50px -18px rgba(0, 0, 0, .7), 0 0 0 1px rgba(128, 175, 219, .15);
  --tape: #80afdb; --tape-ink: #061430;
  --hover: rgba(128, 175, 219, .1);
  --spot: rgba(255, 200, 90, .10);
  color-scheme: dark;
}

/* ───────── 基礎 ───────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font: 15px/1.65 var(--f-body); -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
body.modal-open { overflow: hidden; }
img { max-width: 100%; display: block; }
a { color: var(--brand); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2.5px solid var(--bulb); outline-offset: 2px; border-radius: 8px; }
h1, h2, h3, p { margin: 0; }
.shell { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .shell { padding: 0 24px; } }
.boot { min-height: 70vh; display: grid; place-items: center; align-content: center; gap: 14px; background: var(--navy-900); color: #cfe0f4; }
.boot img { width: 220px; height: auto; }
.mono { font-family: var(--f-display); font-size: .92em; letter-spacing: .02em; }
.num, .r.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.fine { font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.nowrap { white-space: nowrap; }
.accent { color: var(--brand); }
.up { color: var(--bad); } .down { color: var(--good); }
.good { color: var(--good); } .bad { color: var(--bad); }
.warn-text { color: var(--warn-ink); display: inline-flex; gap: 4px; align-items: center; }
.err { display: inline-flex; gap: 6px; align-items: center; color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); padding: 6px 12px; border-radius: 10px; font-size: 14px; }
.ask { color: var(--coral); font-weight: 700; }
.gap-top { margin-top: 16px; }
.row-gap { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.stack { display: grid; gap: 18px; }
.pad-bottom { padding-bottom: 92px; }
.print-only { display: none; }
.mobile-only { display: block; }
.desktop-only { display: none; }
@media (min-width: 960px) { .mobile-only { display: none; } .desktop-only { display: revert; } }
.ico { flex: none; }

/* ───────── 首屏 ───────── */
.hero { position: relative; color: #fff; background: var(--navy-900); overflow: hidden; isolation: isolate; padding-bottom: 64px; }
.hero-photo { position: absolute; inset: -24px; z-index: -2; transform: translate3d(calc(var(--mx, 0) * -18px), calc(var(--my, 0) * -12px), 0); transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.hero-photo::before { content: ""; position: absolute; inset: 0; background: url(../img/hero-night.jpg) center 42% / cover no-repeat; animation: kenburns 28s ease-in-out infinite alternate; }
.hero-photo::after { content: ""; position: absolute; inset: 0;
  background: radial-gradient(110% 90% at 72% 20%, rgba(7, 23, 51, .05), rgba(7, 23, 51, .55) 62%), linear-gradient(90deg, rgba(4, 13, 34, .72) 0%, rgba(4, 13, 34, .25) 55%, rgba(4, 13, 34, .1) 100%), linear-gradient(180deg, rgba(4, 13, 34, .35) 0%, rgba(4, 13, 34, .45) 60%, rgba(4, 13, 34, .94) 100%); }
.hero:not(.hero-home) .hero-photo::after { background: linear-gradient(180deg, rgba(4, 13, 34, .72), rgba(4, 13, 34, .9) 70%, rgba(4, 13, 34, .97)); }
@keyframes kenburns { from { transform: scale(1.04) translate3d(0, 0, 0); } to { transform: scale(1.16) translate3d(-1.5%, -1%, 0); } }
.hero-fx { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.beam { position: absolute; top: -40px; width: 340px; height: 140%; z-index: -1; pointer-events: none; mix-blend-mode: screen; opacity: .32; filter: blur(2px);
  background: linear-gradient(180deg, rgba(255, 228, 160, .55), rgba(128, 175, 219, .12) 60%, transparent 85%);
  clip-path: polygon(46% 0, 54% 0, 100% 100%, 0 100%); transform-origin: 50% 0; }
.beam-l { left: 6%; animation: sweepL 9s ease-in-out infinite alternate; }
.beam-r { right: 4%; animation: sweepR 11s ease-in-out infinite alternate; opacity: .24; }
@keyframes sweepL { from { transform: rotate(-26deg); } to { transform: rotate(10deg); } }
@keyframes sweepR { from { transform: rotate(24deg); } to { transform: rotate(-12deg); } }
.hero-lights { position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 78px; z-index: 0; pointer-events: none; }
.hero-inner { position: relative; z-index: 1; padding-top: 74px; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand img { width: clamp(180px, 34vw, 260px); height: auto; filter: drop-shadow(0 2px 12px rgba(0, 0, 0, .4)); }
.theme-toggle { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .08); color: #eaf2fb; font-size: 13px; backdrop-filter: blur(6px); transition: background .2s; }
.theme-toggle:hover { background: rgba(255, 255, 255, .16); }
.hero-copy { margin-top: 26px; max-width: 760px; }
.kicker { font-size: 13px; letter-spacing: .18em; color: var(--sky); font-weight: 700; }
.hero-title { font-family: var(--f-display); font-weight: 800; line-height: 1.02; letter-spacing: -.01em; margin-top: 8px; font-size: clamp(34px, 6vw, 58px); text-wrap: balance; }
.hero-home .hero-title { font-size: clamp(46px, 10vw, 112px); letter-spacing: -.025em; }
.hero-home .hero-inner { padding-bottom: 8px; }
.hero-home { padding-bottom: 86px; }
.hero-home .hero-copy { margin-top: clamp(28px, 7vw, 76px); }
.lede { margin-top: 12px; font-size: clamp(15px, 1.8vw, 18px); color: #d6e3f5; max-width: 62ch; }
.tagline { margin-top: 10px; font-size: 14px; letter-spacing: .26em; color: var(--sky); }
.glow-title .w { display: inline-block; white-space: nowrap; }
.glow-title .ch { display: inline-block; animation: lightup .9s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(var(--i) * 45ms + 120ms); }
@keyframes lightup {
  0% { opacity: 0; transform: translateY(.35em) scale(.96); filter: blur(6px); text-shadow: none; }
  55% { opacity: 1; filter: blur(0); text-shadow: 0 0 22px rgba(255, 200, 90, .95), 0 0 2px #fff; }
  100% { opacity: 1; transform: none; text-shadow: 0 0 18px rgba(128, 175, 219, .25); }
}
.hero-home .glow-title .w:last-child .ch { color: var(--bulb-amber); }

.nav { display: flex; gap: 6px; margin-top: 26px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.nav::-webkit-scrollbar { display: none; }
.nav a { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 999px; color: #dbe7f6; text-decoration: none; font-weight: 700; font-size: 14px;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .16); backdrop-filter: blur(6px); transition: background .2s, color .2s, box-shadow .2s; }
.nav a:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.nav a.on { background: var(--bulb-amber); color: #241800; border-color: transparent; box-shadow: 0 0 0 4px rgba(255, 194, 75, .18), 0 8px 26px -6px rgba(255, 194, 75, .7); }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--coral-hex); color: #fff; font-size: 11.5px; }

/* 串燈 */
.lights .wire { fill: none; stroke: rgba(255, 255, 255, .38); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.lights .socket { fill: #1e2c4a; stroke: rgba(255, 255, 255, .35); stroke-width: 1; }
.lights .glass { fill: rgba(255, 255, 255, .06); stroke: rgba(255, 255, 255, .45); stroke-width: 1; transition: fill .5s, stroke .5s; }
.lights .halo { opacity: 0; transition: opacity .6s; }
.lights .bulb { transform-box: fill-box; transform-origin: 50% 0; animation: sway 4.5s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -.37s); }
.lights .bulb.on .glass { fill: var(--bulb-amber); stroke: #ffe7a8; animation: bulbOn .7s both, flicker 5s ease-in-out infinite; animation-delay: calc(var(--i) * 70ms), calc(var(--i) * 70ms + 900ms); }
.lights .bulb.on .halo { opacity: 1; animation: haloIn .9s both; animation-delay: calc(var(--i) * 70ms); }
.lights.twinkle .bulb.on .glass { animation: bulbOn .7s both, twinkle 2.6s ease-in-out infinite; animation-delay: calc(var(--i) * 70ms), calc(var(--i) * -0.23s); }
@keyframes sway { from { transform: rotate(-5deg); } to { transform: rotate(5deg); } }
@keyframes bulbOn { 0% { fill: rgba(255, 255, 255, .06); } 40% { fill: #fff6d8; } 100% { fill: var(--bulb-amber); } }
@keyframes haloIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes flicker { 0%, 92%, 100% { opacity: 1; } 94% { opacity: .55; } 96% { opacity: .95; } }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.card .lights { height: 46px; width: 100%; }

/* ───────── 主區 ───────── */
.main { position: relative; z-index: 2; margin-top: -48px; padding-bottom: 56px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: 18px; }
@media (min-width: 720px) { .card { padding: 26px; } }
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s cubic-bezier(.2, .7, .2, 1), transform .6s cubic-bezier(.2, .7, .2, 1); transition-delay: calc(var(--d, 0) * 80ms); }
.reveal.in { opacity: 1; transform: none; }
.stack > .reveal:nth-child(2) { --d: 1; } .stack > .reveal:nth-child(3) { --d: 2; } .stack > .reveal:nth-child(4) { --d: 3; }

/* 膠帶標籤 */
.tape { display: inline-block; font: 700 11px/1 var(--f-display); letter-spacing: .14em; color: var(--tape-ink); background: var(--tape); padding: 6px 14px 6px 12px; transform: rotate(-2deg);
  clip-path: polygon(0 10%, 3% 0, 30% 6%, 62% 0, 97% 5%, 100% 0, 98% 50%, 100% 100%, 70% 94%, 35% 100%, 4% 93%, 0 100%, 2% 52%);
  box-shadow: inset 0 0 0 100px rgba(255, 255, 255, .06); }

/* 步驟卡 */
.step-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.step-id { display: flex; gap: 14px; align-items: flex-start; min-width: 0; }
.step-sketch { flex: none; padding: 6px; border-radius: 16px; background: var(--sky-tint); color: var(--ink); display: none; }
@media (min-width: 640px) { .step-sketch { display: block; width: 66px; height: 66px; } }
.is-done .step-sketch { background: color-mix(in srgb, var(--bulb) 22%, var(--sky-tint)); }
.step-title { font-size: clamp(20px, 2.6vw, 26px); font-weight: 900; line-height: 1.3; margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; letter-spacing: .01em; }
.step-hint { color: var(--muted); font-size: 14px; margin-top: 4px; max-width: 70ch; }
.step-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.done-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 700; color: var(--bulb-ink); background: var(--bulb); padding: 3px 10px; border-radius: 999px; box-shadow: 0 0 18px -2px var(--bulb-glow); }
.sub-title { font-weight: 900; font-size: 15px; margin-bottom: 10px; }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.panel-head h2 { font-size: 19px; font-weight: 900; }

/* 線稿 */
.sketch { color: var(--ink); }
.sketch .fill { fill: url(#rf-stripe); stroke: none; }

/* ───────── 表單 ───────── */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.field-hint { font-size: 12px; color: var(--muted); }
.req { color: var(--bad); font-weight: 700; }
.inp { width: 100%; min-width: 0; height: 42px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--input-bg); color: var(--ink); transition: border-color .15s, box-shadow .15s; }
textarea.inp { height: auto; padding: 10px 12px; line-height: 1.6; resize: vertical; }
select.inp { padding-right: 28px; }
.inp:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); }
.inp.num { text-align: right; font-variant-numeric: tabular-nums; }
.inp.warn { border-color: var(--note-line); background: var(--note-bg); }
.inp.sm { height: 34px; font-size: 13px; padding: 0 9px; border-radius: 9px; }
.inp.xs { width: 72px; height: 34px; font-size: 13.5px; padding: 0 8px; border-radius: 9px; }
.inp.auto { width: auto; }
.inp:disabled { opacity: .55; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; } .span-2 { grid-column: span 2; } }
@media (min-width: 1000px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } }
.grid-3.tight { gap: 8px; }
.agree { display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; font-size: 14px; }
.agree input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--brand); }
.mini-field { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.mini-field.col { flex-direction: column; align-items: stretch; gap: 3px; }
.mini-check { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); white-space: nowrap; margin-top: 4px; }
.mini-check input { accent-color: var(--brand); }
.search { position: relative; flex: 1 1 240px; min-width: 0; display: block; }
.search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search .inp { padding-left: 38px; }

/* 按鈕 */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 42px; padding: 0 18px; border-radius: 999px; font-weight: 700; font-size: 14.5px; white-space: nowrap; border: 1.5px solid transparent; text-decoration: none; overflow: hidden;
  transition: transform .15s, box-shadow .2s, background .2s, border-color .2s, filter .2s; }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.98); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn-primary { background: var(--bulb); color: var(--bulb-ink); box-shadow: 0 8px 22px -10px var(--bulb-glow), inset 0 -2px 0 rgba(0, 0, 0, .08); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.05); box-shadow: 0 10px 30px -8px var(--bulb-glow), inset 0 -2px 0 rgba(0, 0, 0, .08); }
.btn-primary::after { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent); transform: skewX(-18deg); transition: left .6s; }
.btn-primary:hover:not(:disabled)::after { left: 120%; }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover:not(:disabled) { border-color: var(--brand); background: var(--hover); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { background: var(--hover); }
.btn-danger { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.btn-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--bad) 9%, transparent); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--hover); color: var(--bad); }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand); text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 4px; font-size: 14px; display: inline-flex; gap: 4px; align-items: center; }
.link-btn.small { font-size: 12.5px; margin-top: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips.scroll-x { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; padding-bottom: 4px; }
.chip { flex: none; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font-size: 13.5px; font-weight: 500; transition: all .15s; }
.chip:hover { border-color: var(--brand); }
.chip.on { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); font-weight: 700; }

/* 聚光與傾斜 */
.spot { position: relative; isolation: isolate; }
.spot::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: -1; opacity: 0; transition: opacity .25s;
  background: radial-gradient(260px circle at var(--sx, 50%) var(--sy, 50%), var(--spot), transparent 65%); }
.spot:hover::before { opacity: 1; }
.tilt { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: transform .35s cubic-bezier(.2, .7, .2, 1), box-shadow .3s, opacity .6s; }
.tilt:hover { box-shadow: var(--shadow-lift); }
.tilt.reveal { transform: perspective(900px) translateY(18px); }
.tilt.reveal.in { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }

/* ───────── 首頁 ───────── */
.doors { display: grid; gap: 16px; }
@media (min-width: 760px) { .doors { grid-template-columns: 1fr 1fr; } .doors.three { grid-template-columns: 1.2fr 1fr 1fr; } }
.door { display: flex; gap: 16px; align-items: flex-start; text-align: left; border: 1px solid var(--line); color: var(--ink); min-height: 200px; }
.door-ico { flex: none; display: grid; place-items: center; width: 84px; height: 84px; border-radius: 22px; background: var(--sky-tint); }
.door-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.door-title { font-size: clamp(24px, 3vw, 32px); font-weight: 900; line-height: 1.2; }
.door-text { font-size: 14px; color: var(--muted); }
.door-cta { margin-top: auto; display: inline-flex; gap: 6px; align-items: center; font-weight: 700; color: var(--brand); }
.door:hover .door-cta .ico { transform: translateX(4px); }
.door-cta .ico { transition: transform .2s; }
.doors .door:first-child { background: linear-gradient(140deg, var(--navy-800), #173f86 70%, #2b5aa8); color: #fff; border-color: transparent; }
.doors .door:first-child .door-text { color: #c8d9f0; }
.doors .door:first-child .door-cta { color: var(--bulb-amber); }
.doors .door:first-child .door-ico { background: rgba(255, 255, 255, .1); }
.doors .door:first-child .sketch { color: #fff; }
.doors .door:first-child .tape { --tape: var(--bulb-amber); --tape-ink: #241800; }
.doors .door:first-child { --spot: rgba(255, 200, 90, .2); }
.pill-note { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 700; font-size: 13.5px; }
.pill-note.warn { background: var(--note-bg); border-color: var(--note-line); color: var(--warn-ink); }
.flow-head { margin-bottom: 18px; }
.flow-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); counter-reset: f; }
@media (min-width: 760px) { .flow-steps { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1140px) { .flow-steps { grid-template-columns: repeat(8, 1fr); } }
.flow-steps li { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 14px 12px 12px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.flow-steps li b { font-size: 15px; }
.flow-steps li span:last-child { font-size: 12.5px; color: var(--muted); }
.flow-no { font: 800 22px/1 var(--f-display); color: var(--brand); opacity: .9; margin-bottom: 4px; }
.flow-steps li:nth-child(4) { background: color-mix(in srgb, var(--bulb) 18%, var(--surface-2)); border-color: var(--note-line); }
.marquee { position: relative; overflow: hidden; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); padding: 14px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.marquee-track { display: flex; gap: 14px; width: max-content; list-style: none; margin: 0; padding: 0 7px; animation: marquee 60s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee li { flex: none; display: flex; align-items: center; gap: 10px; padding: 6px 16px 6px 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.marquee img { width: 46px; height: 46px; border-radius: 50%; object-fit: contain; background: #fff; border: 1px solid var(--line); }
.marquee span { font-size: 13.5px; font-weight: 700; white-space: nowrap; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ───────── 估價頁 ───────── */
.share-banner { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 14px 18px; border-radius: 18px; background: var(--sel-bg); border: 1.5px solid var(--brand); }
.share-banner > div:nth-child(2) { flex: 1 1 260px; }
.types { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .types { grid-template-columns: repeat(4, 1fr); } }
.type { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 10px 12px; text-align: center; border-radius: 18px; border: 1.5px solid var(--line); background: var(--surface-2); color: var(--ink); transition: transform .2s, border-color .2s, box-shadow .2s, background .2s; }
.type:hover { transform: translateY(-2px); border-color: var(--brand); }
.type.on { border-color: var(--brand); background: var(--sel-bg); box-shadow: 0 0 0 4px var(--ring); }
.type.on::after { content: ""; position: absolute; top: 10px; right: 12px; width: 10px; height: 10px; border-radius: 50%; background: var(--bulb); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bulb) 30%, transparent), 0 0 16px 2px var(--bulb-glow); }
.type-label { font-weight: 900; font-size: 15.5px; }
.type-hint { font-size: 12px; color: var(--muted); }
.est-list { list-style: none; margin: 0; padding: 0; }
.est-row { display: grid; grid-template-columns: auto 1fr auto auto; grid-template-areas: "thumb main main x" "in in amt amt"; gap: 8px 12px; align-items: center; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.est-row > .thumb { grid-area: thumb; }
.est-main { grid-area: main; min-width: 0; }
.est-inputs { grid-area: in; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.est-row .amount { grid-area: amt; text-align: right; }
.est-row > .icon-btn { grid-area: x; }
@media (min-width: 900px) {
  .est-row { grid-template-columns: auto minmax(0, 1fr) auto 110px 34px; grid-template-areas: "thumb main in amt x"; }
}
.est-row.child { padding-left: 34px; position: relative; }
.est-row.child::before { content: ""; position: absolute; left: 14px; top: -8px; bottom: 50%; width: 14px; border-left: 2px solid var(--line-strong); border-bottom: 2px solid var(--line-strong); border-bottom-left-radius: 8px; }
.est-name { font-weight: 700; line-height: 1.4; }
.est-price { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.est-note { font-size: 12px; color: var(--brand); }
.est-opts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.est-opts .inp { width: auto; max-width: 100%; }
.dims { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); }
.qty { display: inline-flex; align-items: center; gap: 4px; }
.qty .unit { font-size: 12.5px; color: var(--muted); min-width: 22px; }
.amount { font: 700 15px var(--f-body); font-variant-numeric: tabular-nums; }
.est-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 14px; margin-top: 14px; }
.totalbox { margin: 0 0 0 auto; width: 100%; max-width: 380px; padding: 16px 18px; border-radius: 18px; background: var(--surface-2); border: 1.5px solid var(--line-strong); display: grid; gap: 4px; }
.totalbox > div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.totalbox dd { margin: 0; font-variant-numeric: tabular-nums; }
.totalbox .grand { margin-top: 6px; padding-top: 10px; border-top: 2px dashed var(--line-strong); align-items: baseline; }
.totalbox .grand dt { font-weight: 900; font-size: 16px; }
.totalbox .grand dd { font: 800 clamp(26px, 4vw, 34px)/1.1 var(--f-display); color: var(--ink); letter-spacing: -.01em; }
.totalbox .grand small { font-size: 13px; margin-right: 4px; color: var(--muted); font-family: var(--f-body); }
.note-box { padding: 12px 16px; border-radius: 14px; background: var(--note-bg); border: 1px solid var(--note-line); border-left-width: 5px; font-size: 14px; color: var(--ink); }
.note-box.ok { background: color-mix(in srgb, var(--good) 10%, var(--surface)); border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.note-box ul { margin: 6px 0 0; padding-left: 20px; }
.note-title { font-weight: 900; display: flex; gap: 6px; align-items: center; }

/* 縮圖 */
.thumb { flex: none; display: grid; place-items: center; width: var(--s); height: var(--s); border-radius: 14px; background: var(--sky-tint); border: 1px solid var(--line); overflow: hidden; }
.thumb.photo { background: #fff; padding: 3px; }
.thumb img { width: 100%; height: 100%; object-fit: contain; }
.cat-tag { display: inline-flex; align-items: center; gap: 6px; font-weight: 900; font-size: 15px; }
.cat-tag .sketch { padding: 2px; border-radius: 8px; background: var(--sky-tint); }

/* ───────── 算成本利潤 ───────── */
.progress-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; margin-bottom: 10px; font-size: 14px; }
.progress-head mark { background: linear-gradient(transparent 55%, color-mix(in srgb, var(--bulb) 55%, transparent) 55%); color: inherit; padding: 0 2px; font-weight: 700; }
.progress-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.progress-steps li { position: relative; }
.progress-steps li:not(:last-child)::after { content: ""; position: absolute; top: 30px; right: -10px; width: 12px; border-top: 2px dashed var(--line-strong); }
.pstep { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 6px; border: 0; background: none; border-radius: 14px; color: var(--muted); }
.pstep:hover { background: var(--hover); }
.pstep-ico { position: relative; display: grid; place-items: center; width: 60px; height: 60px; border-radius: 18px; background: var(--surface-2); border: 1.5px solid var(--line); }
.pstep.now { color: var(--ink); }
.pstep.now .pstep-ico { border-color: var(--brand); box-shadow: 0 0 0 4px var(--ring); animation: pulse 2s ease-in-out infinite; }
.pstep.done { color: var(--ink-2); }
.pstep.done .pstep-ico { background: color-mix(in srgb, var(--bulb) 20%, var(--surface-2)); border-color: var(--note-line); }
.pstep-check { position: absolute; right: -6px; bottom: -6px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--bulb); color: var(--bulb-ink); box-shadow: 0 0 14px var(--bulb-glow); }
.pstep-label { font-size: 13px; font-weight: 700; }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px transparent; } }
.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 30px 18px; border-radius: 20px; border: 2px dashed var(--line-strong); background: var(--surface-2); cursor: pointer; transition: border-color .2s, background .2s; }
.drop:hover, .drop.drag { border-color: var(--brand); background: var(--sel-bg); }
.drop.has .sketch { color: var(--brand); }
.drop-title { font-weight: 900; font-size: 16px; word-break: break-all; }
.summary-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.unmatched { margin-bottom: 14px; padding: 10px 14px; border-radius: 14px; background: var(--note-bg); border: 1px solid var(--note-line); font-size: 14px; }
.unmatched summary { cursor: pointer; font-weight: 700; display: flex; gap: 6px; align-items: center; }
.unmatched ul { list-style: none; margin: 8px 0 0; padding: 0; }
.unmatched li { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; align-items: center; padding: 6px 0; border-top: 1px dashed var(--note-line); }
.unmatched li > span:first-child { flex: 1 1 240px; }
.empty-stage { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 30px 12px; border-radius: 18px; border: 2px dashed var(--line); }
.empty-stage img { opacity: .9; }
.empty-title { font-weight: 900; font-size: 17px; }
.empty { text-align: center; color: var(--muted); padding: 24px 0; }
.cat-block { display: grid; gap: 10px; margin-bottom: 18px; }
.line-card { padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2); display: grid; gap: 10px; }
.line-card.pending { border-color: var(--note-line); background: var(--pending-bg); }
.line-card-head { display: flex; gap: 8px; align-items: flex-start; }
.grow { flex: 1; min-width: 0; }
.src summary { cursor: pointer; font-size: 12.5px; color: var(--muted); display: inline-flex; gap: 4px; align-items: center; }
.src > *:not(summary) { margin-top: 6px; }
.formula { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; display: flex; gap: 5px; align-items: flex-start; }
.hint-line { font-size: 12px; color: var(--brand); }
.follow { height: 42px; display: grid; align-items: center; justify-items: end; padding: 0 12px; border-radius: 12px; background: var(--sky-tint); color: var(--brand-strong); font-variant-numeric: tabular-nums; font-weight: 700; }
.confirm { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; border: 0; background: none; font-size: 11px; font-weight: 700; border-radius: 10px; }
.confirm .box { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--line-strong); background: var(--surface); transition: all .2s; }
.confirm.ok { color: var(--good); }
.confirm.ok .box { background: var(--good); border-color: var(--good); color: #fff; box-shadow: 0 0 0 4px color-mix(in srgb, var(--good) 18%, transparent); }
.confirm.pending { color: var(--warn-ink); }
.confirm.pending .box { border-color: var(--note-line); }
.confirm.pending:hover .box { border-color: var(--good); }
.confirm.blocked { color: var(--muted); cursor: not-allowed; }
.confirm.blocked .box { opacity: .5; }

/* 表格 */
.table-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
@media (min-width: 720px) { .table-wrap { margin: 0 -26px; padding: 0 26px; } }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 700; color: var(--muted); padding: 8px 6px; border-bottom: 2px solid var(--line-strong); white-space: nowrap; }
.tbl td { padding: 10px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl .r { text-align: right; } .tbl .c { text-align: center; }
.tbl tr.pending td { background: var(--pending-bg); }
.tbl tr.unverified td:first-child { box-shadow: inset 3px 0 0 var(--note-line); }
.tbl tr.clickable { cursor: pointer; transition: background .15s; }
.tbl tr.clickable:hover td { background: var(--hover); }
.tbl.budget { min-width: 1180px; }
.tbl.budget .name-cell { min-width: 280px; display: grid; gap: 6px; }
.tbl.budget td:nth-child(3) { width: 104px; } .tbl.budget td:nth-child(4) { width: 168px; } .tbl.budget td:nth-child(5) { width: 84px; } .tbl.budget td:nth-child(6) { width: 70px; }
.tbl.budget td:nth-child(7), .tbl.budget td:nth-child(8) { width: 104px; } .tbl.budget td:nth-child(9) { width: 106px; } .tbl.budget td:nth-child(10) { width: 116px; }
.tbl .dims .inp { width: 70px; }
.cat-row td { background: var(--surface-2); border-bottom: 1px solid var(--line-strong); }
.tbl.catalog { min-width: 1460px; }
.tbl.catalog td:nth-child(2) { min-width: 240px; } .tbl.catalog td:nth-child(3) { width: 74px; } .tbl.catalog td:nth-child(4), .tbl.catalog td:nth-child(5) { width: 98px; }
.tbl.catalog td:nth-child(6), .tbl.catalog td:nth-child(8) { width: 92px; } .tbl.catalog td:nth-child(9) { width: 80px; } .tbl.catalog td:nth-child(10) { min-width: 200px; }
.cat-cell { display: flex; align-items: center; gap: 8px; min-width: 210px; }
.status-cell { min-width: 84px; }
.hist summary { cursor: pointer; font-size: 12.5px; color: var(--brand); }
.hist-pop { margin-top: 6px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; max-width: 280px; }
.hist-pop ul { margin: 4px 0 0; padding-left: 16px; }
.tbl.quotes td { vertical-align: middle; }
.tbl.qlines { min-width: 980px; }
.tbl.qlines .name-cell { min-width: 260px; display: grid; gap: 5px; }
.tbl.qlines td:nth-child(3) { width: 74px; } .tbl.qlines td:nth-child(4), .tbl.qlines td:nth-child(5) { width: 84px; } .tbl.qlines td:nth-child(6) { width: 92px; }
.tbl.qlines td:nth-child(7) { width: 104px; } .tbl.qlines td:nth-child(8) { width: 74px; } .tbl.qlines td:nth-child(9) { width: 110px; }
.order { width: 34px; } .order .icon-btn { width: 26px; height: 22px; font-size: 10px; }
.tbl.regions { max-width: 560px; }

/* 收支看板 */
.result-grid { display: grid; gap: 18px; }
@media (min-width: 960px) { .result-grid { grid-template-columns: 1fr 1.15fr; } }
.board { position: relative; overflow: hidden; border-radius: 22px; padding: 6px 22px 22px; color: #eaf2fb; background: radial-gradient(120% 120% at 20% 0%, #163a7a 0%, var(--navy-800) 45%, var(--navy-950) 100%); box-shadow: inset 0 0 0 1px rgba(128, 175, 219, .2); }
.board .lights { margin: 0 -22px 2px; width: calc(100% + 44px); }
.board.loss { background: radial-gradient(120% 120% at 20% 0%, #4a1f2b 0%, #2a1020 45%, #12060d 100%); }
.board.idle { background: linear-gradient(160deg, #1a2a4a, #0e1830); }
.board-kicker { font: 800 13px var(--f-display); letter-spacing: .16em; color: var(--sky); }
.board .muted { color: #9fb4d4; }
.board-num { font: 800 clamp(34px, 6vw, 54px)/1.05 var(--f-display); color: #ffd27a; text-shadow: 0 0 26px rgba(255, 200, 90, .45); margin: 6px 0 8px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.board-num small { font-size: .38em; margin-right: 6px; color: #c8d6ea; text-shadow: none; font-family: var(--f-body); letter-spacing: 0; }
.board.loss .board-num { color: #ff9b8a; text-shadow: 0 0 26px rgba(255, 110, 90, .4); }
.board.idle .board-num { color: #7f93b5; text-shadow: none; }
.board-rate { margin-left: 8px; font-size: 16px; color: #fff; }
.board-mood { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 15px; font-weight: 700; }
.ledger { margin: 0; }
.ledger > div { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 10px 0; border-bottom: 2px dashed var(--line); }
.ledger dt { font-size: 14.5px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.ledger dd { margin: 0; font: 700 17px var(--f-display); font-variant-numeric: tabular-nums; }
.ref-box { margin-top: 12px; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
.ref-box b { font-variant-numeric: tabular-nums; }

/* 燈泡表情 */
.bulbface { flex: none; color: currentColor; }
.bulbface .glass { fill: rgba(255, 255, 255, .08); }
.bulbface .aura { opacity: 0; }
.bulbface.m-smile .glass, .bulbface.m-grin .glass { fill: #ffd27a; }
.bulbface.m-smile .aura, .bulbface.m-grin .aura { opacity: 1; }
.bulbface.m-grin .aura { animation: twinkle 2s ease-in-out infinite; }
.bulbface.m-worry .glass { fill: #f3dfa2; }
.bulbface.m-shock .glass { fill: #f6b3a2; }
.bulbface.m-think .glass { fill: #c7d3e6; }
.bulbface .face { stroke: #1b1405; }
.bulbface.m-think .face { stroke: #24324f; }

/* 底部收支列 */
.bottom-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: rgba(7, 23, 51, .94); color: #eaf2fb; backdrop-filter: blur(10px); border-top: 1px solid rgba(255, 200, 90, .4); box-shadow: 0 -10px 30px -10px rgba(255, 200, 90, .25); padding-bottom: env(safe-area-inset-bottom, 0px); }
.bottom-inner { display: flex; align-items: center; gap: 12px; height: 66px; }
.bb-sum { flex: 1; display: flex; align-items: center; gap: 18px; min-width: 0; background: none; border: 0; color: inherit; text-align: left; padding: 0; }
.bb-cell { display: flex; flex-direction: column; line-height: 1.2; }
.bb-cell small { font-size: 11.5px; color: #9fb4d4; }
.bb-cell b { font: 700 16px var(--f-display); font-variant-numeric: tabular-nums; }
.bb-cell b.good { color: #8fe0b2; } .bb-cell b.bad { color: #ff9b8a; } .bb-cell b.muted { color: #9fb4d4; }
.bb-pending { height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(255, 200, 90, .55); background: rgba(255, 200, 90, .12); color: #ffd27a; font-weight: 700; font-size: 13px; white-space: nowrap; }

/* ───────── 單價庫 ───────── */
.catalog-hero { display: grid; gap: 18px; }
@media (min-width: 1000px) { .catalog-hero { grid-template-columns: 1fr 1.5fr; align-items: start; } }
.catalog-hero-text { display: grid; gap: 8px; align-content: start; }
.tiles { display: grid; gap: 12px; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); }
.tile b { font-size: 15px; }
.drop-tile { cursor: pointer; border: 2px dashed var(--line-strong); transition: border-color .2s; }
.drop-tile:hover { border-color: var(--brand); }
.drop-tile.busy { opacity: .6; }

/* ───────── 報價單 ───────── */
.quotes-hero { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; align-items: flex-end; }
.kpis { display: flex; gap: 10px; flex-wrap: wrap; }
.kpis > div { min-width: 110px; padding: 10px 16px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); display: flex; flex-direction: column; }
.kpis small { font-size: 12px; color: var(--muted); }
.kpis b { font: 800 22px var(--f-display); font-variant-numeric: tabular-nums; }
.status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.s-draft { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line-strong); }
.s-sent { background: var(--sel-bg); color: var(--brand-strong); }
.s-won { background: color-mix(in srgb, var(--bulb) 30%, var(--surface)); color: var(--bulb-ink); box-shadow: 0 0 14px -4px var(--bulb-glow); }
.s-lost { background: color-mix(in srgb, var(--bad) 12%, var(--surface)); color: var(--bad); }
:root[data-theme="night"] .s-won { color: #ffd27a; }
.editor-bar { position: sticky; top: 8px; z-index: 30; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 18px; background: color-mix(in srgb, var(--surface) 88%, transparent); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(10px); }
.quote-sum { display: grid; gap: 16px; margin-top: 16px; }
@media (min-width: 900px) { .quote-sum { grid-template-columns: 1fr 380px; align-items: start; } }
.quote-sum-inputs { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.stamp-row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.stamp-box { width: 120px; height: 120px; border-radius: 16px; border: 2px dashed var(--line-strong); display: grid; place-items: center; background: #fff; overflow: hidden; }
.stamp-box img { max-width: 100%; max-height: 100%; }

/* 詢價單 */
.lead-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.lead { padding: 16px 18px; }
.lead.done { opacity: .7; }
.lead-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; align-items: baseline; }
.lead-name { font-size: 18px; font-weight: 900; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.lead-total { font: 800 22px var(--f-display); }
.lead-total small { font-size: 12px; margin-right: 4px; color: var(--muted); font-family: var(--f-body); }
.lead-contact { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13.5px; margin-top: 6px; }
.lead-contact a { display: inline-flex; gap: 4px; align-items: center; }
.lead-msg { margin-top: 6px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-size: 14px; white-space: pre-wrap; }
.lead details { margin-top: 8px; font-size: 13.5px; }
.lead-lines { margin: 6px 0 0; padding-left: 18px; color: var(--ink-2); }

/* ───────── 對話框、挑選器、提示 ───────── */
.modal-back { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(3, 10, 26, .62); backdrop-filter: blur(4px); animation: fadeIn .2s; }
.modal { width: min(720px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); animation: popIn .25s cubic-bezier(.2, .8, .2, 1); }
.modal.wide { width: min(1060px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 17px; font-weight: 900; }
.modal-body { padding: 16px 18px; overflow: auto; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.picker-tools { display: grid; gap: 10px; margin-bottom: 14px; }
.picker-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.pick { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 10px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface-2); text-align: center; transition: transform .15s, border-color .15s; }
.pick:hover { transform: translateY(-2px); border-color: var(--brand); }
.pick-name { font-size: 13px; font-weight: 700; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pick-price { font-size: 12px; color: var(--muted); }
.pick-price em { font-style: normal; color: var(--brand); }
.toast-wrap { position: fixed; left: 0; right: 0; bottom: 24px; z-index: 80; display: grid; justify-items: center; gap: 8px; padding: 0 16px; pointer-events: none; }
.toast { pointer-events: auto; display: inline-flex; gap: 8px; align-items: center; max-width: 520px; padding: 11px 18px; border-radius: 999px; background: var(--navy-800); color: #eaf2fb; font-size: 14px; font-weight: 500; box-shadow: 0 14px 34px -10px rgba(0, 0, 0, .55), 0 0 0 1px rgba(128, 175, 219, .25); animation: toastIn .35s cubic-bezier(.2, .8, .2, 1); }
.toast .ico { color: var(--bulb-amber); }
.toast.t-warn { box-shadow: 0 14px 34px -10px rgba(0, 0, 0, .55), 0 0 0 1.5px var(--coral-hex); }
.toast.t-warn .ico { color: #ffab95; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } }
body:has(.bottom-bar) .toast-wrap { bottom: 90px; }
.preview-pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #241800; background: var(--bulb-amber); box-shadow: 0 0 18px -4px rgba(255, 194, 75, .8); white-space: nowrap; }
.hero-top-right { display: flex; align-items: center; gap: 8px; }
@media (max-width: 640px) { .preview-pill { display: none; } }
.burst-layer { position: fixed; inset: 0; z-index: 90; pointer-events: none; }

/* 頁尾 */
.footer { background: var(--navy-950); color: #b9cbe4; padding: 34px 0 calc(34px + env(safe-area-inset-bottom, 0px)); margin-top: 20px; }
.footer-inner { display: grid; gap: 14px; justify-items: start; }
@media (min-width: 900px) { .footer-inner { grid-template-columns: auto 1fr; align-items: center; column-gap: 32px; } .footer-fine { grid-column: 1 / -1; } }
.footer-logo { width: 96px; height: auto; background: #fff; padding: 8px 10px; border-radius: 12px; }
.footer-contact { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14px; }
.footer-contact a { color: #dbe7f6; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.footer-contact a:hover { color: var(--bulb-amber); }
.footer-fine { font-size: 12.5px; color: #7f93b5; }
.footer .link-btn { color: var(--sky); font-size: 12.5px; }

/* ───────── 報價單紙本 ───────── */
.print-area { display: none; }
.paper-preview { background: #e8edf5; padding: 18px; border-radius: 12px; }
.paper-preview .qdoc { background: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); padding: 28px 30px; border-radius: 4px; max-width: 820px; margin: 0 auto; }
.qdoc { color: #13203d; font-size: 12.5px; line-height: 1.55; font-family: var(--f-body); }
.qdoc-head { display: grid; grid-template-columns: 110px 1fr auto; gap: 16px; align-items: center; padding-bottom: 12px; border-bottom: 3px solid #3d62ad; }
.qdoc-logo { width: 110px; height: auto; }
.qdoc-co { display: flex; flex-direction: column; font-size: 11.5px; color: #3c4b69; }
.qdoc-co b { font-size: 15px; color: #0b1b3a; }
.qdoc-title { text-align: right; }
.qdoc-title h1 { font-size: 30px; font-weight: 900; letter-spacing: .35em; margin-right: -.35em; color: #092042; }
.qdoc-title span { font: 700 10.5px var(--f-display); letter-spacing: .3em; color: #3d62ad; }
.qdoc-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.qdoc-meta dl { margin: 0; padding: 8px 10px; border-radius: 6px; background: #f2f6fc; border: 1px solid #dbe5f3; }
.qdoc-meta dl > div { display: grid; grid-template-columns: 64px 1fr; gap: 6px; padding: 1px 0; }
.qdoc-meta dt { color: #66789a; font-size: 11px; }
.qdoc-meta dd { margin: 0; font-weight: 500; word-break: break-all; }
.qdoc-items { width: 100%; border-collapse: collapse; }
.qdoc-items th { background: #092042; color: #fff; font-size: 11px; font-weight: 700; padding: 6px 8px; text-align: left; }
.qdoc-items th:nth-child(n+3) { text-align: right; }
.qdoc-items th:nth-child(3) { text-align: center; }
.qdoc-items td { padding: 6px 8px; border-bottom: 1px solid #dfe6f1; vertical-align: top; }
.qdoc-items td:nth-child(1), .qdoc-items td:nth-child(3) { text-align: center; color: #66789a; }
.qdoc-items td.r { text-align: right; font-variant-numeric: tabular-nums; }
.qdoc-items tbody tr:nth-child(even) td { background: #f7f9fd; }
.qdoc-items small { display: block; font-size: 10.5px; color: #66789a; }
.qdoc-bottom { display: grid; grid-template-columns: 1fr 250px; gap: 18px; margin-top: 12px; align-items: start; }
.qdoc-terms h3 { font-size: 12px; font-weight: 900; color: #092042; margin-bottom: 4px; }
.qdoc-terms ol { margin: 0; padding-left: 18px; font-size: 10.5px; color: #3c4b69; }
.qdoc-bank { margin-top: 8px; font-size: 11px; display: grid; }
.qdoc-sum { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.qdoc-sum th { text-align: left; font-weight: 500; color: #3c4b69; padding: 4px 0; }
.qdoc-sum td { text-align: right; padding: 4px 0; font-variant-numeric: tabular-nums; }
.qdoc-sum tr.grand th, .qdoc-sum tr.grand td { border-top: 2px solid #092042; border-bottom: 2px solid #092042; padding: 7px 0; font-weight: 900; font-size: 15px; color: #092042; }
.qdoc-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.qdoc-sign > div { position: relative; height: 96px; border: 1.5px dashed #9fb2d0; border-radius: 6px; padding: 6px 10px; }
.qdoc-sign span { font-size: 11px; color: #66789a; }
.qdoc-stamp { position: absolute; right: 12px; bottom: 6px; max-height: 84px; max-width: 46%; mix-blend-mode: multiply; }
.qdoc-foot { margin-top: 10px; text-align: center; font-size: 10.5px; color: #3d62ad; letter-spacing: .1em; }

/* ───────── 手機 ───────── */
@media (max-width: 640px) {
  .hero-inner { padding-top: 64px; }
  .hero-lights { height: 60px; }
  .beam { width: 220px; }
  .main { margin-top: -40px; }
  .door { flex-direction: column; min-height: 0; }
  .door-ico { width: 64px; height: 64px; border-radius: 18px; }
  .progress-steps li:not(:last-child)::after { display: none; }
  .pstep-ico { width: 48px; height: 48px; border-radius: 14px; }
  .pstep-ico .sketch { width: 32px; height: 32px; }
  .totalbox { max-width: none; }
  .bb-sum { gap: 12px; }
  .quote-sum-inputs { grid-template-columns: 1fr; }
  .editor-bar { position: static; }
}

/* ───────── 減少動態 ───────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1; transform: none; }
  .beam, .hero-fx { display: none; }
  .tilt { transform: none; }
}

/* ───────── 列印 ───────── */
@page { size: A4; margin: 12mm; }
@media print {
  :root { color-scheme: light; }
  body { background: #fff !important; color: #000; }
  .hero, .footer, .no-print, .bottom-bar, .toast-wrap, .modal-back, .share-banner, .burst-layer { display: none !important; }
  .main { margin: 0; padding: 0; }
  .shell { max-width: none; padding: 0; }
  .card { box-shadow: none; border: 0; padding: 0; background: #fff; color: #000; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .print-only { display: flex !important; }
  .print-head { gap: 14px; align-items: center; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 2px solid #3d62ad; }
  #est-ask, #est-lead { display: none !important; }
  .step-head .step-actions, .step-sketch { display: none !important; }
  .est-row { grid-template-columns: 40px 1fr auto 100px; grid-template-areas: "thumb main in amt"; break-inside: avoid; }
  .inp { border: 0; background: none; padding: 0; height: auto; width: auto; }
  .totalbox { background: #fff; border-color: #999; }
  body.print-quote #app > *:not(main), body.print-quote main > * > *:not(#print-quote) { display: none !important; }
  body.print-quote #print-quote { display: block !important; }
  body.print-quote .qdoc { font-size: 11.5px; }
  .qdoc-items thead { display: table-header-group; }
  .qdoc-items tr, .qdoc-sign, .qdoc-bottom { break-inside: avoid; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
