/* ===== 作伙點・團購點單 設計系統（森林米色風，合併自 code_artifact.html） ===== */
:root {
  --bg-outer: #E8DAC6;     /* 桌面版外圍 */
  --bg: #F4E9D8;           /* 手機殼內底色 */
  --card: #FBF6EE;
  --card-soft: #F7EFE2;
  --pill-bg: #EDE4D4;
  --nav-bg: #FBF7F0;
  --border: #E5D6C3;
  --border-strong: #D4C0A8;
  --caramel: #A6754B;
  --caramel-hover: #8E613B;
  --sage: #8B947E;
  --sage-dark: #556149;
  --sage-soft: #E6ECE0;
  --text-title: #3B2818;
  --text-dark: #2B1C10;
  --text-muted: #7C6A58;
  --danger: #B85B4E;
  --danger-ink: #A0443A;
  --danger-soft: #F7E5E2;
  --warn-bg: #F8EBD3;
  --warn-line: #D9A35A;
  --warn-ink: #7A4A16;
  --shadow-card: 0 8px 20px rgba(120, 90, 60, .12);
  --shadow-btn: 0 4px 12px rgba(166, 117, 75, .28);
  --shadow-nav: 0 10px 28px rgba(74, 54, 36, .16);
  --radius-card: 20px;
  --radius-input: 14px;
  --serif: 'Noto Serif TC', Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; min-height: 100vh;
  background: var(--bg-outer);
  color: var(--text-dark);
  font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft JhengHei', sans-serif;
  font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
h1 { font-family: var(--serif); font-size: 1.3rem; font-weight: 700; color: var(--text-title); line-height: 1.3; }
h2 { font-size: 1.02rem; font-weight: 700; color: var(--text-title); }
button { font-family: inherit; cursor: pointer; color: inherit; }
button:disabled { opacity: .45; cursor: not-allowed; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--sage); outline-offset: 2px; }
[v-cloak] { display: none !important; }

/* ----- 手機殼（桌面版置中，外圍深一階米色） ----- */
.shell {
  max-width: 480px; min-height: 100vh; margin: 0 auto;
  background: var(--bg);
  position: relative; overflow-x: hidden;
  box-shadow: 0 0 40px rgba(59, 40, 24, .12);
}
/* 不設 z-index：避免形成堆疊層，讓內部的彈出視窗（z-index 120）能蓋過底部導覽列 */
.content-layer { position: relative; }

/* 四邊手繪植物（不影響點擊） */
.bg-botanical { position: absolute; pointer-events: none; z-index: 0; user-select: none; }
.bg-mid-right { top: 235px; right: -12px; width: 82px; opacity: .92; }
.bg-mid-left { top: 470px; left: -14px; width: 72px; opacity: .95; }
.bg-bottom-left { bottom: 84px; left: -8px; width: 86px; opacity: .9; }
.bg-bottom-right { bottom: 80px; right: -10px; width: 96px; opacity: .92; }

/* ----- 頁面 ----- */
.page {
  padding: 18px 18px 120px;
  display: flex; flex-direction: column; gap: 14px;
  min-height: 100vh;
}
.page.has-cart { padding-bottom: 200px; }
.cols, .col { display: flex; flex-direction: column; gap: 14px; }

/* 首頁標題（兩側葉枝與小松樹） */
.hero-header { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 0 4px; }
.hero-title {
  margin: 0; font-family: var(--serif); font-size: 1.55rem; font-weight: 700;
  color: var(--text-title); letter-spacing: .04em; white-space: nowrap;
}
.hero-svg-left { width: 34px; height: 40px; flex-shrink: 0; }
.hero-svg-right { width: 52px; height: 46px; flex-shrink: 0; margin-left: -4px; }
.page-title { display: flex; align-items: center; gap: 10px; }
.page-title h1 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ----- 卡片 ----- */
.card {
  background: var(--card);
  border-radius: var(--radius-card);
  padding: 18px;
  box-shadow: var(--shadow-card);
  border: 1px solid rgba(255, 255, 255, .65);
  display: flex; flex-direction: column; gap: 12px;
}
.card.row { flex-direction: row; align-items: center; gap: 12px; }
/* 管理頁收合區塊 */
.fold-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 36px;
  background: none; border: 0; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.fold-head h2 { margin: 0; }
.fold-meta { display: flex; align-items: center; gap: 6px; font-size: .84rem; color: var(--text-muted); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 50%; }
.fold-chev { display: inline-block; font-size: 1.3rem; line-height: 1; transition: transform .2s; }
.fold-head[aria-expanded="true"] .fold-chev { transform: rotate(90deg); }
.admin-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.admin-actions .btn, .admin-actions .btn2 { width: 100%; min-height: 50px; }
.group-actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.group-actions .btn, .group-actions .btn2 { width: 100%; padding: 0 6px; white-space: nowrap; }
.card.link { text-decoration: none; transition: transform .15s; }
.card.link:active { transform: translateY(1px); }
.card.soft { background: var(--card-soft); border-color: var(--border); box-shadow: none; }
.card.accent { background: var(--sage); color: #FFFDF9; }
.card.accent h2, .card.accent p, .card.accent .muted { color: #FFFDF9; }
.card.success { box-shadow: 0 0 0 2px var(--caramel), var(--shadow-card); }

/* ----- 按鈕（皆 >= 44px） ----- */
.btn, .btn2 {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; min-width: 44px; padding: 0 18px;
  border: 1px solid transparent; border-radius: 999px;
  font-size: .95rem; font-weight: 600; font-family: inherit;
  white-space: nowrap; flex-shrink: 0; text-decoration: none;
  transition: transform .12s ease, background-color .15s ease, opacity .15s ease;
}
.btn:active:not(:disabled), .btn2:active:not(:disabled) { transform: scale(.97); }
.btn { background: var(--caramel); color: #FFFDF9; box-shadow: var(--shadow-btn); }
.btn:hover:not(:disabled) { background: var(--caramel-hover); }
.btn.big { width: 100%; min-height: 50px; font-size: 1.05rem; font-weight: 700; letter-spacing: .04em; }
.btn.yellow { background: var(--caramel); }
.btn.sage { background: var(--sage); box-shadow: 0 4px 10px rgba(139, 148, 126, .28); }
.btn2 { background: var(--card); border-color: var(--border-strong); color: var(--text-title); }
.btn2:hover:not(:disabled) { background: #FFFDF9; }
.btn2.danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.btn.block, .btn2.block { width: 100%; }
.gsi-box { width: 100%; max-width: 320px; min-height: 44px; display: flex; justify-content: center; color-scheme: light; }
.google-btn { background: #fff; border-color: var(--border-strong); color: #3c4043; gap: 10px; min-height: 48px; }
.card.account { flex-direction: row; align-items: center; gap: 12px; }
.account img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; }
.icon-btn { width: 44px; padding: 0; flex: none; }
.plus-btn { width: 44px; padding: 0; font-size: 1.5rem; font-weight: 400; flex: none; }

/* ----- 表單 ----- */
.input {
  width: 100%; min-width: 0; min-height: 44px; padding: 10px 14px;
  font-size: 16px; /* 16px 避免 iOS 自動放大 */
  border: 1.5px solid var(--border-strong); border-radius: var(--radius-input);
  background: #FFFDF9; color: var(--text-dark); font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--caramel); box-shadow: 0 0 0 3px rgba(166, 117, 75, .16); }
.input::placeholder { color: #B5A291; }
.input[readonly] { background: var(--card-soft); }
.input.code { text-transform: uppercase; letter-spacing: 2px; font-weight: 700; }
textarea.input { min-height: 78px; resize: vertical; }
.label { font-size: .88rem; font-weight: 600; color: var(--text-title); display: flex; flex-direction: column; gap: 6px; }
.field-row { display: flex; gap: 8px; align-items: flex-end; }
.field-row > .grow { flex: 1; min-width: 0; }

/* ----- 標籤 ----- */
.pill {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 4px 10px; border-radius: 999px;
  font-size: .76rem; font-weight: 700; white-space: nowrap; flex-shrink: 0;
  background: var(--pill-bg); color: var(--text-title);
}
.pill.open { background: var(--sage-soft); color: var(--sage-dark); }
.pill.closed { background: var(--danger-soft); color: var(--danger); }
.pill.tilt { align-self: flex-start; }
.muted { font-size: .84rem; color: var(--text-muted); }
.price { color: var(--caramel); font-weight: 700; }

/* ----- 插畫 ----- */
.illus { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.illus svg { width: 100%; height: 100%; overflow: visible; }
.illus .svg-ico { display: contents; }
.illus .emoji-ico { line-height: 1; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.illus .char-ico { width: 84%; height: 84%; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: #E6C39C; border: 2.4px solid #3B2818; color: #3B2818; font-weight: 800; line-height: 1; }
.custom-cat { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.custom-cat .input { flex: 1; min-width: 0; }
.thumb {
  width: 64px; height: 64px; border-radius: 18px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--card-soft); overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb-btn { padding: 0; border: 0; background: none; border-radius: 18px; cursor: zoom-in; flex: none; }

/* ----- 菜單照片與放大檢視 ----- */
.menu-img-wrap {
  position: relative; display: block; width: 100%; padding: 0;
  border-radius: var(--radius-input); overflow: hidden;
  border: 1px solid var(--border); background: var(--card-soft); cursor: zoom-in;
}
.menu-img-wrap img { width: 100%; max-height: 200px; object-fit: cover; display: block; }
.menu-img-hint {
  position: absolute; right: 10px; bottom: 10px;
  background: rgba(59, 40, 24, .78); color: #FFFDF9;
  font-size: .74rem; font-weight: 600; padding: 4px 10px; border-radius: 999px;
}
.sheet-photo { width: 100%; max-height: 220px; object-fit: cover; border-radius: var(--radius-input); }
.sheet-mask.lightbox { align-items: center; padding: 16px; cursor: zoom-out; z-index: 150; }
.lightbox img { max-width: 100%; max-height: 86vh; border-radius: 14px; object-fit: contain; box-shadow: var(--shadow-nav); }
.lightbox .btn2 { position: fixed; top: 16px; right: 16px; }

/* ----- 類別膠囊列（橫向捲動） ----- */
.tabs { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 6px; margin: 0 -2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 20px; border: none; border-radius: 999px;
  background: var(--caramel); color: #FFFDF9;
  font-size: .92rem; font-weight: 600; white-space: nowrap; flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(120, 90, 60, .14);
  transition: background-color .15s ease, transform .12s ease;
}
.tab:active { transform: scale(.96); }
.tab.on { background: var(--sage); box-shadow: 0 4px 10px rgba(139, 148, 126, .34); }

/* ----- 規格選項 ----- */
.grp-title { font-size: .84rem; font-weight: 700; color: var(--text-title); margin-bottom: 8px; }
.grp-title .req { color: var(--danger); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  position: relative; display: inline-flex; align-items: center;
  min-height: 44px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: #FFFDF9;
  color: var(--text-muted); font-size: .9rem; font-weight: 600;
}
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; width: 100%; height: 100%; cursor: pointer; }
.chip:has(input:checked) { background: var(--sage); border-color: var(--sage); color: #FFFDF9; }
.chip:has(input:checked) .add { color: #EEF2E8; }
.chip:has(input:focus-visible) { outline: 3px solid var(--sage-dark); outline-offset: 2px; }
.chip .add { margin-left: 6px; font-size: .8rem; }

/* ----- 列表、統計 ----- */
.line { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 40px; }
/* 彙整：各品項總數（品名一行，規格分行列在下面） */
.sum-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.sum-item:last-of-type { border-bottom: 0; }
.sum-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 17px; }
.sum-specs { list-style: none; margin: 8px 0 0; padding: 0 0 0 12px; border-left: 3px solid var(--border); display: grid; gap: 6px; }
.sum-specs li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 15px; line-height: 1.5; }
.sum-specs li b { white-space: nowrap; color: var(--text-title); }
.count { background: var(--sage-soft); color: var(--sage-dark); border-radius: 999px; padding: 2px 12px; font-weight: 700; white-space: nowrap; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--sage) !important; color: #FFFDF9;
  font-weight: 700; display: flex; align-items: center; justify-content: center; flex: none;
}
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stat {
  background: var(--card-soft) !important; color: var(--text-dark) !important;
  border: 1px solid var(--border); border-radius: var(--radius-input);
  box-shadow: none; padding: 12px; gap: 2px; text-align: center;
}
.stat .muted { color: var(--text-muted) !important; }
.stat b { font-size: 1.18rem; font-weight: 800; color: var(--text-title); }
.pay-form { display: flex; flex-direction: column; gap: 12px; }
.bill-total { font-size: 2.3rem; font-weight: 700; line-height: 1.2; color: var(--ink); }
.pay-text { background: var(--card-soft); border-radius: 14px; padding: 14px 16px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; }
.unpaid { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.progress { height: 10px; background: var(--pill-bg); border-radius: 999px; overflow: hidden; }
.progress > div { height: 100%; background: var(--sage); border-radius: 999px; transition: width .25s ease; }

.warn { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.warn-title { font-size: .9rem; font-weight: 600; color: var(--warn-ink); }
.notice { font-size: .9rem; line-height: 1.5; color: var(--danger); font-weight: 600; }
.drop {
  border: 2px dashed var(--border-strong); border-radius: var(--radius-input); min-height: 96px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); text-align: center; padding: 8px; cursor: pointer; background: #FFFDF9;
}
.drop:hover { border-color: var(--caramel); }
.sep { border: 0; border-top: 1px solid var(--border); margin: 4px 0; width: 100%; }

.qty { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.qty button {
  width: 44px; height: 44px; border-radius: 50%; padding: 0;
  border: 1.5px solid var(--border-strong); background: #FFFDF9; color: var(--text-title);
  font-size: 1.25rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.qty button:last-child { background: var(--caramel); border-color: var(--caramel); color: #FFFDF9; }
.qty span { min-width: 24px; text-align: center; font-weight: 700; }

/* 辨識結果：分類欄 */
.ocr-cat { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; font-size: .8rem; font-weight: 600; color: var(--text-muted); }
.ocr-cat .input { min-height: 36px; padding: 4px 10px; font-size: 15px; max-width: 150px; min-width: 0; }
.ocr-cat span { flex: none; }

/* 購物車每一行 + 備註 */
.cart-line { display: flex; flex-direction: column; gap: 6px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.cart-line:last-of-type { border-bottom: 0; }
.note-input { min-height: 40px; padding: 6px 12px; font-size: 15px; background: var(--card-soft); border-style: dashed; }
.note-input:focus { border-style: solid; background: #FFFDF9; }
.item-note { color: var(--caramel-hover); font-weight: 600; }

.check { display: flex; align-items: center; gap: 6px; min-height: 44px; font-size: .84rem; color: var(--text-muted); }
.check input { width: 20px; height: 20px; accent-color: var(--sage); }

/* ----- 開團步驟 ----- */
.steps { display: flex; align-items: center; gap: 8px; font-size: .8rem; font-weight: 700; color: var(--text-muted); }
.steps span:not(.arrow) { border-radius: 999px; padding: 4px 12px; background: var(--pill-bg); }
.steps span.on { background: var(--sage); color: #FFFDF9; }

/* ----- 2 欄店家卡片 ----- */
.store-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.store-card {
  align-items: center; text-align: center; justify-content: space-between;
  gap: 0; padding: 16px 12px 14px;
}
.store-card .illus { margin-bottom: 8px; }
.store-card .name {
  margin: 0 0 8px; font-size: 1.08rem; font-weight: 700; color: var(--text-dark); line-height: 1.25;
  width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.store-card .meta {
  display: flex; align-items: center; justify-content: center; gap: 5px; flex-wrap: wrap;
  margin-bottom: 12px; font-size: .78rem; color: var(--text-title); font-weight: 600;
}
.store-card { position: relative; }
.store-card .card-main {
  width: 100%; display: flex; flex-direction: column; align-items: center;
  background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; text-align: center;
}
.store-card .name { display: block; }
button.card-main { cursor: pointer; border-radius: 14px; touch-action: manipulation; -webkit-tap-highlight-color: rgba(166, 117, 75, .15); }
button.card-main:active { opacity: .7; }
.store-card .edit-badge {
  position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  background: var(--pill-bg); color: var(--text-title);
}
.store-card.busy { opacity: .6; }
.store-card .btn { width: 100%; font-size: .9rem; padding: 0 10px; box-shadow: 0 3px 8px rgba(166, 117, 75, .22); }
/* 商品清單：拖動排序、批量選取 */
.grip { flex: none; display: flex; align-items: center; justify-content: center; width: 30px; min-height: 44px; margin-left: -6px;
  color: var(--text-muted); fill: currentColor; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.grip:active { cursor: grabbing; }
.prod-row { border-radius: 12px; transition: background .15s, box-shadow .15s; }
.prod-row.dragging { background: var(--card-soft); box-shadow: 0 6px 18px rgba(59, 40, 24, .18); position: relative; z-index: 2; }
.prod-row.picked { background: var(--sage-soft); }
.pick-box { flex: none; display: flex; align-items: center; justify-content: center; width: 30px; min-height: 44px; }
.pick-box input { width: 20px; height: 20px; }
.bulk-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border-radius: 12px; background: var(--card-soft); }
.group-link { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; border-radius: 12px; margin: -6px; padding: 6px; }
.group-link:hover, .group-link:focus-visible { background: var(--card-soft); }
.group-link .chev { font-size: 26px; line-height: 1; color: var(--text-muted); }
.home-actions { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }
.home-actions .btn, .home-actions .btn2 { width: 100%; min-height: 50px; white-space: nowrap; padding: 0 8px; }
.home-actions .btn2.big { font-size: 1.05rem; font-weight: 700; letter-spacing: .04em; }
@media (max-width: 420px) { .home-actions { grid-template-columns: 3fr 2fr; } .home-actions .btn, .home-actions .btn2 { font-size: 1rem; letter-spacing: 0; } }
.danger-link { color: #B0443A !important; align-self: center; }
.text-link {background: none; border: 0; color: var(--text-muted); font-size: .8rem; text-decoration: underline; padding: 6px; min-height: 32px; }
.menu-peek { width: 100%; border-top: 1px solid var(--border); padding-top: 6px; margin-bottom: 8px; font-size: .8rem; text-align: left; }
.new-store { flex-direction: row; align-items: center; gap: 14px; text-align: left; }
.new-store .plus {
  width: 52px; height: 52px; border-radius: 50%; background: rgba(255, 255, 255, .25);
  display: flex; align-items: center; justify-content: center; font-size: 1.8rem; flex: none;
}
button.card { width: 100%; cursor: pointer; font: inherit; }

/* ----- 點單送出條（位於導覽列上方） ----- */
.cartbar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(92px + env(safe-area-inset-bottom));
  width: calc(100% - 32px); max-width: 448px;
  background: var(--card); border: 1px solid var(--border); border-radius: 22px;
  padding: 10px 10px 10px 16px; box-shadow: var(--shadow-nav);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  z-index: 45; color: var(--text-dark);
}
.cartbar .sub { font-size: .8rem; color: var(--text-muted); }
.cartbar button {
  background: var(--caramel); color: #FFFDF9; border: 0; border-radius: 999px;
  min-height: 44px; padding: 0 18px; font-weight: 700; box-shadow: var(--shadow-btn);
}

/* ----- 底部懸浮導覽列 ----- */
.nav-wrap {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(14px + env(safe-area-inset-bottom));
  width: calc(100% - 28px); max-width: 452px; z-index: 50;
}
.nav {
  background: var(--nav-bg); border-radius: 28px; box-shadow: var(--shadow-nav);
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  overflow: hidden; border: 1px solid rgba(255, 255, 255, .85);
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 64px; padding: 8px 4px; text-decoration: none;
  color: var(--text-title); font-size: .76rem; font-weight: 600;
  transition: background-color .18s ease, color .18s ease;
}
.nav-item svg { width: 24px; height: 24px; stroke: currentColor; stroke-width: 1.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.nav-item.active { background: var(--sage); color: #FFFDF9; border-radius: 24px; }

/* ----- 底部彈出視窗 ----- */
.sheet-mask {
  position: fixed; inset: 0; background: rgba(59, 40, 24, .45); backdrop-filter: blur(4px);
  z-index: 120; display: flex; align-items: flex-end; justify-content: center;
}
.sheet {
  width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto;
  background: var(--card); border-radius: 26px 26px 0 0;
  padding: 20px 18px calc(28px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-nav);
  display: flex; flex-direction: column; gap: 16px;
  animation: up .2s ease-out;
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
/* 內容太長時用捲動的，不要把按鈕列或照片壓扁 */
.sheet > * { flex-shrink: 0; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sheet .card { box-shadow: none; background: var(--card-soft); border-color: var(--border); }

/* ----- 提示 ----- */
.toast {
  position: fixed; top: 18px; left: 50%; transform: translateX(-50%);
  background: rgba(59, 40, 24, .94); color: #FFFDF9;
  padding: 10px 18px; border-radius: 999px; font-size: .88rem; font-weight: 600;
  z-index: 200; box-shadow: var(--shadow-nav);
  width: max-content; max-width: calc(100vw - 32px); text-align: center;
}
.fade-enter-active, .fade-leave-active { transition: opacity .2s; }
.fade-enter-from, .fade-leave-to { opacity: 0; }

.demo-bar { font-size: .78rem; color: var(--text-muted); text-align: center; display: flex; flex-wrap: wrap; gap: 6px 12px; justify-content: center; margin-top: 4px; }
.demo-bar a { font-weight: 700; }
.empty { text-align: center; align-items: center; }

.spin { width: 18px; height: 18px; border: 3px solid var(--pill-bg); border-top-color: var(--caramel); border-radius: 50%; animation: r .7s linear infinite; display: inline-block; }
@keyframes r { to { transform: rotate(360deg); } }

/* ----- 列印（彙整頁） ----- */
/* ---------- 外送門檻、售完、分發清單 ---------- */
.goal-in { display: flex; align-items: center; gap: 10px; }
.goal-in .input { min-width: 0; }
.goal-in input { flex: 1; }
.goal-in select { width: 84px; flex: none; }
.goal-bar { display: flex; flex-direction: column; gap: 8px; }
.tag.sold { background: var(--danger-soft); color: var(--danger-ink); }
.prod-card.sold .thumb-wrap, .prod-card.sold .prod-name, .prod-card.sold .prod-price, .prod-row.sold > .price { opacity: .5; }
.sold-line { display: flex; align-items: center; gap: 4px; }
.sold-line .text-link { padding-left: 0; padding-right: 0; min-height: 40px; white-space: nowrap; }
.sold-note { background: var(--danger-soft); color: var(--danger-ink); border-radius: 14px; padding: 12px 16px; font-weight: 600; line-height: 1.6; }
.qty button:disabled { opacity: .4; cursor: not-allowed; }
.fold-head h2 { white-space: nowrap; }
.prefs-meta { min-width: 0; }
.prefs-meta > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.got-card .muted, .got-card .count { white-space: nowrap; }
.got-card p.muted { white-space: normal; }
.last-card { gap: 4px; }
.last-row { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 8px 0; border-top: 1px solid var(--border); }
.last-text { flex: 1; min-width: 0; line-height: 1.5; overflow-wrap: anywhere; }
.last-text small { display: block; font-size: .86rem; color: var(--text-muted); }
.last-row.off .last-text { opacity: .55; }
.last-row .muted { white-space: nowrap; }
.hand-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 6px 0; background: none; border: 0; text-align: left; color: var(--text-dark); cursor: pointer; }
.hand-box { flex: none; width: 28px; height: 28px; border: 2px solid var(--border-strong); border-radius: 9px; display: grid; place-items: center; font-weight: 700; color: #FFFDF9; background: #FFFDF9; }
.hand-box.on { background: var(--sage); border-color: var(--sage); }
.hand-text { flex: 1; min-width: 0; }
.hand-text small { display: block; font-size: .86rem; font-weight: 400; color: var(--text-muted); line-height: 1.5; }
.hand-done .hand-text, .hand-done .sum-head b { opacity: .55; }

/* ---------- 導覽動畫（js/tour.js） ---------- */
.tour-dim { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 160; pointer-events: none; }
.tour-dim path { fill: rgba(43, 28, 16, .62); pointer-events: fill; }
.tour-hand { position: fixed; left: 0; top: 0; width: 0; height: 0; z-index: 161; pointer-events: none; }
.tour-tap { position: absolute; left: -20px; top: -4px; width: 46px; animation: tour-tap 1.5s ease-in-out infinite; filter: drop-shadow(0 4px 6px rgba(43, 28, 16, .3)); }
.tour-tap svg { display: block; width: 100%; }
.tour-ring { position: absolute; left: -24px; top: -24px; width: 48px; height: 48px; border-radius: 50%; border: 4px solid #fff; animation: tour-ring 1.5s ease-out infinite; }
.tour-bubble {
  position: fixed; z-index: 162; width: min(350px, calc(100vw - 32px)); background: var(--card); color: var(--text-dark);
  border: 2px solid var(--text-title); border-radius: 22px; padding: 18px 18px 14px; box-shadow: 0 14px 34px rgba(43, 28, 16, .3);
  display: grid; grid-template-columns: 56px 1fr; gap: 12px 14px; animation: tour-pop .35s cubic-bezier(.3, 1.5, .6, 1);
}
.tour-cup { animation: tour-cup 1.6s ease-in-out infinite; transform-origin: 50% 90%; }
.tour-say { animation: tour-say .3s ease; }
.tour-say b { font-size: 1.1rem; }
.tour-say p { margin-top: 4px; line-height: 1.6; }
.tour-foot { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tour-foot .text-link { padding-left: 0; }
.tour-foot .btn { min-width: 104px; }
@keyframes tour-tap { 0%, 100% { transform: translate(8px, 12px) rotate(6deg); } 40%, 55% { transform: none; } }
@keyframes tour-ring { 0%, 38% { transform: scale(.2); opacity: 0; } 45% { opacity: .95; } 90%, 100% { transform: scale(1.5); opacity: 0; } }
@keyframes tour-pop { from { scale: .85; opacity: 0; } }
@keyframes tour-cup { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg) translateY(-3px); } }
@keyframes tour-say { from { opacity: 0; transform: translateX(10px); } }
@media (prefers-reduced-motion: reduce) { .tour-tap, .tour-ring, .tour-bubble, .tour-cup, .tour-say { animation: none; } }

@media print {
  .tour { display: none; }
  html, body { background: #fff; font-size: 12pt; }
  .shell { max-width: none; box-shadow: none; background: #fff; }
  .no-print, .bg-botanical, .cartbar, .toast, .demo-bar, .nav-wrap { display: none !important; }
  .page { padding: 0; min-height: 0; }
  .card { box-shadow: none; border: 1px solid #999; border-radius: 8px; break-inside: avoid; margin-bottom: 10px; background: #fff !important; }
  .stat, .count, .pill, .avatar { background: #fff !important; color: #000 !important; }
  .progress { display: none; }
}

/* ----- 修改結單時間 ----- */
.deadline-form { display: flex; flex-direction: column; gap: 10px; }
.deadline-form .input { min-width: 0; width: 100%; }

/* ----- 彙整頁店家電話 ----- */
.store-phone b { font-size: 1.15rem; overflow-wrap: anywhere; }

/* ----- 大家點了什麼 ----- */
.others-btn { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left; color: var(--text-title); cursor: pointer; }
.others-spec { display: block; font-size: .84rem; }
.sum-specs li.others-line { align-items: center; padding: 4px 0; }
.others-line .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.me-too { flex: none; min-height: 40px; padding: 0 14px; }
.sheet-mask.pick-mask { z-index: 130; }

/* ----- 我的團：開放中的團 ----- */
.open-title { font-size: 18px; margin-top: 8px; }
.go-order { flex: none; min-height: 40px; padding: 0 14px; }

/* ===== 版面區塊：手機直向排列，電腦版分欄 ===== */
.main, .order-head, .order-side, .order-main, .prod-grid { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.nav-brand { display: none; }

/* ----- 平板 ----- */
@media screen and (min-width: 700px) and (max-width: 959px) {
  .shell { max-width: 720px; }
  .store-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ----- 電腦版 ----- */
@media screen and (min-width: 960px) {
  .shell { max-width: none; box-shadow: none; overflow-x: clip; }
  .bg-mid-right { width: 110px; } .bg-mid-left { width: 96px; }
  .bg-bottom-left { bottom: 0; width: 120px; } .bg-bottom-right { bottom: 0; width: 130px; }

  /* 導覽列移到上方 */
  .nav-wrap {
    top: 0; bottom: auto; left: 0; transform: none; width: 100%; max-width: none; height: 68px;
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
    padding: 0 max(32px, calc((100% - 1120px) / 2));
    background: var(--nav-bg); border-bottom: 1px solid var(--border);
  }
  .nav-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; white-space: nowrap;
    font-family: var(--serif); font-size: 1.2rem; font-weight: 700; color: var(--text-title); }
  .nav { display: flex; gap: 6px; background: none; border: 0; border-radius: 0; box-shadow: none; overflow: visible; }
  .nav-item { flex-direction: row; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; font-size: .95rem; }
  .nav-item svg { width: 20px; height: 20px; }
  .nav-item.active { border-radius: 999px; }
  .nav-item:hover:not(.active) { background: var(--pill-bg); }

  /* 頁面寬度 */
  .page, .page.has-cart { width: 100%; max-width: 1184px; margin: 0 auto; padding: 100px 32px 64px; gap: 20px; }
  .page.narrow { max-width: 704px; }
  h1 { font-size: 1.6rem; }
  .tabs { flex-wrap: wrap; overflow: visible; }
  .card.link:hover { transform: translateY(-2px); }
  .toast { top: 84px; }

  /* 首頁：標題在左、按鈕在右 */
  .page.home { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-content: start; align-items: center; }
  .page.home > * { grid-column: 1 / -1; }
  .page.home > .hero-header { grid-column: 1; justify-content: flex-start; }
  .page.home > .home-actions { grid-column: 2; grid-template-columns: 190px 160px; }
  .hero-title { font-size: 1.9rem; }
  .store-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 18px; }

  /* 我的團、團主管理：左邊清單、右邊輔助 */
  .page.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-rows: auto auto auto auto 1fr; column-gap: 24px; align-items: start; }
  .page.split > .page-title { grid-column: 1 / -1; }
  .page.split > .main { grid-column: 1; grid-row: 2 / span 4; }
  .page.split > .side-1 { grid-column: 2; grid-row: 2; }
  .page.split > .side-2 { grid-column: 2; grid-row: 3; }
  .page.split > .side-3 { grid-column: 2; grid-row: 4; }
  .page.split > .side-4 { grid-column: 2; grid-row: 5; }

  /* 管理頁、彙整頁 */
  .cols { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 20px 24px; align-items: start; }
  .col { gap: 20px; min-width: 0; }
  .admin-cols { grid-template-rows: auto 1fr; }
  .admin-cols > .col:nth-child(1) { grid-column: 1; grid-row: 1; }
  .admin-cols > .col:nth-child(2) { grid-column: 2; grid-row: 1 / span 2; }
  .admin-cols > .col:nth-child(3) { grid-column: 1; grid-row: 2; }

  /* 點單頁：左邊商品、右邊購物車固定 */
  .page.order { display: grid; grid-template-columns: minmax(0, 1fr) 372px; grid-template-rows: auto 1fr; gap: 20px 28px; }
  .page.order > .notice, .page.order > .muted { grid-column: 1 / -1; }
  .order-head { grid-column: 1; grid-row: 1; }
  .order-main { grid-column: 1; grid-row: 2; }
  .order-side { grid-column: 2; grid-row: 1 / span 2; align-self: start; position: sticky; top: 92px; }
  .prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
  .cart-mask { position: static; display: block; background: none; backdrop-filter: none; z-index: auto; }
  .cart-mask .sheet { max-width: none; max-height: calc(100vh - 260px); min-height: 160px; border-radius: var(--radius-card); padding: 18px;
    box-shadow: var(--shadow-card); animation: none; }

  /* 其他彈出視窗置中 */
  .sheet-mask:not(.cart-mask) { align-items: center; padding: 24px; }
  .sheet-mask:not(.cart-mask) .sheet { max-width: 560px; max-height: 86vh; border-radius: 26px; padding: 24px; }
}

.cart-line + .sep { display: none; }
.store-card > .muted { margin-bottom: 10px; }
@media screen and (min-width: 960px) { html { scrollbar-gutter: stable; } }
@media screen and (min-width: 960px) {
  html, body { background: var(--bg); }
  .cart-mask .sheet { scrollbar-width: thin; }
  .cart-mask .sheet > .btn { position: sticky; bottom: 0; opacity: 1; }
  .cart-mask .sheet > .btn:disabled { background: #D6BBA2; }
}

/* ===== 商品卡片與小標籤 ===== */
.prod-card { padding: 14px; gap: 12px; }
.thumb-wrap { position: relative; display: block; flex: none; line-height: 0; }
.rec-badge { position: absolute; top: -7px; left: -7px; background: var(--danger); color: #FFFDF9; font-size: .7rem; font-weight: 700;
  line-height: 1; padding: 4px 7px; border-radius: 9px 9px 9px 2px; pointer-events: none; }
.prod-text { flex: 1; min-width: 0; min-height: 44px; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left;
  line-height: 1.75; cursor: pointer; -webkit-tap-highlight-color: rgba(166, 117, 75, .15); }
div.prod-text { cursor: default; }
.prod-name { font-size: 1.04rem; color: var(--text-title); margin-right: 6px; overflow-wrap: anywhere; }
.prod-price { display: block; line-height: 1.5; margin-top: 2px; }
.tag { display: inline-block; font-size: .72rem; font-weight: 600; line-height: 1.3; padding: 2px 7px; margin-right: 4px; border-radius: 7px;
  border: 1px solid transparent; white-space: nowrap; vertical-align: 1px; }
.tag.size { background: var(--pill-bg); color: var(--text-title); }
.tag.limit { border-color: var(--border-strong); color: var(--text-muted); background: #FFFDF9; }
.tag.diet { background: var(--warn-bg); color: var(--warn-ink); }
.tag.time { background: var(--sage-soft); color: var(--sage-dark); }
.tag.rec { background: var(--danger); color: #FFFDF9; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-list .tag { margin: 0; font-size: .78rem; padding: 3px 9px; }
.pick-info { display: flex; flex-direction: column; gap: 8px; font-size: .9rem; color: var(--text-muted); }
.lang-btn { flex: none; display: inline-flex; align-items: center; gap: 5px; min-height: 44px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--card); font: inherit; font-size: .86rem; font-weight: 600; color: var(--text-title); cursor: pointer; white-space: nowrap; }
.lang-btn svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 1.7; fill: none; }
.lang-row { display: flex; justify-content: flex-end; }
.zh-sub { display: block; font-size: .8rem; line-height: 1.5; color: var(--text-muted); overflow-wrap: anywhere; }
.prod-name.en { display: block; line-height: 1.35; margin: 0; }
.hero-title.en { font-size: 1.3rem; letter-spacing: 0; }
/* 點餐習慣 */
.habit { margin-left: 6px; padding: 1px 7px; border-radius: 7px; background: var(--warn-bg); color: var(--warn-ink); font-size: .74rem; font-weight: 600; }
.pref-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
/* 暱稱必填提示 */
.nick-card { border: 2px solid var(--danger); }
.nick-card h2, .nick-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.nick-title { font-size: 1.2rem; }
.nick-warn { color: var(--danger-ink); }
.must { background: var(--danger-ink); color: #FFFDF9; font-family: 'Noto Sans TC', sans-serif; font-size: .78rem; font-weight: 700; line-height: 1.3; padding: 3px 9px; border-radius: 8px; }
.nick-card .input, .must-input { border-color: var(--danger); }
.nick-bar { border: 2px solid var(--danger); }
.ask-mask { z-index: 140; }
.ask-next { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--card-soft); }
.en-meta { color: var(--text-muted); font-size: .9rem; }
button.chip { font-family: inherit; cursor: pointer; }
.chip.on { background: var(--sage); border-color: var(--sage); color: #FFFDF9; }
.tag-preview { display: flex; flex-direction: column; gap: 6px; }
.tag-preview .prod-card { padding: 14px; }
