/* 予安所託 — 共用品牌樣式
   色票與字體取自 ttest.html，此處直接寫成套用後的淺色版本 */

:root {
  --ink: #2c1a20;
  --cream: #fdf8f5;
  --sand: #f8edf1;
  --pink: #e8637a;
  --pink-light: #f4a7b5;
  --pink-dark: #c04060;
  --pink-pale: #fdf0f2;
  --pink-deep: #8b2846;
  --rose: #f0c8d2;
  --muted: #7a5560;
  --border: #e5c2ce;
  --border-soft: #f0d8de;
  --white: #ffffff;
  --shadow: rgba(232,99,122,0.10);
  --topbar-h: 52px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans TC', sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-text-size-adjust: 100%;
}

/* ── TOPBAR ── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--cream);
  border-bottom: 1.5px solid var(--border);
  box-shadow: 0 2px 8px rgba(192,64,96,0.1);
  display: flex; align-items: center; gap: 12px;
  padding: 0 14px;
  z-index: 100;
}
.topbar-back {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.82rem; font-weight: 700; color: var(--pink-dark);
  text-decoration: none; letter-spacing: 0.03em;
  padding: 6px 12px; border-radius: 30px;
  border: 1px solid var(--border); background: var(--white);
  transition: background 0.2s, border-color 0.2s;
}
.topbar-back:hover { background: var(--pink-pale); border-color: var(--pink-light); }
.topbar-logo { height: 30px; object-fit: contain; margin-left: auto; }

/* ── PAGE HEADER ── */
.page-head {
  background: linear-gradient(160deg, #fdf0f2 0%, #fce4ea 60%, #f5c8d2 100%);
  padding: 30px 22px 26px;
  text-align: center;
  position: relative;
  overflow: hidden;
  margin-top: var(--topbar-h);
}
.page-head .deco {
  position: absolute; pointer-events: none; opacity: 0.18;
}
.page-head .deco.left  { width: 76px; left: 6px;  bottom: 8px;  transform: rotate(15deg); }
.page-head .deco.right { width: 66px; right: 6px; top: 14px;   transform: rotate(-20deg); opacity: 0.14; }
.page-eyebrow {
  display: inline-block; font-size: 0.66rem; letter-spacing: 0.2em;
  color: var(--pink-dark); border: 1px solid var(--pink);
  padding: 3px 13px; border-radius: 30px; margin-bottom: 12px;
  position: relative; z-index: 1;
}
.page-title {
  font-family: 'Noto Serif TC', serif;
  font-size: clamp(1.4rem, 5.5vw, 1.9rem);
  font-weight: 700; letter-spacing: 0.06em; line-height: 1.3;
  color: var(--ink); position: relative; z-index: 1;
}
.page-desc {
  font-size: 0.8rem; color: var(--muted); margin-top: 7px;
  letter-spacing: 0.03em; position: relative; z-index: 1;
}

/* ── CONTENT ── */
.wrap { flex: 1; max-width: 680px; width: 100%; margin: 0 auto; padding: 22px 16px 60px; }

.card {
  background: var(--white); border-radius: 16px; border: 1px solid var(--border);
  padding: 20px; margin-bottom: 14px; box-shadow: 0 2px 14px var(--shadow);
  transition: box-shadow 0.25s ease;
}
.card:hover { box-shadow: 0 6px 22px rgba(232,99,122,0.14); }
.card-title {
  font-family: 'Noto Serif TC', serif; font-size: 0.98rem; font-weight: 700;
  color: var(--ink); margin-bottom: 13px;
  display: flex; align-items: center; gap: 8px;
}
.card-body { font-size: 0.83rem; color: var(--muted); line-height: 1.8; }
.card-body strong { color: var(--ink); }
.card-body p + p { margin-top: 10px; }

.sub-block { background: #fdf4f6; border-radius: 10px; padding: 13px; margin-bottom: 10px; }
.sub-title { font-weight: 700; color: var(--pink-dark); font-size: 0.87rem; margin-bottom: 6px; }
.sub-text { font-size: 0.8rem; color: var(--ink); line-height: 1.75; }

.rule-head {
  font-weight: 700; font-size: 0.84rem; color: var(--ink);
  margin-bottom: 7px; padding-bottom: 5px; border-bottom: 1px dashed var(--border-soft);
}
.rule-list { font-size: 0.8rem; color: var(--ink); line-height: 1.9; }
.rule-list div { padding: 3px 0; }

.plain-list { list-style: none; padding: 0; margin: 0; font-size: 0.83rem; color: var(--muted); line-height: 1.8; }
.plain-list li { padding: 5px 0; border-bottom: 1px solid var(--sand); }
.plain-list li:last-child { border: none; }
.plain-list li::before { content: '·'; color: var(--pink); margin-right: 8px; font-weight: bold; }

.alert-box {
  background: #fce0e8; border: 1px solid var(--pink-light);
  border-left: 4px solid var(--pink-dark); border-radius: 8px;
  padding: 10px 12px; font-size: 0.79rem; color: var(--pink-deep); line-height: 1.65;
  margin-top: 8px;
}
.notice-box {
  background: var(--pink-pale); border: 1.5px solid #f0c4ce; border-radius: 12px;
  padding: 14px 16px; margin-bottom: 14px;
}
.notice-title {
  font-weight: 700; font-size: 0.86rem; margin-bottom: 6px;
  color: var(--pink-dark); letter-spacing: 0.04em;
}
.notice-text { font-size: 0.8rem; line-height: 1.8; color: var(--muted); }
.notice-text div + div { margin-top: 6px; }

.chip {
  display: inline-block; background: var(--pink-pale); color: var(--pink-dark);
  border: 1px solid var(--border-soft); border-radius: 20px;
  padding: 3px 12px; font-size: 0.76rem; font-weight: 500; margin: 0 5px 6px 0;
}
.code-chip {
  display: inline-block; margin: 5px 0; background: var(--white);
  border: 1px solid var(--border-soft); border-radius: 6px; padding: 2px 10px;
  font-family: monospace; font-size: 0.8rem; color: var(--pink-dark);
}

/* ── TABLE ── */
.fee-table { width: 100%; border-collapse: collapse; font-size: 0.81rem; margin-top: 4px; }
.fee-table th {
  background: var(--sand); padding: 8px 11px; text-align: left;
  font-weight: 700; color: var(--ink); border-bottom: 2px solid var(--border-soft);
}
.fee-table td { padding: 8px 11px; border-bottom: 1px solid var(--sand); color: var(--muted); vertical-align: top; }
.fee-table td strong { color: var(--ink); }
.fee-table tr:last-child td { border: none; }
.table-scroll { overflow-x: auto; }

/* ── FLOW STEPS ── */
.flow-step { display: flex; align-items: flex-start; padding: 13px 0 0; }
.flow-left { display: flex; flex-direction: column; align-items: center; width: 40px; flex-shrink: 0; }
.flow-num {
  width: 30px; height: 30px; border-radius: 50%; background: var(--pink); color: var(--white);
  font-size: 0.88rem; font-weight: 700; font-family: 'Noto Serif TC', serif;
  display: flex; align-items: center; justify-content: center;
}
.flow-vline { width: 2px; height: 22px; background: linear-gradient(to bottom, var(--pink-light), rgba(244,167,181,0.15)); margin-top: 4px; }
.flow-arrow-row { display: flex; justify-content: center; width: 40px; padding: 2px 0; color: var(--pink); font-size: 1rem; line-height: 1; }
.flow-content { flex: 1; padding: 2px 0 12px 12px; }
.flow-title { font-weight: 700; font-size: 0.92rem; color: var(--ink); margin-bottom: 3px; }
.flow-title a { color: var(--pink-dark); text-decoration: underline; }
.flow-desc { font-size: 0.79rem; color: var(--muted); line-height: 1.65; }
.flow-highlight {
  display: inline-block; background: #ffe8f2; color: var(--pink-dark);
  font-size: 0.75rem; font-weight: 700; padding: 2px 9px; border-radius: 4px; margin-bottom: 3px;
}
.flow-note { display: block; margin-top: 4px; font-size: 0.77rem; color: var(--pink-dark); font-style: italic; }

/* ── BUTTONS ── */
.btn {
  display: block; width: 100%; padding: 14px; text-align: center;
  border: none; border-radius: 50px; cursor: pointer; text-decoration: none;
  font-family: 'Noto Sans TC', sans-serif; font-size: 0.92rem; font-weight: 700;
  letter-spacing: 0.04em; transition: all 0.25s;
}
.btn-primary { background: linear-gradient(135deg, var(--pink) 0%, var(--pink-dark) 100%); color: var(--white); box-shadow: 0 4px 18px rgba(232,99,122,0.40); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 22px rgba(232,99,122,0.55); }
.btn-secondary { background: var(--white); color: var(--ink); border: 1.5px solid var(--border); }
.btn-secondary:hover { border-color: var(--pink); color: var(--pink-dark); background: var(--pink-pale); }
.btn:active { transform: scale(0.99); }

/* ── 準備中佔位 ── */
.pending {
  text-align: center; padding: 40px 20px;
  background: var(--white); border: 1px dashed var(--border);
  border-radius: 16px; margin-bottom: 16px;
}
.pending-icon { font-size: 2.4rem; display: block; margin-bottom: 10px; }
.pending-title { font-family: 'Noto Serif TC', serif; font-size: 1.05rem; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.pending-text { font-size: 0.82rem; color: var(--muted); line-height: 1.8; }

/* ── FOOTER ── */
footer {
  background: transparent; border-top: 1px solid var(--border-soft);
  color: var(--muted); text-align: center;
  padding: 20px; font-size: 0.73rem; letter-spacing: 0.05em;
}
footer a { color: var(--pink-dark); text-decoration: none; }
footer a:hover { color: var(--pink); }
footer p { margin-top: 5px; }
footer .copyright { margin-top: 8px; font-size: 0.68rem; opacity: 0.75; }

@media (max-width: 768px) {
  .page-head { padding: 24px 16px 22px; }
  .wrap { padding: 18px 14px 50px; }
}

/* ═══════════════════════════════════════════════════════════
   以下為委託單（order.html）與試算（quote.html）使用的元件
   外觀取自 ttest.html，維持與現行系統一致
   ═══════════════════════════════════════════════════════════ */

/* ── 匯率卡 ── */
.rate-card {
  background: linear-gradient(135deg, var(--pink-pale) 0%, var(--sand) 100%);
  border: 1.5px solid var(--border);
  border-radius: 16px; padding: 20px; text-align: center;
  margin-bottom: 14px; position: relative; overflow: hidden;
}
.rate-card::before {
  content: '¥'; position: absolute; right: -10px; top: -20px;
  font-size: 110px; font-family: 'Noto Serif TC', serif;
  color: rgba(232,99,122,0.07); pointer-events: none; line-height: 1;
}
.rate-label { font-size: 0.73rem; color: var(--muted); letter-spacing: 0.12em; margin-bottom: 5px; }
.rate-value { font-family: 'Noto Serif TC', serif; font-size: 2.7rem; font-weight: 700; color: var(--ink); line-height: 1; margin-bottom: 5px; }
.rate-unit { font-size: 0.8rem; color: var(--pink-dark); }
.rate-badge {
  display: inline-block; margin-top: 8px; padding: 3px 12px; border-radius: 20px;
  font-size: 0.7rem; background: rgba(232,99,122,0.15); color: var(--ink); border: 1px solid var(--border);
}
.rate-updated { font-size: 0.68rem; color: var(--muted); margin-top: 7px; letter-spacing: 0.05em; }
.spinner {
  display: inline-block; width: 13px; height: 13px; margin-right: 5px; vertical-align: middle;
  border: 2px solid rgba(192,64,96,0.25); border-top-color: var(--pink);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 表單 ── */
.form-group { margin-bottom: 15px; }
label { display: block; font-size: 0.78rem; font-weight: 700; color: var(--muted); letter-spacing: 0.05em; margin-bottom: 7px; }
label.req::after { content: ' *'; color: var(--pink-dark); }
input, select {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--border-soft); border-radius: 10px;
  font-family: 'Noto Sans TC', sans-serif; font-size: 16px; color: var(--ink);
  background: var(--cream); transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none; -webkit-text-size-adjust: 100%;
}
input:focus, select:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px rgba(232,99,122,0.15); background: var(--white); }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238a6070' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; padding-right: 34px;
}
.input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }

.wechat-check {
  display: flex; align-items: center; gap: 9px; margin-top: 12px; padding: 11px 13px;
  background: var(--pink-pale); border: 1.5px solid var(--border-soft); border-radius: 10px;
  cursor: pointer; font-size: 0.84rem; color: var(--ink); font-weight: 500;
  transition: border-color 0.2s; -webkit-user-select: none; user-select: none;
}
.wechat-check:hover { border-color: var(--pink-light); }
.wechat-check input[type="checkbox"] {
  -webkit-appearance: checkbox; appearance: auto;
  width: 18px; height: 18px; padding: 0; margin: 0; flex-shrink: 0;
  cursor: pointer; accent-color: var(--pink);
}
.wechat-check strong { color: var(--pink-dark); }

/* ── 店舖 / 商品 ── */
.shop-block { border: 1.5px solid var(--border); border-radius: 14px; margin-bottom: 16px; overflow: hidden; background: var(--white); }
.shop-header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: var(--pink-pale); border-bottom: 1px solid var(--border); }
.shop-num { font-size: 0.7rem; font-weight: 700; color: var(--pink-dark); background: var(--white); border: 1px solid var(--border); padding: 2px 9px; border-radius: 20px; white-space: nowrap; }
.shop-name-input {
  flex: 1; border: none; background: transparent; padding: 0; min-width: 0;
  font-family: 'Noto Sans TC', sans-serif; font-size: 0.88rem; font-weight: 700; color: var(--ink); outline: none;
}
.shop-name-input::placeholder { color: var(--muted); font-weight: 400; }
.shop-body { padding: 14px; }
.shop-items { margin-bottom: 10px; }
.shop-item { border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 8px; background: var(--cream); position: relative; }
.shop-item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.item-num { font-size: 0.68rem; color: var(--muted); font-weight: 500; }
.shop-subtotal { font-size: 0.75rem; color: var(--pink-dark); text-align: right; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); font-weight: 700; }
.delete-btn { background: none; border: none; color: #ccc; cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 4px; border-radius: 6px; transition: color 0.2s, background 0.2s; }
.delete-btn:hover { color: var(--pink-dark); background: var(--pink-pale); }
.btn-add-item {
  width: 100%; padding: 11px; margin-bottom: 16px; cursor: pointer;
  background: var(--cream); border: 1.5px dashed var(--border-soft); border-radius: 10px;
  font-family: 'Noto Sans TC', sans-serif; font-size: 0.88rem; font-weight: 700; color: var(--muted);
  transition: all 0.2s;
}
.btn-add-item:hover { border-color: var(--pink); color: var(--pink-dark); background: var(--pink-pale); }

/* ── 計算明細 ── */
.detail-box { display: none; margin-top: 13px; background: #fdf4f6; border: 1px solid var(--border-soft); border-radius: 8px; padding: 14px; font-size: 0.84rem; color: var(--muted); text-align: left; }
.detail-header { font-weight: 700; margin-bottom: 8px; color: var(--pink-dark); border-bottom: 1px dashed #e8bcc8; padding-bottom: 5px; }
.detail-row { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.detail-shop { margin-bottom: 10px; padding: 8px 10px; background: var(--pink-pale); border-radius: 7px; border-left: 3px solid var(--pink); }
.detail-shop-name { font-weight: 700; color: var(--ink); margin-bottom: 5px; font-size: 0.83rem; }
.detail-shop-item { font-size: 0.78rem; color: var(--muted); margin-bottom: 2px; }
.math-text { font-family: monospace; color: var(--muted); }
.detail-subtotal { color: #888; font-size: 0.79rem; justify-content: flex-end; margin-top: 6px; }
.detail-total-line { border-top: 1px dashed #e8bcc8; margin-top: 8px; padding-top: 8px; font-weight: 700; color: var(--ink); }

/* ── 總金額 ── */
.result-box { background: linear-gradient(135deg, var(--ink) 0%, #4a2c36 100%); border-radius: 14px; padding: 20px; text-align: center; margin: 12px 0; }
.result-label { font-size: 0.73rem; color: rgba(255,240,245,0.45); letter-spacing: 0.12em; margin-bottom: 5px; }
.result-value { font-family: 'Noto Serif TC', serif; font-size: 2.6rem; font-weight: 700; line-height: 1; background: linear-gradient(135deg, #fdf0f2, var(--pink-light)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.result-currency { font-size: 0.92rem; color: var(--pink); margin-top: 4px; }
.result-note { font-size: 0.7rem; color: rgba(255,240,245,0.4); margin-top: 8px; letter-spacing: 0.03em; }

/* ── 彈窗 ── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(44,26,32,0.65); z-index: 500; align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.open { display: flex; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal { background: var(--white); border-radius: 20px; padding: 26px 20px 20px; max-width: 340px; width: 100%; box-shadow: 0 20px 60px rgba(192,64,96,0.25); animation: slideUp 0.25s ease; }
@keyframes slideUp { from { transform: translateY(18px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-icon { font-size: 2.3rem; text-align: center; margin-bottom: 9px; }
.modal-title { font-family: 'Noto Serif TC', serif; font-size: 1.02rem; font-weight: 700; text-align: center; margin-bottom: 5px; color: var(--ink); }
.modal-sub { font-size: 0.79rem; color: var(--muted); text-align: center; margin-bottom: 15px; line-height: 1.7; }
.modal-amount { background: var(--sand); border-radius: 11px; padding: 12px; text-align: center; margin-bottom: 16px; }
.modal-amount-label { font-size: 0.7rem; color: var(--muted); letter-spacing: 0.08em; margin-bottom: 3px; }
.modal-amount-value { font-family: 'Noto Serif TC', serif; font-size: 1.85rem; font-weight: 700; color: var(--pink-dark); }
.modal-amount-unit { font-size: 0.8rem; color: var(--muted); }
.modal-close-btn {
  display: block; width: 100%; padding: 11px; margin-top: 9px; cursor: pointer;
  background: none; border: 1.5px solid var(--border); border-radius: 50px;
  font-family: 'Noto Sans TC', sans-serif; font-size: 0.85rem; color: var(--muted); transition: all 0.2s;
}
.modal-close-btn:hover { border-color: var(--pink); color: var(--pink-dark); }

/* ── Toast ── */
#toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(100px);
  background: var(--ink); color: #fdf0f2; padding: 11px 22px; border-radius: 50px;
  font-size: 0.82rem; z-index: 9999; transition: transform 0.3s ease;
  max-width: 300px; text-align: center; box-shadow: 0 8px 30px rgba(192,64,96,0.3);
}
#toast.show { transform: translateX(-50%) translateY(0); }

/* ── 底部說明框 ── */
.info-note { background: var(--white); border: 1.5px solid var(--border); border-radius: 12px; padding: 16px 18px; margin-top: 14px; font-size: 0.82rem; color: var(--muted); line-height: 1.7; box-shadow: 0 2px 10px var(--shadow); }
.info-note p { margin-bottom: 5px; }
.info-note p:last-child { margin-bottom: 0; }
.info-note a { color: var(--pink-dark); text-decoration: none; word-break: break-all; }
.info-note a:hover { text-decoration: underline; }
.info-note hr { border: none; border-top: 1px dashed var(--border); margin: 10px 0; }
