:root {
  --teal: #2bb3a3; --teal-d: #1f8e80; --ink: #2a3340; --muted: #8a96a3;
  --line: #e6ebf0; --bg: #f4f7f8; --card: #fff; --amber: #c98a1a; --danger: #d9534f;
  --shadow: 0 2px 10px rgba(40,60,80,.07);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
  color: var(--ink); background: var(--bg); line-height: 1.55; -webkit-font-smoothing: antialiased;
}
a { color: var(--teal-d); }
button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }
img { max-width: 100%; }

/* 通用元件 */
.btn { border: 0; border-radius: 10px; padding: 11px 16px; font-size: 15px; font-weight: 600;
  background: var(--teal); color: #fff; transition: filter .15s; }
.btn:hover { filter: brightness(.95); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.ghost { background: #fff; color: var(--teal-d); border: 1.5px solid var(--teal); }
.btn.gray { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.btn.danger { background: #fff; color: var(--danger); border: 1.5px solid #f0c9c7; }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
input, textarea, select { font-family: inherit; font-size: 15px; width: 100%; padding: 10px 12px;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); }
input:focus, textarea:focus, select:focus { outline: 0; border-color: var(--teal); }
label.fld { display: block; margin: 12px 0 6px; font-size: 13px; font-weight: 600; color: #56636f; }
.card { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 16px; }
.tag { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 20px; background: #eef6f5; color: var(--teal-d); font-weight: 600; }
.tag.amber { background: #fdf3e0; color: var(--amber); }
.tag.gray { background: #eef1f4; color: var(--muted); }
.tag.green { background: #e7f6ec; color: #2a8a4a; }
.muted { color: var(--muted); }
.price { color: var(--teal-d); font-weight: 800; }
.row { display: flex; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; }

/* 前台版面 */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--teal);
  color: #fff; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; }
.topbar h1 { font-size: 19px; margin: 0; }
.topbar .links a { color: #fff; opacity: .92; margin-left: 14px; font-size: 14px; text-decoration: none; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 18px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.gcard { background: #fff; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow);
  cursor: pointer; transition: transform .12s; }
.gcard:hover { transform: translateY(-3px); }
.gcard .ph { height: 150px; background: #dde7e6 center/cover; }
.gcard .body { padding: 13px 14px; }
.gcard h3 { margin: 0 0 4px; font-size: 16px; }
.pcard { display: flex; gap: 13px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.pcard .ph { width: 92px; height: 92px; border-radius: 10px; background: #dde7e6 center/cover; flex: none; }

/* 浮動購物車鈕 */
.fab { position: fixed; right: 18px; bottom: 18px; z-index: 40; background: var(--teal);
  color: #fff; border: 0; border-radius: 50%; width: 58px; height: 58px; font-size: 22px;
  box-shadow: 0 6px 18px rgba(43,179,163,.45); }
.fab .badge { position: absolute; top: -2px; right: -2px; background: var(--danger); color: #fff;
  font-size: 12px; min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; padding: 0 5px; }

/* 抽屜/彈窗 */
.overlay { position: fixed; inset: 0; background: rgba(20,30,40,.45); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center; }
.overlay.center { align-items: center; }
.sheet { background: #fff; width: 100%; max-width: 540px; max-height: 90vh; overflow: auto;
  border-radius: 18px 18px 0 0; padding: 18px; }
.overlay.center .sheet { border-radius: 18px; }
.sheet h2 { margin: 4px 0 12px; font-size: 19px; }
.sheet .close { float: right; border: 0; background: #f0f3f5; border-radius: 50%; width: 34px; height: 34px; font-size: 18px; }
.opt { display: inline-flex; align-items: center; gap: 5px; border: 1.5px solid var(--line);
  border-radius: 22px; padding: 8px 14px; margin: 0 8px 8px 0; cursor: pointer; font-size: 14px; background: #fff; }
.opt.on { border-color: var(--teal); background: #eef6f5; color: var(--teal-d); font-weight: 700; }
.qtybar { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 10px; overflow: hidden; }
.qtybar button { width: 38px; height: 38px; border: 0; background: #f4f7f8; font-size: 18px; }
.qtybar span { width: 46px; text-align: center; font-weight: 700; }
.line-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 99;
  background: #2a3340; color: #fff; padding: 10px 18px; border-radius: 22px; font-size: 14px; box-shadow: var(--shadow); }
.empty { text-align: center; color: var(--muted); padding: 50px 16px; }
.note { background: #fef9ee; border: 1px solid #f3e3c0; border-radius: 12px; padding: 12px 14px; font-size: 14px; color: #7a6526; }
@media (max-width: 600px) { .grid { grid-template-columns: 1fr 1fr; } .gcard .ph { height: 110px; } }
