/* ============================================================
   立曜 MCP-LTS 「賣場 Showroom」設計（2026-08-22，依 Claude Design canvas）
   來源：F:\CLAUDE\liyao-design\mcp-lts-redesign\*.dc.html
   規則：品牌靛藍 / 玫紅價 / 綠現貨 / 橘熱賣 / 琥珀官方範本；Noto Sans TC；
         卡 16px、鈕 12px、chip 999；不用漸層、不用 emoji，圖示一律線性 SVG。
   這個檔案只放 ly-* 語意類別；Tailwind 工具類沿用 /static/tailwind.css。
   ============================================================ */
:root {
  --ly-bg: #F5F6F8; --ly-card: #FFFFFF; --ly-ink: #0F172A; --ly-soft: #475569; --ly-muted: #94A3B8;
  --ly-line: #E8EBEF; --ly-line2: #F1F3F6;
  --ly-brand: #4F46E5; --ly-brand-h: #4338CA; --ly-brand-soft: #EEF2FF; --ly-brand-line: #C7D2FE;
  --ly-price: #E11D48; --ly-price-soft: #FEF2F2; --ly-price-line: #FECACA;
  --ly-stock: #16A34A; --ly-stock-ink: #15803D; --ly-stock-soft: #DCFCE7;
  --ly-hot: #F97316; --ly-hot-soft: #FFF7ED;
  --ly-gold: #D97706; --ly-gold-soft: #FEF3C7; --ly-gold-line: #FCD34D;
  --ly-warn-ink: #B45309; --ly-warn-bg: #FFFBEB; --ly-warn-line: #FDE68A;
  --ly-shadow: 0 4px 16px -8px rgba(15,23,42,.15);
  --ly-brand-shadow: 0 8px 18px -8px rgba(79,70,229,.5);
  --ly-topbar-h: 64px;
}
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--ly-bg); color: var(--ly-ink);
  font-family: 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', system-ui, sans-serif;
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column;
}
.ly-main { flex: 1 0 auto; width: 100%; }
.ly-wrap { max-width: 1440px; margin: 0 auto; padding: 0 48px; }
button { font-family: inherit; }
.ly-svg { width: 18px; height: 18px; flex-shrink: 0; }
.ly-svg-sm { width: 16px; height: 16px; flex-shrink: 0; }
.ly-svg-xs { width: 14px; height: 14px; flex-shrink: 0; }

/* ── 頂欄 ─────────────────────────────────────────── */
.ly-topbar {
  position: sticky; top: 0; z-index: 60; height: var(--ly-topbar-h);
  background: var(--ly-card); border-bottom: 1px solid var(--ly-line);
}
.ly-topbar .ly-wrap { height: 100%; display: flex; align-items: center; gap: 36px; }
.ly-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.ly-logo-mark {
  width: 36px; height: 36px; border-radius: 10px; background: var(--ly-brand); color: #fff;
  font-size: 18px; font-weight: 900; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--ly-brand-shadow);
}
.ly-logo-name { font-size: 17px; font-weight: 900; letter-spacing: -0.01em; line-height: 1.2; }
.ly-logo-sub { font-size: 11px; font-weight: 600; color: var(--ly-muted); letter-spacing: 0.08em; line-height: 1.2; }
.ly-nav { display: flex; align-items: center; gap: 4px; }
.ly-nav .nav-btn {
  padding: 8px 14px; border-radius: 10px; font-size: 14px; font-weight: 700; color: var(--ly-soft);
  background: none; border: 0; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
  transition: background .15s, color .15s;
}
.ly-nav .nav-btn:hover { background: #F1F3F6; color: var(--ly-ink); }
.ly-nav .nav-btn.active { background: var(--ly-brand-soft); color: var(--ly-brand); }
.ly-topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.ly-count {
  background: var(--ly-brand); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; line-height: 16px;
}
.ly-user { display: flex; align-items: center; gap: 8px; }
.ly-user-avatar {
  width: 32px; height: 32px; border-radius: 999px; background: var(--ly-brand-soft); color: var(--ly-brand);
  font-size: 13px; font-weight: 900; display: flex; align-items: center; justify-content: center;
}
.ly-user-name { font-size: 14px; font-weight: 700; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ly-icon-btn {
  width: 40px; height: 40px; border-radius: 12px; border: 0; background: none; color: var(--ly-soft);
  display: none; align-items: center; justify-content: center; cursor: pointer;
}
.ly-icon-btn svg { width: 24px; height: 24px; }

/* ── 按鈕 ─────────────────────────────────────────── */
.ly-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 14px;
  border-radius: 12px; border: 1px solid var(--ly-line); background: var(--ly-card); color: var(--ly-ink);
  font-size: 14px; font-weight: 700; cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s, color .15s, transform .15s, box-shadow .15s;
}
.ly-btn:hover { background: #F8FAFC; border-color: #D5DAE1; }
.ly-btn:active { transform: translateY(1px); }
.ly-btn:disabled { opacity: .5; cursor: not-allowed; }
.ly-btn.on { background: var(--ly-ink); color: #fff; border-color: var(--ly-ink); }
.ly-btn-primary { background: var(--ly-brand); color: #fff; border-color: var(--ly-brand); box-shadow: var(--ly-brand-shadow); }
.ly-btn-primary:hover { background: var(--ly-brand-h); border-color: var(--ly-brand-h); color: #fff; }
.ly-btn-rose { background: var(--ly-price-soft); color: var(--ly-price); border-color: var(--ly-price-soft); }
.ly-btn-rose:hover { background: #FEE2E2; border-color: #FEE2E2; }
/* LINE 傳給門市（10/15）：LINE 官方綠 */
.ly-btn-line { background: #06C755; color: #fff; border-color: #06C755; }
.ly-btn-line:hover { background: #05B34C; border-color: #05B34C; color: #fff; }
.ly-line-ask { align-self: flex-start; font-size: 13px; font-weight: 600; color: var(--ly-soft); text-decoration: none; }
.ly-line-ask b { color: #06A847; font-weight: 800; }
.ly-line-ask:hover b { text-decoration: underline; }
.ly-line-hint { margin-top: 10px; font-size: 12.5px; color: var(--ly-muted); line-height: 1.6; }
.ly-btn-ghost { border-color: transparent; background: none; color: var(--ly-muted); }
.ly-btn-ghost:hover { background: #F1F3F6; color: var(--ly-ink); border-color: transparent; }
.ly-btn-danger-ghost:hover { background: #FEF2F2; color: var(--ly-price); }
.ly-btn-sm { height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.ly-btn-lg { height: 48px; padding: 0 22px; font-size: 15px; }
.ly-btn-block { width: 100%; }
.ly-btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 10px; }
.ly-btn-icon.gold { color: var(--ly-gold); }
.ly-link { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--ly-brand); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: none; }
.ly-link:hover { color: var(--ly-brand-h); }
.ly-link-sm { font-size: 13px; }

/* ── 卡片 / 標題 / 徽章 / 輸入 ─────────────────────── */
.ly-card { background: var(--ly-card); border: 1px solid var(--ly-line); border-radius: 16px; box-shadow: var(--ly-shadow); }
.ly-page { max-width: 1440px; margin: 0 auto; padding: 32px 48px 40px; }
.ly-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.ly-h1 { margin: 0; font-size: 26px; font-weight: 900; letter-spacing: -0.01em; line-height: 1.25; }
.ly-h2 { margin: 0; font-size: 26px; font-weight: 900; letter-spacing: -0.01em; }
.ly-sub { font-size: 13px; font-weight: 500; color: var(--ly-muted); margin-top: 4px; }
.ly-eyebrow { font-size: 11px; font-weight: 700; color: var(--ly-muted); letter-spacing: 0.06em; }
.ly-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ly-badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; white-space: nowrap; line-height: 1.5; flex-shrink: 0;
}
.ly-badge.stock { background: var(--ly-stock-soft); color: var(--ly-stock-ink); }
.ly-badge.out { background: #FEE2E2; color: #DC2626; }
.ly-badge.hot { background: var(--ly-hot); color: #fff; padding: 3px 9px; }
.ly-badge.hot-soft { background: var(--ly-hot-soft); color: var(--ly-hot); }
.ly-badge.gold { background: var(--ly-gold-soft); color: var(--ly-gold); padding: 3px 9px; }
.ly-badge.rose { background: var(--ly-price-soft); color: var(--ly-price); padding: 3px 9px; }
.ly-badge.brand { background: var(--ly-brand-soft); color: var(--ly-brand); }
.ly-badge svg { width: 11px; height: 11px; }
.ly-input {
  height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--ly-line); background: var(--ly-card);
  font-size: 14px; color: var(--ly-ink); outline: none; width: 100%; font-family: inherit; transition: border-color .15s, box-shadow .15s;
}
.ly-input::placeholder { color: var(--ly-muted); }
.ly-input:focus { border-color: var(--ly-brand); box-shadow: 0 0 0 3px rgba(79,70,229,.15); }
.ly-input-wrap { position: relative; display: flex; align-items: center; }
.ly-input-wrap > svg { position: absolute; left: 14px; color: var(--ly-muted); pointer-events: none; }
.ly-input-wrap > .ly-input { padding-left: 40px; }
.ly-input-wrap > .ly-clear { position: absolute; right: 8px; }
.ly-price { color: var(--ly-price); font-weight: 900; letter-spacing: -0.01em; }
.ly-cat-tag { width: 44px; flex-shrink: 0; font-size: 11px; font-weight: 700; color: var(--ly-muted); }
.ly-cat-chip {
  width: 44px; flex-shrink: 0; padding: 2px 4px; border-radius: 6px; background: var(--ly-brand-soft); color: var(--ly-brand);
  font-size: 11px; font-weight: 700; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ly-chip {
  padding: 10px 18px; border-radius: 12px; border: 1px solid var(--ly-line); background: var(--ly-card);
  font-size: 15px; font-weight: 700; color: var(--ly-ink); cursor: pointer; transition: all .15s; white-space: nowrap;
}
.ly-chip:hover { border-color: #CBD2DB; background: #F8FAFC; }
.ly-chip.on { background: var(--ly-ink); color: #fff; border-color: var(--ly-ink); }
.ly-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ly-pill {
  padding: 7px 16px; border-radius: 999px; border: 1px solid var(--ly-line); background: var(--ly-card);
  font-size: 13px; font-weight: 700; color: var(--ly-soft); cursor: pointer; display: inline-flex; align-items: center; gap: 5px; transition: all .15s; white-space: nowrap;
}
.ly-pill:hover { background: #F8FAFC; }
.ly-pill.on, .ly-pill.active { background: var(--ly-ink); color: #fff; border-color: var(--ly-ink); }
.ly-pills { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ly-empty { grid-column: 1 / -1; text-align: center; color: var(--ly-muted); padding: 40px 16px; font-size: 14px; font-weight: 500; }
.ly-divider { height: 1px; background: var(--ly-line); }
.ly-note {
  display: flex; align-items: flex-start; gap: 8px; background: var(--ly-brand-soft); border-radius: 10px; padding: 10px 12px;
  font-size: 12px; font-weight: 500; line-height: 1.5; color: var(--ly-brand-h);
}
.ly-note svg { flex-shrink: 0; margin-top: 1px; }
.ly-note.warn { background: var(--ly-price-soft); color: #B91C1C; }
.ly-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }

/* ── 首頁 ─────────────────────────────────────────── */
.ly-hero { padding: 56px 0 44px; display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 56px; align-items: start; }
.ly-hero > *, .ly-build-grid > *, .ly-parts-grid > *, .ly-grid-3 > *, .ly-hist-grid > * { min-width: 0; }
.ly-hero-copy { display: flex; flex-direction: column; gap: 24px; }
.ly-live-pill {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; padding: 5px 12px 5px 10px; border-radius: 999px;
  background: var(--ly-brand-soft); color: var(--ly-brand); font-size: 12px; font-weight: 700;
}
.ly-live-dot { width: 8px; height: 8px; border-radius: 999px; background: var(--ly-stock); display: inline-block; }
.ly-hero h1 { margin: 0; font-size: 54px; font-weight: 900; line-height: 1.15; letter-spacing: -0.02em; text-wrap: pretty; }
.ly-hero p.lead { margin: 0; font-size: 18px; line-height: 1.6; color: var(--ly-soft); max-width: 580px; text-wrap: pretty; }
.ly-hero-form { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.ly-hero-form .ly-label { font-size: 13px; font-weight: 700; }
.ly-hero-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ly-hero-custom { position: relative; width: 260px; }
.ly-hero-custom .ly-input { height: 48px; padding-right: 40px; font-size: 15px; }
.ly-hero-custom .unit { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 13px; font-weight: 700; color: var(--ly-muted); }
.ly-trust { display: flex; align-items: center; gap: 22px; margin-top: 4px; font-size: 13px; font-weight: 600; color: var(--ly-soft); flex-wrap: wrap; }
.ly-trust span { display: inline-flex; align-items: center; gap: 6px; }
.ly-trust svg { width: 16px; height: 16px; color: var(--ly-stock); }
.ly-stock-card { padding: 22px 24px 18px; display: flex; flex-direction: column; gap: 14px; }
.ly-stock-head { display: flex; align-items: center; justify-content: space-between; }
.ly-stock-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 900; }
.ly-stock-title svg { color: var(--ly-brand); }
.ly-stock-num { display: flex; align-items: baseline; gap: 8px; }
.ly-stock-num b { font-size: 40px; font-weight: 900; line-height: 1; letter-spacing: -0.02em; }
.ly-stock-num span { font-size: 13px; font-weight: 600; color: var(--ly-muted); }
.ly-stock-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--ly-line2); }
.ly-stock-row:last-child { border-bottom: 0; }
.ly-stock-row .nm { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ly-stock-row .nm b { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ly-stock-row .nm span { font-size: 11px; color: var(--ly-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ly-stock-row .pr { font-size: 14px; font-weight: 900; color: var(--ly-price); min-width: 62px; text-align: right; }
/* 首頁「怎麼買＋門市資訊」卡（2026-10-12 取代今日現貨卡；上面 .ly-stock-* 已沒在用，留著無害） */
.ly-store-card { padding: 22px 24px 20px; display: flex; flex-direction: column; gap: 16px; }
.ly-store-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 900; }
.ly-store-title svg { color: var(--ly-brand); }
.ly-howto { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.ly-howto li { display: flex; align-items: flex-start; gap: 12px; }
.ly-howto li > b { width: 24px; height: 24px; border-radius: 999px; background: var(--ly-brand-soft); color: var(--ly-brand); font-size: 12px; font-weight: 900; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }
.ly-howto li strong { display: block; font-size: 14px; font-weight: 700; line-height: 1.4; }
.ly-howto li span { display: block; font-size: 12px; font-weight: 500; color: var(--ly-muted); line-height: 1.5; margin-top: 2px; }
.ly-store-info { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--ly-soft); }
.ly-store-info .nm { font-size: 14px; font-weight: 900; color: var(--ly-ink); margin-bottom: 2px; }
.ly-store-info .row { display: flex; align-items: flex-start; gap: 8px; line-height: 1.5; }
.ly-store-info svg { width: 15px; height: 15px; flex-shrink: 0; margin-top: 3px; color: var(--ly-muted); }
.ly-store-actions { display: flex; gap: 8px; }
.ly-store-actions .ly-btn { flex: 1 1 0; height: 42px; }
.ly-sec { padding: 8px 0 44px; display: flex; flex-direction: column; gap: 20px; }
.ly-sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.ly-sec-head-right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

/* 商品卡（首頁熱門精選） */
.ly-prod { display: flex; flex-direction: column; overflow: hidden; transition: transform .2s, box-shadow .2s; }
.ly-prod:hover { transform: translateY(-3px); box-shadow: 0 14px 28px -14px rgba(15,23,42,.25); }
.ly-prod-body { padding: 18px 20px 0; display: flex; flex-direction: column; gap: 10px; }
.ly-prod-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ly-prod-tag { font-size: 12px; font-weight: 700; color: var(--ly-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ly-prod-name { font-size: 18px; font-weight: 900; letter-spacing: -0.01em; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ly-prod-rows { display: flex; flex-direction: column; gap: 6px; padding-bottom: 16px; }
.ly-prod-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ly-prod-row span:last-child { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ly-prod-foot { margin-top: auto; padding: 14px 20px 16px; border-top: 1px solid var(--ly-line); display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.ly-prod-pricebox { display: flex; flex-direction: column; gap: 4px; }
.ly-prod-pricebox .lbl { font-size: 11px; font-weight: 600; color: var(--ly-muted); }
.ly-prod-pricebox .row { display: flex; align-items: center; gap: 8px; }
.ly-prod-pricebox .ly-price { font-size: 26px; line-height: 1; }
.ly-prod-actions { display: flex; align-items: center; gap: 8px; }

/* ── 頁尾 ─────────────────────────────────────────── */
.ly-footer { margin-top: 8px; border-top: 1px solid var(--ly-line); background: var(--ly-card); }
.ly-footer .ly-wrap { padding-top: 22px; padding-bottom: 28px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 12px; font-weight: 500; color: var(--ly-muted); }
.ly-footer-links { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.ly-footer-links a { color: var(--ly-soft); font-weight: 600; text-decoration: none; }
.ly-footer-links a:hover { color: var(--ly-brand); }

/* ── AI 配單 ──────────────────────────────────────── */
.ly-build-grid { display: grid; grid-template-columns: minmax(0, 1fr) 560px; gap: 28px; align-items: start; margin-top: 22px; }
.ly-wiz { overflow: hidden; display: flex; flex-direction: column; }
.ly-step { padding: 22px 24px; border-bottom: 1px solid var(--ly-line); display: flex; flex-direction: column; gap: 14px; }
.ly-step:first-child { padding-top: 24px; }
.ly-step-head { display: flex; align-items: center; gap: 10px; }
.ly-step-no { width: 26px; height: 26px; border-radius: 999px; background: var(--ly-brand); color: #fff; font-size: 13px; font-weight: 900; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ly-step-title { font-size: 16px; font-weight: 900; }
.ly-step-hint { font-size: 11px; font-weight: 600; color: var(--ly-muted); }
.ly-step-hint.req { color: var(--ly-price); font-weight: 700; }
.ly-custom-row { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--ly-soft); }
.ly-custom-row .ly-input { width: 220px; }
.ly-adv { border-bottom: 1px solid var(--ly-line); }
.ly-adv summary { padding: 14px 24px; display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ly-soft); cursor: pointer; list-style: none; user-select: none; }
.ly-adv summary::-webkit-details-marker { display: none; }
.ly-adv summary svg { transition: transform .15s; }
.ly-adv[open] summary svg { transform: rotate(90deg); }
.ly-adv-body { padding: 0 24px 18px; display: flex; flex-direction: column; gap: 10px; }
.ly-textarea { width: 100%; min-height: 96px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--ly-line); font-size: 14px; font-family: inherit; resize: vertical; outline: none; color: var(--ly-ink); }
.ly-textarea:focus { border-color: var(--ly-brand); box-shadow: 0 0 0 3px rgba(79,70,229,.15); }
.ly-submit { padding: 18px 24px 22px; background: #F9FAFB; display: flex; flex-direction: column; gap: 12px; }
.ly-preview { display: flex; align-items: center; min-height: 44px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--ly-line); background: var(--ly-card); font-size: 14px; font-weight: 700; line-height: 1.4; }
.ly-preview.empty { color: var(--ly-muted); font-weight: 500; }
.ly-result-col { display: flex; flex-direction: column; gap: 16px; position: sticky; top: calc(var(--ly-topbar-h) + 20px); }
.ly-result-empty { padding: 48px 24px; text-align: center; color: var(--ly-muted); font-size: 14px; font-weight: 500; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ly-result-empty svg { width: 36px; height: 36px; color: var(--ly-brand-line); }
.ly-loading { padding: 36px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; color: var(--ly-soft); font-size: 14px; font-weight: 700; }
.ly-dots { display: flex; gap: 6px; }
.ly-dots i { width: 10px; height: 10px; border-radius: 999px; background: var(--ly-brand); animation: lyBounce 1s infinite; display: block; }
.ly-dots i:nth-child(2) { animation-delay: .12s; } .ly-dots i:nth-child(3) { animation-delay: .24s; }
@keyframes lyBounce { 0%,80%,100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-7px); opacity: 1; } }
.ly-ai-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--ly-brand-soft); color: var(--ly-brand-h); font-size: 13px; line-height: 1.6; font-weight: 500; }
.ly-ai-note svg { flex-shrink: 0; margin-top: 2px; }
.ly-res { padding: 22px 24px 20px; display: flex; flex-direction: column; gap: 14px; }
.ly-res-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.ly-res-name { font-size: 20px; font-weight: 900; letter-spacing: -0.01em; line-height: 1.3; }
.ly-res-total { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.ly-res-total .lbl { font-size: 11px; font-weight: 600; color: var(--ly-muted); }
.ly-res-total .ly-price { font-size: 32px; line-height: 1; }
.ly-fit { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.ly-fit .lbl { font-weight: 700; white-space: nowrap; }
.ly-fit .bar { flex: 1; height: 6px; border-radius: 999px; background: var(--ly-line); overflow: hidden; }
.ly-fit .bar i { display: block; height: 100%; border-radius: 999px; background: var(--ly-stock); }
.ly-fit .bar i.over { background: var(--ly-price); }
.ly-fit .val { font-weight: 600; color: var(--ly-soft); white-space: nowrap; }
.ly-fit .val.over { color: var(--ly-price); }
.ly-res-rows { display: flex; flex-direction: column; }
.ly-res-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--ly-line2); }
.ly-res-row:last-child { border-bottom: 0; }
/* 2026-10-12：桌機也換行顯示完整品名（以前單行省略號，客人沒滑鼠移上去看不到完整規格） */
.ly-res-row .nm { flex: 1; min-width: 0; font-size: 14px; font-weight: 500; line-height: 1.45; white-space: normal; overflow-wrap: anywhere; }
.ly-res-row .nm b { color: var(--ly-brand); }
.ly-res-row .nm small { font-size: 11px; color: var(--ly-muted); margin-left: 4px; }
.ly-res-row .pr { width: 70px; text-align: right; font-size: 14px; font-weight: 900; flex-shrink: 0; }
.ly-warn { background: var(--ly-price-soft); border: 1px solid var(--ly-price-line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.ly-warn div { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; font-weight: 700; color: #B91C1C; line-height: 1.5; }
.ly-warn svg { flex-shrink: 0; margin-top: 2px; }
.ly-fix { background: var(--ly-warn-bg); border: 1px solid var(--ly-warn-line); border-radius: 12px; padding: 12px 14px; color: var(--ly-warn-ink); }
.ly-fix summary { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; cursor: pointer; list-style: none; user-select: none; }
.ly-fix summary::-webkit-details-marker { display: none; }
.ly-fix summary .chev { margin-left: auto; transition: transform .15s; }
.ly-fix[open] summary .chev { transform: rotate(180deg); }
.ly-fix-body { display: flex; flex-direction: column; gap: 4px; font-size: 13px; line-height: 1.5; margin-top: 8px; }
.ly-res-actions { display: flex; align-items: center; gap: 8px; padding-top: 4px; flex-wrap: wrap; }
.ly-res-actions .ly-link { margin-right: auto; }

/* ── 零件選配 ─────────────────────────────────────── */
.ly-parts-grid { display: grid; grid-template-columns: 200px minmax(0, 1fr) 340px; gap: 20px; align-items: start; margin-top: 16px; }
.ly-cat-rail { position: sticky; top: calc(var(--ly-topbar-h) + 20px); padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.ly-cat {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; font-size: 14px; font-weight: 700; color: var(--ly-soft);
  background: none; border: 0; cursor: pointer; text-align: left; width: 100%; transition: background .15s, color .15s; white-space: nowrap;
}
.ly-cat:hover { background: #F1F3F6; color: var(--ly-ink); }
.ly-cat.done { background: var(--ly-brand-soft); color: var(--ly-brand); }
.ly-cat .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ly-cat .cnt { font-size: 12px; font-weight: 600; color: var(--ly-muted); }
.ly-cat .ok { width: 16px; height: 16px; color: var(--ly-stock); }
/* 10/19 老闆「零件選配 CPU位置跑掉了」：overflow:hidden 讓這張卡變成捲動容器，裡面黏頂的搜尋框以卡片為準往下推 64px、蓋住第一列 CPU。
   clip 一樣裁圓角但不是捲動容器，搜尋框改以視窗為準黏在頂列下面；不支援 clip 的舊瀏覽器退回 visible（不裁、但不會蓋住） */
.ly-parts-main { overflow: visible; overflow: clip; display: flex; flex-direction: column; min-width: 0; }
.ly-parts-search { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--ly-line); position: sticky; top: var(--ly-topbar-h); background: var(--ly-card); z-index: 5; border-radius: 16px 16px 0 0; }
.ly-parts-search .ly-input-wrap { flex: 1; }
.ly-parts-search .ly-input { height: 40px; }
.ly-parts-foot { padding: 12px 16px; font-size: 12px; font-weight: 500; color: var(--ly-muted); }
#catalog-table { display: flex; flex-direction: column; }
.catalog-row-card { border-bottom: 1px solid var(--ly-line2); border-left: 4px solid transparent; transition: background .15s, border-color .15s; }
.catalog-row-card:last-child { border-bottom: 0; }
.catalog-row-card.selected { border-left-color: var(--ly-brand); background: var(--ly-brand-soft); }
.ly-unit-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px 8px; }
.exp-toggle { display: flex; align-items: center; gap: 8px; flex-shrink: 0; background: none; border: 0; padding: 4px 6px 4px 2px; margin-left: -2px; border-radius: 8px; cursor: pointer; color: var(--ly-soft); text-align: left; }
.exp-toggle:hover { background: rgba(79,70,229,.08); color: var(--ly-brand); }
.exp-toggle .ico { width: 30px; height: 30px; border-radius: 8px; background: #F1F3F6; display: flex; align-items: center; justify-content: center; color: var(--ly-soft); flex-shrink: 0; }
.catalog-row-card.selected .exp-toggle .ico { background: #fff; color: var(--ly-brand); }
.exp-toggle .lbl { font-size: 14px; font-weight: 700; width: 60px; white-space: nowrap; color: var(--ly-ink); }
.exp-chevron { width: 14px; height: 14px; color: var(--ly-muted); transition: transform .18s; flex-shrink: 0; }
.catalog-row-card.row-open .exp-chevron { transform: rotate(90deg); color: var(--ly-brand); }
.ly-extra-lbl { display: flex; align-items: center; gap: 8px; flex-shrink: 0; width: 110px; padding-left: 8px; font-size: 12px; font-weight: 700; color: var(--ly-muted); }
.ly-select {
  flex: 1; min-width: 0; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--ly-line); background: var(--ly-card);
  font-size: 14px; color: var(--ly-ink); font-family: inherit; outline: none;
}
.ly-select:focus { border-color: var(--ly-brand); box-shadow: 0 0 0 3px rgba(79,70,229,.15); }
.ly-unit-price { flex-shrink: 0; width: 84px; text-align: right; font-size: 16px; font-weight: 900; color: var(--ly-price); }
.ly-unit-price.empty { color: #CBD5E1; font-weight: 700; }
.ly-qty { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.ly-qty-btn { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--ly-line); background: var(--ly-card); color: var(--ly-soft); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: all .15s; }
.ly-qty-btn:hover { background: #F8FAFC; }
.ly-qty-btn.plus { background: var(--ly-brand-soft); border-color: var(--ly-brand-line); color: var(--ly-brand); }
.ly-qty-btn.plus:hover { background: #E0E7FF; }
.ly-qty-btn:active { transform: scale(.95); }
.ly-qty-num { width: 24px; text-align: center; font-size: 14px; font-weight: 700; }
.ly-rm-btn { width: 32px; height: 32px; border-radius: 8px; border: 0; background: none; color: var(--ly-muted); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.ly-rm-btn:hover { background: #FEF2F2; color: var(--ly-price); }
.ly-namebar { display: flex; align-items: center; gap: 8px; padding: 0 14px 10px 54px; }
.ly-namebar > svg { color: var(--ly-brand); flex-shrink: 0; }
.ly-namebar > span.nm { flex: 1; min-width: 0; font-size: 14px; font-weight: 700; color: var(--ly-brand-h); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ly-namebar .ly-rm-btn { width: 28px; height: 28px; }
.ly-specs { padding: 0 14px 10px 54px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ly-spec { font-size: 11px; font-weight: 500; padding: 2px 6px; border-radius: 6px; background: #F1F5F9; color: var(--ly-soft); white-space: nowrap; }
.ly-spec.src { background: var(--ly-stock-soft); color: var(--ly-stock-ink); font-weight: 700; }
.ly-addmore { display: flex; align-items: center; gap: 4px; padding: 6px 14px 10px 54px; font-size: 13px; font-weight: 700; color: var(--ly-brand); background: none; border: 0; cursor: pointer; width: 100%; text-align: left; }
.ly-addmore:hover { color: var(--ly-brand-h); }
.exp-panel { background: #FAFBFF; border-top: 1px dashed var(--ly-brand-line); padding: 6px 10px 10px; }
/* 10/19 老闆：下方快速選取「一行顯示一個、不要一行兩個，且字形放大」→ 單欄、字 13→16px */
.exp-group-label { font-size: 13px; font-weight: 700; color: var(--ly-brand); padding: 10px 6px 4px; letter-spacing: 0.02em; }
.exp-panel-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.exp-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-width: 0; text-align: left;
  padding: 10px 12px; border-radius: 10px; border: 1px solid transparent; background: none;
  font-size: 16px; line-height: 1.45; color: var(--ly-ink); cursor: pointer; font-family: inherit;
  transition: background-color .12s, border-color .12s;
}
.exp-item:hover { background: var(--ly-brand-soft); border-color: var(--ly-brand-line); }
.exp-item.sel { background: #E0E7FF; border-color: #A5B4FC; color: var(--ly-brand-h); font-weight: 700; }
.exp-item.dis { opacity: .4; pointer-events: none; }
.exp-item .exp-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.exp-item .exp-price { color: var(--ly-price); font-weight: 900; white-space: nowrap; font-size: 16px; }
.exp-item.sel .exp-price { color: var(--ly-brand-h); }
.exp-item .exp-stock { flex-shrink: 0; font-size: 12px; font-weight: 700; color: var(--ly-stock-ink); background: var(--ly-stock-soft); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.exp-item .exp-add { width: 30px; height: 30px; border-radius: 8px; background: var(--ly-brand-soft); color: var(--ly-brand); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.exp-item.sel .exp-add { background: var(--ly-brand); color: #fff; }
.exp-empty { padding: 12px 8px; font-size: 12px; color: var(--ly-muted); }

/* 右側「目前配置」 */
.ly-side { position: sticky; top: calc(var(--ly-topbar-h) + 20px); padding: 18px 20px 16px; display: flex; flex-direction: column; gap: 14px; }
.ly-side-head { display: flex; align-items: center; justify-content: space-between; }
.ly-side-head b { font-size: 15px; font-weight: 900; }
.ly-side-head span { font-size: 12px; font-weight: 600; color: var(--ly-muted); }
.ly-side-rows { display: flex; flex-direction: column; }
.ly-side-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--ly-line2); }
.ly-side-row:last-child { border-bottom: 0; }
.ly-side-row .nm { flex: 1; min-width: 0; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ly-side-row .nm.none { color: #CBD5E1; font-weight: 500; }
.ly-side-row .pr { font-size: 13px; font-weight: 900; white-space: nowrap; }
.ly-side-row .pick { font-size: 12px; font-weight: 700; color: var(--ly-brand); background: none; border: 0; cursor: pointer; padding: 0; }
.ly-side-totals { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; border-top: 1px solid var(--ly-line); }
.ly-side-total { display: flex; align-items: baseline; justify-content: space-between; padding-top: 8px; }
.ly-side-total span { font-size: 14px; font-weight: 700; color: var(--ly-soft); }
.ly-side-total b { font-size: 26px; font-weight: 900; letter-spacing: -0.01em; }
.ly-discount { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ly-discount > span { font-size: 14px; font-weight: 700; color: var(--ly-soft); }
.ly-discount-box { display: flex; align-items: center; gap: 10px; background: var(--ly-price-soft); border: 1px solid var(--ly-price-line); border-radius: 10px; padding: 6px 12px; }
.ly-discount-box .cur { font-size: 14px; font-weight: 700; color: var(--ly-price); }
.ly-discount-box input { width: 96px; background: transparent; border: 0; outline: none; font-size: 22px; font-weight: 900; color: var(--ly-price); font-family: inherit; line-height: 1; padding: 0; }
.ly-discount-box input::placeholder { color: #FCA5A5; font-size: 14px; font-weight: 700; }
.ly-discount-box .save { font-size: 12px; font-weight: 700; color: var(--ly-stock); white-space: nowrap; }
.ly-side-actions { display: flex; flex-direction: column; gap: 8px; }
.ly-side-actions .ly-btn { height: 44px; }

/* 手機合計列（只在手機顯示） */
#catalog-total-bar {
  display: none; position: fixed; left: 0; right: 0; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 40;
  background: var(--ly-card); border-top: 1px solid var(--ly-line); padding: 10px 16px; align-items: center; justify-content: space-between; gap: 12px;
}
#catalog-total-bar .tot { display: flex; flex-direction: column; gap: 2px; }
#catalog-total-bar .tot span { font-size: 11px; font-weight: 600; color: var(--ly-muted); }
#catalog-total-bar .tot b { font-size: 22px; font-weight: 900; line-height: 1; letter-spacing: -0.01em; }

/* ── 估價單（cart） ───────────────────────────────── */
.ly-cart-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#invoice-area { background: #fff; border: 1px solid var(--ly-line); border-radius: 16px; box-shadow: var(--ly-shadow); padding: 40px; margin-top: 20px; position: relative; }
.ly-invoice-head { text-align: center; margin-bottom: 28px; padding-bottom: 16px; border-bottom: 2px solid var(--ly-line); }
.ly-invoice-head h1 { margin: 0 0 6px; font-size: 28px; font-weight: 900; letter-spacing: 0.02em; }
.ly-invoice-head p { margin: 0; font-size: 13px; color: var(--ly-muted); }
.invoice-table th { background: #F8FAFC; color: var(--ly-soft); font-weight: 700; font-size: 12px; letter-spacing: .04em; padding: 10px 12px; }
.invoice-table td { border-bottom: 1px solid var(--ly-line2); padding: 10px 12px; font-size: 14px; }
.invoice-table tr:last-child td { border-bottom: none; }
.invoice-table .qty-btn button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--ly-line); background: #fff; font-weight: 700; cursor: pointer; }
.invoice-table .qty-btn button:hover { background: #F8FAFC; }
.invoice-table .remove-btn { color: var(--ly-muted); background: none; border: 0; cursor: pointer; }
.invoice-table .remove-btn:hover { color: var(--ly-price); }
.total-section { margin-top: 28px; padding-top: 20px; border-top: 2px solid var(--ly-ink); display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; }
.total-section .notes { font-size: 12px; color: var(--ly-muted); max-width: 380px; line-height: 1.6; }
.total-section .notes p { margin: 0; }
.total-section .text-right .lbl { font-size: 13px; color: var(--ly-soft); margin-bottom: 4px; }
#cart-total { font-size: 36px; font-weight: 900; color: var(--ly-price); letter-spacing: -0.01em; line-height: 1; }
.ly-check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ly-soft); cursor: pointer; user-select: none; background: #fff; border: 1px solid var(--ly-line); border-radius: 10px; padding: 8px 12px; }
.ly-check input { accent-color: var(--ly-brand); width: 16px; height: 16px; }

/* ── 歷史菜單庫 ───────────────────────────────────── */
.ly-hist-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.ly-hist { padding: 18px 20px 16px; display: flex; flex-direction: column; gap: 12px; }
.ly-hist.official { border-color: var(--ly-gold-line); }
.ly-hist-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ly-hist-title { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ly-hist-title .nm { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 18px; font-weight: 900; letter-spacing: -0.01em; line-height: 1.3; }
.ly-hist-title .owner { font-size: 12px; font-weight: 600; color: var(--ly-muted); }
.ly-hist-title .ts { font-size: 12px; font-weight: 500; color: var(--ly-muted); }
.ly-hist .ly-price { font-size: 22px; white-space: nowrap; }
.ly-hist-sum { background: #F9FAFB; border-radius: 10px; padding: 10px 12px; font-size: 12px; color: var(--ly-soft); line-height: 1.5; min-height: 56px; }
.ly-hist-sum .clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ly-hist-sum .dead { color: var(--ly-price); }
.ly-hist-actions { display: flex; align-items: center; gap: 8px; }
.ly-hist-actions .more { margin-left: auto; display: flex; align-items: center; gap: 6px; }

/* ── 報價單截圖卡（quote modal） ─────────────────── */
#quote-modal { background: rgba(15,23,42,.6); }
#quote-card { width: 100%; max-width: 440px; margin: 0 auto; background: #fff; border-radius: 20px; overflow: hidden; box-shadow: 0 30px 60px -22px rgba(15,23,42,.35); display: flex; flex-direction: column; }
.ly-quote-head { background: var(--ly-ink); color: #fff; padding: 22px 24px 18px; display: flex; flex-direction: column; gap: 16px; }
.ly-quote-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ly-quote-brand { display: flex; align-items: center; gap: 12px; }
.ly-quote-brand .mark { width: 40px; height: 40px; border-radius: 12px; background: var(--ly-brand); color: #fff; font-size: 20px; font-weight: 900; display: flex; align-items: center; justify-content: center; }
.ly-quote-brand .nm { font-size: 18px; font-weight: 900; letter-spacing: -0.01em; line-height: 1.2; }
.ly-quote-brand .sub { font-size: 11px; font-weight: 600; color: #A5B4FC; letter-spacing: 0.08em; line-height: 1.2; margin-top: 2px; }
.ly-quote-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; font-size: 11px; font-weight: 500; color: var(--ly-muted); padding-top: 3px; }
#quote-title { background: rgba(255,255,255,.08); border-radius: 10px; padding: 8px 12px; text-align: center; font-size: 14px; font-weight: 700; color: #fff; }
#quote-rows { padding: 0 24px; display: flex; flex-direction: column; }
.ly-quote-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid #EDF0F4; }
.ly-quote-row:last-child { border-bottom: 0; }
.ly-quote-row .main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ly-quote-row .cat { font-size: 11px; font-weight: 700; color: var(--ly-brand); }
/* 2026-10-01 老闆「報價單 純圖片 字會被截掉」：以前單行＋省略號，畫面看不到完整規格、存成圖片（html2canvas）右邊被切、字的下緣也被裁 → 改成自動換行 */
.ly-quote-row .nm { font-size: 14px; font-weight: 500; white-space: normal; overflow-wrap: anywhere; word-break: break-word; line-height: 1.5; }
.ly-quote-row .nm b { color: var(--ly-brand); }
.ly-quote-row .sub { font-size: 14px; font-weight: 900; color: #334155; white-space: nowrap; }
.ly-quote-totals { background: #F8FAFC; border-top: 1px solid #EDF0F4; padding: 16px 24px; display: flex; flex-direction: column; gap: 8px; }
.ly-quote-total { display: flex; align-items: baseline; justify-content: space-between; }
.ly-quote-total span { font-size: 13px; font-weight: 500; color: var(--ly-soft); }
.ly-quote-total b { font-size: 22px; font-weight: 900; color: var(--ly-ink); }
.ly-quote-totals:has(#quote-discount-row:not(.hidden)) .ly-quote-total b { font-size: 14px; font-weight: 700; color: var(--ly-muted); text-decoration: line-through; }
#quote-discount-row { align-items: center; justify-content: space-between; }
#quote-discount-row > span { font-size: 15px; font-weight: 900; }
#quote-discount-row .right { display: flex; align-items: center; gap: 10px; }
#quote-discount { font-size: 30px; font-weight: 900; color: var(--ly-price); line-height: 1; letter-spacing: -0.01em; }
#quote-save { padding: 2px 8px; border-radius: 999px; background: var(--ly-price-soft); color: var(--ly-price); font-size: 11px; font-weight: 700; }
.ly-quote-foot { padding: 14px 24px 18px; display: flex; flex-direction: column; gap: 12px; }
.ly-quote-foot .disc { font-size: 11px; font-weight: 500; color: var(--ly-muted); text-align: center; }
.ly-quote-foot .store { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 500; color: var(--ly-soft); }
.ly-modal-close { margin-top: 12px; width: 100%; height: 44px; border-radius: 12px; border: 0; background: rgba(255,255,255,.92); color: var(--ly-ink); font-size: 14px; font-weight: 700; cursor: pointer; }
.ly-modal-close:hover { background: #fff; }

/* ── 登入 Modal ───────────────────────────────────── */
.ly-login { width: 100%; max-width: 380px; padding: 32px; display: flex; flex-direction: column; gap: 18px; }
.ly-login-head { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.ly-login-head .mark { width: 48px; height: 48px; border-radius: 14px; background: var(--ly-brand); color: #fff; font-size: 22px; font-weight: 900; display: flex; align-items: center; justify-content: center; box-shadow: var(--ly-brand-shadow); }
.ly-login-head h3 { margin: 0; font-size: 22px; font-weight: 900; }
.ly-field { display: flex; flex-direction: column; gap: 6px; }
.ly-field label { font-size: 13px; font-weight: 700; color: var(--ly-soft); }
.ly-login-actions { display: flex; gap: 10px; padding-top: 4px; }
.ly-login-actions .ly-btn { flex: 1; height: 46px; }
.ly-login-note { margin: 0; font-size: 13px; line-height: 1.6; color: var(--ly-muted); text-align: center; }

/* ── Toast ───────────────────────────────────────── */
.ly-toast {
  display: flex; align-items: center; gap: 10px; min-width: 220px; max-width: 360px; padding: 12px 16px; border-radius: 12px;
  background: var(--ly-ink); color: #fff; font-size: 14px; font-weight: 600; box-shadow: 0 12px 28px -10px rgba(15,23,42,.45);
  transition: opacity .3s, transform .3s;
}
.ly-toast svg { flex-shrink: 0; }
.ly-toast.success { background: var(--ly-stock); }
.ly-toast.error { background: #DC2626; }
.ly-toast.warning { background: var(--ly-hot); }

/* ── 行動版底部分頁列 ──────────────────────────────── */
.ly-mnav {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 50; height: calc(64px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: var(--ly-card); border-top: 1px solid var(--ly-line);
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.ly-mnav .mtab { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 9px; gap: 4px; color: var(--ly-muted); background: none; border: 0; cursor: pointer; }
.ly-mnav .mtab svg { width: 22px; height: 22px; }
.ly-mnav .mtab-label { font-size: 11px; font-weight: 700; }
.ly-mnav .mtab.mtab-active { color: var(--ly-brand); }
.ly-mnav .mtab-ai { width: 52px; height: 52px; margin-top: -26px; border-radius: 999px; background: var(--ly-brand); border: 4px solid #fff; color: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 18px -8px rgba(79,70,229,.6); }
.ly-mnav .mtab-badge-wrap { position: relative; width: 22px; height: 22px; }
.ly-mnav .mtab-badge { position: absolute; top: -5px; right: -9px; min-width: 16px; height: 16px; padding: 0 5px; border-radius: 999px; background: var(--ly-brand); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* ── 後台（沿用 Tailwind，只調標題） ─────────────── */
#view-admin .ly-h1 { margin-bottom: 20px; }

/* ============================================================
   RWD
   ============================================================ */
@media (max-width: 1180px) {
  .ly-wrap, .ly-page { padding-left: 28px; padding-right: 28px; }
  .ly-hero { grid-template-columns: minmax(0, 1fr) 360px; gap: 36px; }
  .ly-hero h1 { font-size: 44px; }
  .ly-build-grid { grid-template-columns: minmax(0, 1fr) 480px; gap: 20px; }
  .ly-parts-grid { grid-template-columns: minmax(0, 1fr) 300px; }
  .ly-cat-rail { grid-column: 1 / -1; position: static; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding: 8px; scrollbar-width: none; max-width: 100%; }
  .ly-cat-rail::-webkit-scrollbar { display: none; }
  .ly-cat { width: auto; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--ly-line); font-size: 13px; }
  .ly-cat .cnt { display: none; }
  .ly-cat .ico { display: none; }
  .ly-grid-3, .ly-hist-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .ly-hero { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 32px 0 28px; }
  .ly-hero h1 { font-size: 34px; }
  .ly-hero p.lead { font-size: 15px; }
  .ly-build-grid { grid-template-columns: minmax(0, 1fr); }
  .ly-result-col { position: static; }
  .ly-parts-grid { grid-template-columns: minmax(0, 1fr); }
  .ly-side { position: static; }
  /* 表單控制項字級一律 ≥16px：防 iOS 點輸入框時整頁自動放大 */
  input.ly-input, select.ly-select, textarea.ly-textarea, #wiz-budget-custom, #home-budget-custom { font-size: 16px !important; }
}
@media (max-width: 768px) {
  :root { --ly-topbar-h: 56px; }
  .ly-wrap { padding-left: 16px; padding-right: 16px; }
  .ly-page { padding: 16px 16px 120px; }
  .ly-topbar .ly-wrap { gap: 12px; }
  .ly-logo-mark { width: 32px; height: 32px; border-radius: 9px; font-size: 16px; }
  .ly-logo-sub { display: none; }
  .ly-nav, #topbar-cart-btn, #auth-panel { display: none !important; }
  .ly-icon-btn { display: flex; }
  .ly-icon-btn.hidden { display: none; }
  .ly-mnav { display: grid; }
  .ly-footer { display: none; }
  .ly-h1, .ly-h2 { font-size: 22px; }
  .ly-grid-3, .ly-hist-grid { grid-template-columns: minmax(0, 1fr); }
  body { overflow-x: hidden; }
  .ly-sec { padding-bottom: 8px; }
  .ly-sec-head-right { width: 100%; justify-content: space-between; }
  .ly-hero-custom { width: 100%; }
  .ly-hero-actions .ly-btn-lg { width: 100%; }
  .ly-trust { gap: 12px; }
  .ly-step { padding: 18px 16px; }
  .ly-submit { padding: 16px; }
  .ly-adv summary, .ly-adv-body { padding-left: 16px; padding-right: 16px; }
  .ly-chip { padding: 10px 14px; font-size: 14px; }
  .ly-res { padding: 18px 16px 16px; }
  .ly-res-row .nm { white-space: normal; }
  .ly-res-actions .ly-btn { flex: 1 1 auto; }
  .ly-tools { width: 100%; }
  .ly-tools .ly-btn { flex: 1 1 auto; }
  .ly-parts-search { position: static; padding: 12px; }
  .ly-unit-row { flex-wrap: wrap; row-gap: 8px; padding: 10px 12px 8px; }
  .ly-unit-row .ly-select { flex: 1 1 100%; order: 3; height: 42px; }
  .ly-unit-row .ly-unit-price { order: 4; margin-right: auto; text-align: left; width: auto; }
  .ly-unit-row .ly-qty { order: 5; }
  .ly-unit-row .ly-rm-btn { order: 6; }
  .ly-qty-btn { width: 40px; height: 40px; border-radius: 10px; }
  .ly-namebar, .ly-specs, .ly-addmore { padding-left: 12px; }
  .ly-namebar > span.nm { white-space: normal; }
  .exp-panel-grid { grid-template-columns: 1fr; }
  .exp-item { padding: 10px; font-size: 15px; }
  .exp-item .exp-price { font-size: 15px; }
  .exp-item .exp-name { white-space: normal; }
  #catalog-total-bar { display: flex; }
  #catalog-total-bar.hidden { display: none; }
  .ly-cart-tools { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .ly-cart-tools .ly-btn { height: 42px; }
  #invoice-area { padding: 16px; }
  .ly-invoice-head h1 { font-size: 22px; }
  .total-section { flex-direction: column; align-items: stretch; }
  .total-section .text-right { order: 1; margin-bottom: 12px; }
  .total-section .notes { order: 2; max-width: none; }
  .ly-hist-actions { flex-wrap: wrap; }
  .ly-login { padding: 24px; }
  #toast-container { left: 12px; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); align-items: center; }
}
@media (max-width: 640px) {
  /* 估價單表格 → 卡片堆疊（截圖時 downloadImage() 加 .hide-on-capture 會還原桌面表格版） */
  #invoice-area:not(.hide-on-capture) .invoice-table { display: block; width: 100%; }
  #invoice-area:not(.hide-on-capture) .invoice-table thead { display: none; }
  #invoice-area:not(.hide-on-capture) .invoice-table tbody { display: block; width: 100%; }
  #invoice-area:not(.hide-on-capture) .invoice-table tr {
    display: grid; grid-template-columns: auto 1fr auto;
    grid-template-areas: "cat cat del" "name name name" "qty price sub";
    align-items: center; row-gap: 6px; padding: 10px 12px; border: 1px solid var(--ly-line); border-radius: 14px; margin-bottom: 10px; background: #fff;
  }
  #invoice-area:not(.hide-on-capture) .invoice-table td { display: block; padding: 0; border: none; }
  #invoice-area:not(.hide-on-capture) .invoice-table td:nth-child(1) { grid-area: cat; justify-self: start; font-size: 11px; background: var(--ly-brand-soft); color: var(--ly-brand-h); padding: 3px 10px; border-radius: 9999px; }
  #invoice-area:not(.hide-on-capture) .invoice-table td:nth-child(2) { grid-area: name; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
  #invoice-area:not(.hide-on-capture) .invoice-table td:nth-child(3) { grid-area: price; text-align: center; font-size: 12px; color: var(--ly-muted); }
  #invoice-area:not(.hide-on-capture) .invoice-table td:nth-child(3)::before { content: "單價 "; font-size: 11px; color: #C7CBD1; }
  #invoice-area:not(.hide-on-capture) .invoice-table td:nth-child(4) { grid-area: qty; }
  #invoice-area:not(.hide-on-capture) .invoice-table td:nth-child(5) { grid-area: sub; text-align: right; font-size: 17px; color: var(--ly-price); }
  #invoice-area:not(.hide-on-capture) .invoice-table td:nth-child(6) { grid-area: del; justify-self: end; }
  #invoice-area:not(.hide-on-capture) .invoice-table td[colspan] { grid-area: auto; grid-column: 1 / -1; }
  #invoice-area:not(.hide-on-capture) .invoice-table .qty-btn { justify-content: flex-start; gap: 6px; }
  #invoice-area:not(.hide-on-capture) .invoice-table .qty-btn button { width: 38px; height: 38px; border-radius: 10px; font-size: 16px; }
  #invoice-area:not(.hide-on-capture) .invoice-table .qty-btn span { width: 26px; font-size: 15px; }
  #invoice-area:not(.hide-on-capture) .invoice-table td:nth-child(6) .remove-btn { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; }
  /* 截圖模式：還原桌面表格版並放寬畫布（只在截圖那一瞬間生效） */
  #invoice-area.hide-on-capture { width: 860px !important; max-width: none !important; padding: 40px !important; }
}

/* ── 工具類補強（showroom.css 在 tailwind.css 之後載入，.hidden 必須贏過 ly-* 的 display） ── */
.hidden { display: none !important; }
.ly-cat .ico { display: flex; align-items: center; }
.ly-icon-btn.on { color: var(--ly-brand); }
.ly-btn svg, .ly-link svg { flex-shrink: 0; }
.ly-prod-row .dead { color: var(--ly-muted); text-decoration: line-through; }
/* Modal 要壓過 sticky 頂欄（頂欄 z-index 60） */
#quote-modal, #login-modal, #report-modal, #training-edit-modal { z-index: 80; }
#toast-container { z-index: 90; }
