:root {
  --bg: #0E1116; --surface: #161C26; --surface2: #1E2634;
  --line: #2A3446; --text: #E8EAED; --muted: #8B93A1;
  --gold: #F5B841; --gold-dim: #C79430; --ok: #4ADE80; --warn: #FBBF24; --danger: #F87171;
}
* { box-sizing: border-box; margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: 'Noto Sans TC', system-ui, sans-serif;
  min-height: 100vh; display: flex; flex-direction: column;
  background-image: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(245,184,65,.07), transparent);
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-weight: 900; letter-spacing: .02em; }
h1 { font-size: 1.6rem; margin: 1.2rem 0 .8rem; }
h2 { font-size: 1.1rem; margin-bottom: .8rem; color: var(--gold); }

/* nav */
.nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .8rem 1.2rem; border-bottom: 1px solid var(--line); background: rgba(14,17,22,.9);
  position: sticky; top: 0; z-index: 10; backdrop-filter: blur(8px); flex-wrap: wrap; }
.brand { font-family: 'Chakra Petch', 'Noto Sans TC', sans-serif; font-size: 1.25rem; font-weight: 700; color: var(--text); }
.brand:hover { text-decoration: none; }
.coin { color: var(--gold); margin-right: .35rem; }
.nav-links { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.nav-links a { color: var(--text); font-weight: 500; }
.nav-links a.accent { color: var(--gold); }
.badge { background: var(--gold); color: #1a1405; border-radius: 999px; font-size: .7rem;
  font-weight: 700; padding: .05rem .4rem; margin-left: .25rem; }
.inline { display: inline; }
.link-btn { background: none; border: none; color: var(--gold); cursor: pointer; font: inherit; padding: 0; }
.link-btn.danger { color: var(--danger); }
.flash { background: rgba(245,184,65,.12); border: 1px solid var(--gold-dim); color: var(--gold);
  padding: .6rem 1.2rem; text-align: center; font-weight: 500; }

.container { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 1rem 3rem; }
.footer { border-top: 1px solid var(--line); color: var(--muted); text-align: center;
  padding: 1.2rem; font-size: .85rem; }

/* hero */
.hero { text-align: center; padding: 2.5rem 0 1.5rem; }
.hero h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); }
.hero .gold, .gold { color: var(--gold); }
.hero p { color: var(--muted); margin-top: .5rem; }

/* chips / categories */
.cat-bar { display: flex; gap: .5rem; flex-wrap: wrap; margin: 1rem 0; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: .35rem .95rem;
  color: var(--text); font-size: .9rem; background: var(--surface); }
.chip:hover { text-decoration: none; border-color: var(--gold-dim); }
.chip.on { background: var(--gold); color: #1a1405; font-weight: 700; border-color: var(--gold); }
.chip.small { font-size: .75rem; padding: .2rem .7rem; }

/* product grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden; color: var(--text); transition: transform .15s, border-color .15s; }
.card:hover { transform: translateY(-3px); border-color: var(--gold-dim); text-decoration: none; }
.card-img { aspect-ratio: 4/3; background: var(--surface2); display: grid; place-items: center; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.noimg { font-size: 2.5rem; color: var(--line); }
.noimg.big { font-size: 5rem; }
.card-body { padding: .8rem .9rem 1rem; }
.card-body h3 { font-size: .95rem; font-weight: 700; margin-bottom: .4rem; }
.price { color: var(--gold); font-weight: 900; font-family: 'Chakra Petch', sans-serif; }
.price.big { font-size: 1.6rem; margin: .5rem 0 1rem; }

/* product page */
.product-page { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; margin-top: 1.5rem; }
.product-img { background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  display: grid; place-items: center; overflow: hidden; min-height: 280px; }
.product-img img { width: 100%; height: 100%; object-fit: cover; }
.desc { color: var(--muted); line-height: 1.7; margin-bottom: 1rem; }
@media (max-width: 720px) { .product-page, .checkout-layout { grid-template-columns: 1fr; } }

/* panels / forms */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 1.3rem; margin-bottom: 1.2rem; }
.panel.center { text-align: center; padding: 2.5rem 1.3rem; }
.panel.narrow { max-width: 420px; margin: 2.5rem auto; }
.panel.narrow-wide { max-width: 560px; margin: 2rem auto; }
.form { display: flex; flex-direction: column; gap: .9rem; }
.form label { display: flex; flex-direction: column; gap: .35rem; font-size: .88rem; color: var(--muted); font-weight: 500; }
input, select, textarea { background: var(--surface2); border: 1px solid var(--line); border-radius: 8px;
  color: var(--text); padding: .6rem .8rem; font: inherit; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold-dim); border-color: transparent; }
.checkbox { flex-direction: row !important; align-items: center; color: var(--text) !important; }
.checkbox input { width: auto; }
.btn { display: inline-block; background: var(--surface2); border: 1px solid var(--line);
  color: var(--text); border-radius: 9px; padding: .6rem 1.3rem; font: inherit; font-weight: 700;
  cursor: pointer; text-align: center; }
.btn:hover { border-color: var(--gold-dim); text-decoration: none; }
.btn.primary { background: var(--gold); color: #1a1405; border-color: var(--gold); }
.btn.primary:hover { background: #ffd067; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #2b0808; }
.btn.wide { width: 100%; }
.error { color: var(--danger); font-weight: 500; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.ok { color: var(--ok); }
.warn { color: var(--warn); }
.right { text-align: right; }
.mono { font-family: 'Chakra Petch', monospace; letter-spacing: .04em; }
.big { font-size: 1.15rem; }

/* tables */
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; color: var(--muted); font-weight: 500; padding: .5rem .6rem;
  border-bottom: 1px solid var(--line); }
.table td { padding: .65rem .6rem; border-bottom: 1px solid rgba(42,52,70,.5); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.cart-total { text-align: right; padding: 1rem .6rem .4rem; font-weight: 700; }
.prod-cell { display: flex; align-items: center; gap: .6rem; }
.prod-cell img { width: 44px; height: 34px; object-fit: cover; border-radius: 6px; }
.actions { white-space: nowrap; }
.actions > * { margin-right: .5rem; }

/* checkout */
.checkout-layout { display: grid; grid-template-columns: 1.2fr 1fr; gap: 1.2rem; align-items: start; }
.pay-option { flex-direction: row !important; gap: .7rem !important; align-items: flex-start;
  background: var(--surface2); border: 1px solid var(--line); border-radius: 10px; padding: .8rem .9rem; cursor: pointer; }
.pay-option:has(input:checked) { border-color: var(--gold); }
.pay-option input { width: auto; margin-top: .2rem; }
.pay-option strong { color: var(--text); display: block; }
.pay-option small { color: var(--muted); display: block; margin-top: .15rem; }
.pay-option small.ok { color: var(--ok); }
.pay-option small.warn { color: var(--warn); }
.row { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0;
  border-bottom: 1px solid rgba(42,52,70,.5); font-size: .92rem; }
.row:last-child { border-bottom: none; }
.row.total { font-weight: 900; font-size: 1.05rem; border-top: 1px solid var(--line); margin-top: .3rem; }
.bank-box { background: var(--surface2); border: 1px dashed var(--gold-dim); border-radius: 10px;
  padding: 1rem; white-space: pre-wrap; font-family: inherit; margin-bottom: 1rem; }

/* status */
.status { border-radius: 999px; padding: .18rem .7rem; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.status.pending { background: rgba(139,147,161,.18); color: var(--muted); }
.status.awaiting_review { background: rgba(251,191,36,.15); color: var(--warn); }
.status.paid { background: rgba(74,222,128,.14); color: var(--ok); }
.status.processing { background: rgba(96,165,250,.15); color: #60A5FA; }
.status.completed { background: rgba(245,184,65,.15); color: var(--gold); }
.status.cancelled { background: rgba(248,113,113,.14); color: var(--danger); }

/* admin */
.admin-nav { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: 1rem;
  border-bottom: 1px solid var(--line); padding-bottom: .6rem; }
.admin-nav a { color: var(--text); padding: .4rem .9rem; border-radius: 8px; font-weight: 500; }
.admin-nav a:hover { background: var(--surface2); text-decoration: none; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .8rem; margin: 1rem 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; }
.stat .num { font-size: 1.5rem; font-weight: 900; font-family: 'Chakra Petch', sans-serif; }
.stat .lbl { color: var(--muted); font-size: .82rem; margin-top: .2rem; }
.stat.warn-bg { border-color: var(--gold-dim); }
.verify-imgs { display: flex; gap: 1rem; margin: .8rem 0; flex-wrap: wrap; }
.verify-imgs a { display: flex; flex-direction: column; gap: .3rem; font-size: .8rem; color: var(--muted); }
.verify-imgs img { width: 180px; height: 120px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.inline-form { flex-direction: row !important; flex-wrap: wrap; align-items: center; }
.inline-form input[type=text] { flex: 1; min-width: 180px; width: auto; }

@media (prefers-reduced-motion: reduce) { .card { transition: none; } }

/* LINE Login */
.btn.line { background: #06C755; border-color: #06C755; color: #fff; }
.btn.line:hover { background: #05b34c; text-decoration: none; }
.divider { display: flex; align-items: center; gap: .8rem; color: var(--muted); margin: .3rem 0; font-size: .82rem; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.line-bind { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .9rem 1.3rem; }

/* 客服聊聊 */
.chat-fab { position: fixed; right: 1.2rem; bottom: 1.2rem; width: 56px; height: 56px; border-radius: 50%;
  background: var(--gold); display: grid; place-items: center; font-size: 1.5rem; z-index: 50;
  box-shadow: 0 4px 16px rgba(0,0,0,.4); text-decoration: none !important; }
.fab-badge { position: absolute; top: -4px; right: -4px; background: var(--danger); color: #fff;
  border-radius: 999px; font-size: .7rem; font-weight: 700; padding: .1rem .4rem; }
.chat-box { height: 380px; overflow-y: auto; background: var(--surface2); border: 1px solid var(--line);
  border-radius: 10px; padding: 1rem; margin-bottom: .8rem; display: flex; flex-direction: column; gap: .5rem; }
.bubble { max-width: 78%; padding: .5rem .8rem; border-radius: 12px; font-size: .92rem; line-height: 1.5; }
.bubble small { display: block; color: var(--muted); font-size: .68rem; margin-top: .2rem; }
.bubble.me { align-self: flex-end; background: var(--gold); color: #1a1405; }
.bubble.me small { color: rgba(26,20,5,.6); }
.bubble.them { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); }
.bar { display: inline-block; height: 10px; background: linear-gradient(90deg, var(--gold-dim), var(--gold)); border-radius: 5px; min-width: 2px; vertical-align: middle; }
