/* Fans Club 網店 — shared styles (mobile-first, green/white). */
* { box-sizing: border-box; }
:root {
  --green: #1e7a3c; --green-dark: #155e2d; --green-light: #e8f5e9;
  --red: #c0392b; --amber: #b7791f; --ink: #222; --muted: #666; --line: #e3e3e0;
  --bg: #f7f7f5; --card: #fff; --radius: 12px;
}
html { -webkit-text-size-adjust: 100%; }
body { font-family: -apple-system, "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif; margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.55; }
a { color: var(--green); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 15px; padding: 9px 10px; border: 1px solid #ccc; border-radius: 8px; width: 100%; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green); outline-offset: 0; border-color: var(--green); }
label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 4px; }
label:first-child { margin-top: 0; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 18px; margin: 0 0 10px; }
h3 { font-size: 16px; margin: 18px 0 8px; }

.topbar { background: var(--green); color: #fff; padding: 12px 16px; position: sticky; top: 0; z-index: 50; }
.topbar-inner { max-width: 1080px; margin: 0 auto; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.topbar h1 { font-size: 19px; }
.topbar h1 a { color: #fff; }
.topbar .spacer { flex: 1; }
.topbar .lang-btn, .topbar .nav-btn { background: rgba(255,255,255,.16); color: #fff; border: 1px solid rgba(255,255,255,.4); border-radius: 999px; padding: 5px 12px; font-size: 13px; }
.topbar .nav-btn.active { background: #fff; color: var(--green); font-weight: bold; }
.cart-badge { background: var(--red); color: #fff; border-radius: 999px; font-size: 12px; padding: 1px 7px; margin-left: 4px; vertical-align: middle; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 16px; }
.card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: 0 1px 4px rgba(0,0,0,.08); margin-bottom: 16px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.prod-card { background: #fff; border-radius: var(--radius); padding: 14px; box-shadow: 0 1px 4px rgba(0,0,0,.08); display: flex; flex-direction: column; }
.prod-card h2 { font-size: 16px; margin: 0 0 4px; }
.prod-card p.desc { font-size: 13px; color: var(--muted); margin: 0 0 10px; flex: 1; }
.price-row { font-size: 14px; margin: 2px 0; }
.price-row .member { color: var(--red); font-weight: bold; font-size: 19px; }
.price-row .promo { color: var(--muted); text-decoration: line-through; margin-left: 6px; }
.price-row .regular { color: var(--muted); }
.tag { display: inline-block; font-size: 12px; background: var(--green-light); color: var(--green); border-radius: 999px; padding: 2px 8px; margin: 0 4px 6px 0; }
.tag.soldout { background: #fdecea; color: var(--red); }
.tag.warn { background: #fff8e1; color: var(--amber); }
.tag.grey { background: #eee; color: #666; }

.btn { display: inline-block; background: var(--green); color: #fff; border: none; border-radius: 8px; padding: 10px 18px; font-size: 15px; }
.btn:hover { background: var(--green-dark); }
.btn.secondary { background: #fff; color: var(--green); border: 1px solid var(--green); }
.btn.danger { background: var(--red); }
.btn.ghost { background: #eee; color: var(--ink); border: none; }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.block { display: block; width: 100%; text-align: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.note { background: #fff8e1; border: 1px solid #ffe082; border-radius: 8px; padding: 12px; font-size: 13px; margin-bottom: 16px; }
.err { background: #fdecea; border: 1px solid #f5c6cb; color: #721c24; border-radius: 8px; padding: 12px; font-size: 14px; margin-bottom: 16px; }
.ok-msg { background: var(--green-light); border: 1px solid #a3d9a5; color: #155e2d; border-radius: 8px; padding: 12px; font-size: 14px; margin-bottom: 16px; }
.muted { color: var(--muted); font-size: 13px; }
.money { font-variant-numeric: tabular-nums; }
.big-total { font-size: 22px; font-weight: bold; color: var(--red); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 12px; font-weight: normal; }
.totals { width: 100%; }
.totals td { border: none; padding: 4px 0; }
.totals td:last-child { text-align: right; }
.totals tr.grand td { font-size: 18px; font-weight: bold; color: var(--red); border-top: 1px solid var(--line); padding-top: 8px; }

.status-tag { display: inline-block; font-size: 12px; border-radius: 999px; padding: 2px 9px; background: #eee; color: #444; white-space: nowrap; }
.status-tag.st-100 { background: #fff3cd; color: #856404; }
.status-tag.st-101 { background: #ffe0b2; color: #7a4a00; }
.status-tag.st-200 { background: #d1ecf1; color: #0c5460; }
.status-tag.st-300, .status-tag.st-301 { background: #d4edda; color: #155724; }
.status-tag.st-400, .status-tag.st-410 { background: var(--green-light); color: var(--green-dark); }
.status-tag.st-900 { background: #f8d7da; color: #721c24; }
.status-tag.st-901 { background: #fdecea; color: #a94442; }
.status-tag.st-902 { background: #e2e3e5; color: #383d41; }

.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 12px; -webkit-overflow-scrolling: touch; }
.tabs button { white-space: nowrap; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; }
.tabs button.active { background: var(--green); color: #fff; border-color: var(--green); font-weight: bold; }
.tabs .cnt { background: var(--red); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 6px; margin-left: 4px; }
.tabs .cnt.grey { background: #999; }

.order-row { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; background: #fff; cursor: pointer; }
.order-row.selected { border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.order-row .row-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.order-row .row-top .ono { font-weight: bold; }
.order-row .row-top .amt { margin-left: auto; font-weight: bold; }
.order-row .row-sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.order-detail { border-top: 1px dashed var(--line); margin-top: 10px; padding-top: 10px; cursor: default; }
.receipt-thumb { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); cursor: zoom-in; }
.receipt-full { max-width: 100%; border-radius: 8px; }
.qr-box { display: inline-block; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px; text-align: center; margin: 6px 8px 6px 0; }
.qr-box svg { width: 140px; height: 140px; display: block; }
.qr-box .code { font-family: monospace; font-size: 13px; margin-top: 6px; word-break: break-all; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal .modal-card { background: #fff; border-radius: 12px; padding: 18px; max-width: 560px; width: 100%; max-height: 88vh; overflow-y: auto; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 14px; margin: 8px 0; }
.checkbox-row input { width: auto; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 640px) { .field-grid { grid-template-columns: 1fr; } }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar input, .toolbar select { width: auto; flex: 1; min-width: 130px; }
.toolbar .btn { flex: none; }
.section-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.section-nav button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 13px; font-size: 13px; }
.section-nav button.active { background: var(--green); color: #fff; border-color: var(--green); }
.kv { display: grid; grid-template-columns: 110px 1fr; gap: 4px 10px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
footer { text-align: center; color: #888; font-size: 12px; padding: 24px 12px; }
.qty-ctl { display: inline-flex; align-items: center; gap: 0; border: 1px solid #ccc; border-radius: 8px; overflow: hidden; }
.qty-ctl button { background: #f0f0f0; border: none; width: 34px; height: 34px; font-size: 17px; }
.qty-ctl span { min-width: 36px; text-align: center; font-weight: bold; }
.radio-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 8px; cursor: pointer; }
.radio-card.selected { border-color: var(--green); box-shadow: 0 0 0 1px var(--green); background: #f4faf4; }
.radio-card .title { font-weight: bold; }
.radio-card .sub { font-size: 13px; color: var(--muted); }
.wa-btn { background: #25d366; color: #fff; }
.wa-btn:hover { background: #1da851; }
@media (max-width: 640px) {
  .wrap { padding: 12px; }
  .topbar h1 { font-size: 17px; }
  table.responsive { display: block; overflow-x: auto; }
}
