:root {
  --c-brand: #2f45c5;
  --c-brand-deep: #2539ad;
  --c-brand-soft: #eef1fd;
  --c-text: #14171f;
  --c-text-sub: #8b919c;
  --c-text-mute: #a8adb7;
  --c-bg: #f1f2f4;
  --c-card: #ffffff;
  --c-line: #eceef1;
  --c-price: #e5356c;
  --c-star: #f5b731;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-pill: 999px;
  --tabbar-h: 64px;
  --shadow-card: 0 2px 10px rgba(20, 23, 31, .05);
  font-family: "PingFang TC", "PingFang HK", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: #e4e7ee; color: var(--c-text); }
button, input, textarea, select { font-family: inherit; }
button { border: 0; background: none; padding: 0; color: inherit; }
a { color: inherit; text-decoration: none; }
.phone {
  width: min(430px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--c-bg);
  position: relative;
}
#view { padding-bottom: calc(var(--tabbar-h) + 36px + env(safe-area-inset-bottom)); }
#view.is-sub { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }

.top { display: flex; gap: 10px; align-items: center; padding: 12px 14px 6px; }
.loc, .search {
  height: 40px; border-radius: var(--r-pill); background: var(--c-card);
  box-shadow: var(--shadow-card); display: flex; align-items: center;
}
.loc { padding: 0 12px 0 14px; gap: 4px; font-weight: 700; font-size: 15px; flex: none; }
.loc svg { color: var(--c-text-sub); }
.search { flex: 1; padding: 0 14px; gap: 8px; color: var(--c-text-mute); }
.search input { border: 0; outline: 0; width: 100%; background: transparent; font-size: 14px; color: var(--c-text); }
.marq {
  margin: 8px 14px 4px; height: 36px; border-radius: 12px; background: #e7f0ff;
  display: flex; align-items: center; gap: 8px; padding: 0 12px; color: #3c5ed4; overflow: hidden;
}
.marq__win { overflow: hidden; flex: 1; }
.marq__track { display: flex; width: max-content; font-size: 13px; font-weight: 600; animation: marq 18s linear infinite; }
.marq__track span { padding-right: 48px; }
@keyframes marq { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.sec { padding: 14px 14px 0; }
.sec h2 { margin: 0 0 10px; font-size: 18px; font-weight: 800; letter-spacing: .2px; }
.cats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cat {
  height: 128px; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 8px 8px 12px;
}
.cat__art { width: 92px; height: 86px; display: flex; align-items: flex-end; justify-content: center; }
.cat__art img { width: 92px; height: 86px; object-fit: contain; }
.cat__name { font-size: 14px; font-weight: 800; color: #243049; }
.offers { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 2px; }
.offer {
  flex: none; width: 168px; background: var(--c-card); border-radius: 16px; padding: 14px;
  box-shadow: var(--shadow-card);
}
.offer b { display: block; color: var(--c-price); font-size: 18px; }
.offer span { display: block; margin-top: 4px; color: var(--c-text-sub); font-size: 12px; }
.list { display: flex; flex-direction: column; gap: 12px; }
.svc { background: var(--c-card); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-card); }
.svc__cover { height: 168px; position: relative; }
.coverpic { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.svc__badges { position: absolute; left: 10px; top: 10px; display: flex; gap: 6px; }
.badge { font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 6px; color: #fff; }
.badge.cert { background: var(--c-brand); }
.badge.hot { background: #ff8a34; }
.badge.off { background: var(--c-price); }
.fav {
  position: absolute; right: 10px; top: 10px; width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,.92); display: flex; align-items: center; justify-content: center; color: #c5c8d0;
}
.fav.on { color: var(--c-price); }
.svc__body { padding: 12px 14px 14px; }
.svc__body h3 { margin: 0; font-size: 16px; font-weight: 800; }
.meta { margin: 8px 0 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.when { color: var(--c-text-sub); font-size: 12.5px; display: flex; align-items: center; gap: 4px; }
.price { color: var(--c-price); font-weight: 800; font-size: 16px; white-space: nowrap; }
.price s { margin-left: 6px; color: var(--c-text-mute); font-weight: 500; font-size: 12px; }
.subbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px;
  height: 52px; padding: 0 8px; background: rgba(241,242,244,.92); backdrop-filter: blur(8px);
}
.subbar h1 { margin: 0; font-size: 17px; font-weight: 800; flex: 1; text-align: center; }
.iconbtn { width: 36px; height: 36px; border-radius: 50%; background: var(--c-card); display: flex; align-items: center; justify-content: center; }
.detail-cover { height: 230px; margin: 0 14px; border-radius: 20px; position: relative; overflow: hidden; }
.detail { padding: 14px; }
.detail h2 { margin: 8px 0 0; font-size: 22px; }
.detail p { color: #4c5563; line-height: 1.6; font-size: 14px; }
.buy {
  position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: #fff;
  box-shadow: 0 -4px 16px rgba(20,23,31,.05);
}
.buy .price { font-size: 20px; }
.btn {
  height: 48px; border-radius: 24px; background: #111318; color: #fff; font-size: 16px; font-weight: 600;
  padding: 0 22px; min-width: 132px;
}
.btn.block { width: 100%; }
.btn.brand { background: var(--c-brand); }
.btn.ghost { background: var(--c-card); color: var(--c-text); border: 1px solid var(--c-line); }
.btn:disabled { opacity: .5; }
.pad { padding: 14px; }
.card { background: var(--c-card); border-radius: 16px; padding: 14px; box-shadow: var(--shadow-card); }
.card + .card { margin-top: 10px; }
.row { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; font-size: 14px; }
.row span { color: var(--c-text-sub); }
.st { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--c-brand-soft); color: var(--c-brand); }
.st.done { background: #e8f8ef; color: #1c9a55; }
.st.cancelled { background: #f3f4f6; color: #8b919c; }
.me-bal { background: linear-gradient(135deg, #2f45c5, #6d7ef0); color: #fff; border-radius: 18px; padding: 18px; }
.me-bal small { opacity: .85; }
.me-bal b { display: block; margin-top: 6px; font-size: 28px; }
.menu { margin-top: 12px; background: #fff; border-radius: 16px; overflow: hidden; }
.menu button, .menu a { width: 100%; text-align: left; padding: 15px 16px; display: flex; justify-content: space-between; border-bottom: 1px solid var(--c-line); font-size: 15px; }
.field { margin-bottom: 10px; }
.field label { display: block; font-size: 12px; color: var(--c-text-sub); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%; height: 46px; border-radius: 12px; border: 0; background: #fff; padding: 0 12px; font-size: 15px;
  box-shadow: inset 0 0 0 1px var(--c-line);
}
.field textarea { height: 80px; padding: 10px 12px; resize: none; }
.addr { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; word-break: break-all; background: var(--c-brand-soft); border-radius: 12px; padding: 12px; }
.empty { text-align: center; color: var(--c-text-sub); padding: 48px 16px; }
.tab {
  position: fixed; left: 50%; transform: translateX(-50%);
  width: min(414px, calc(100% - 16px));
  bottom: calc(8px + env(safe-area-inset-bottom));
  z-index: 20; display: flex; padding: 4px; background: var(--c-card);
  border-radius: 24px; box-shadow: 0 6px 20px #14171f1a;
}
.tab[hidden] { display: none; }
.tab button { flex: 1; display: flex; justify-content: center; color: #6b6b6b; background: none; }
.pill { width: 52px; height: 48px; border-radius: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; font-weight: 600; }
.tab button.on { color: #fff; }
.tab button.on .pill { background: var(--c-brand); }
.mask { position: fixed; inset: 0; background: #10131a73; z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.mask[hidden] { display: none; }
.sheet {
  width: min(430px, 100%); background: #f6f7f9; border-radius: 20px 20px 0 0;
  padding: 16px 14px calc(16px + env(safe-area-inset-bottom)); max-height: 86vh; overflow: auto;
}
.sheet h3 { margin: 4px 0 12px; text-align: center; font-size: 18px; }
.grp { font-size: 13px; color: var(--c-text-sub); margin: 8px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: #fff; border-radius: 999px; padding: 8px 12px; font-size: 13px; }
.chip.on { background: var(--c-brand); color: #fff; }
.err { color: var(--c-price); font-size: 13px; min-height: 18px; margin: 4px 0 8px; }
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: #14171f; color: #fff; border-radius: 999px; padding: 10px 16px; font-size: 13px; z-index: 70;
}
