/* H5 应用共用样式。每个应用在自己的 <style> 里覆盖 :root 变量即可换主题。 */
:root {
  --c1: #333; --c1-soft: color-mix(in srgb, var(--c1) 12%, #fff); --accent: var(--c1);
  --bg: #f5f6f8; --card: #fff; --ink: #1a1a1a; --sub: #8a8f99; --line: rgba(0,0,0,.07);
  --price: #ff4d2e; --on-c1: #fff; --radius: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --w: 480px;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
ul, ol { list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; border: 0; background: none; outline: none; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; cursor: pointer; }
img { display: block; max-width: 100%; }
html { background: #e7e9ed; }
body {
  font-family: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", "Segoe UI Emoji", sans-serif;
  font-size: 14px; line-height: 1.45; color: var(--ink); -webkit-font-smoothing: antialiased;
  max-width: var(--w); margin: 0 auto; min-height: 100vh; background: var(--bg);
  box-shadow: 0 0 40px rgba(0,0,0,.06);
}
#app { min-height: 100vh; }
.serif { font-family: "Noto Serif SC", "Songti SC", serif; }
.emoji { font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif; font-style: normal; line-height: 1; }
svg.i { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; display: inline-block; vertical-align: -.125em; }

/* ---------- 顶栏 ---------- */
.hd { position: sticky; top: 0; z-index: 40; height: 48px; display: flex; align-items: center; padding: 0 8px; background: var(--bg); transition: background .2s, box-shadow .2s; }
.hd h1 { position: absolute; left: 60px; right: 60px; text-align: center; font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.hd-l { flex: 1; display: flex; align-items: center; padding-left: 8px; font-weight: 800; font-size: 18px; min-width: 0; }
.hd-b { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.hd-r { margin-left: auto; display: flex; align-items: center; gap: 4px; padding-right: 4px; position: relative; z-index: 1; }
.hd-r .txt { width: auto !important; padding: 0 8px; font-size: 14px !important; border-radius: 0 !important; }
.hd-r button, .hd-r a { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 20px; position: relative; }
.tr-head .hd { position: fixed; left: 0; right: 0; max-width: var(--w); margin: 0 auto; background: transparent; color: #fff; }
.tr-head .hd .hd-b, .tr-head .hd .hd-r > * { background: rgba(0,0,0,.28); backdrop-filter: blur(8px); color: #fff; }
.tr-head .hd h1 { opacity: 0; }
.tr-head.scrolled .hd { background: var(--card); color: var(--ink); box-shadow: 0 1px 0 var(--line); }
.tr-head.scrolled .hd h1 { opacity: 1; }
.tr-head.scrolled .hd .hd-b, .tr-head.scrolled .hd .hd-r > * { background: transparent; color: var(--ink); }
.pg { padding-bottom: 24px; }
.has-tab .pg { padding-bottom: calc(80px + var(--safe-b)); }
.has-bar .pg { padding-bottom: calc(92px + var(--safe-b)); }
.has-tab.has-bar .pg { padding-bottom: calc(150px + var(--safe-b)); }
.has-tab .bar { bottom: calc(56px + var(--safe-b)); min-height: 60px; padding-bottom: 10px; border-bottom: .5px solid var(--line); }

/* ---------- 底部标签栏 / 操作栏 ---------- */
.tabbar, .bar { position: fixed; left: 0; right: 0; bottom: 0; max-width: var(--w); margin: 0 auto; z-index: 45; }
.tabbar { height: calc(56px + var(--safe-b)); padding-bottom: var(--safe-b); display: flex; background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: blur(12px); border-top: .5px solid var(--line); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--sub); font-weight: 500; }
.tabbar .ti { position: relative; font-size: 24px; line-height: 1; display: flex; }
.tabbar .ti svg { stroke-width: 1.8; }
.tabbar a.on { color: var(--c1); font-weight: 700; }
.tabbar a.on svg { stroke-width: 2.2; }
.bar { min-height: calc(64px + var(--safe-b)); padding: 10px 14px calc(10px + var(--safe-b)); display: flex; align-items: center; gap: 10px; background: var(--card); box-shadow: 0 -6px 20px rgba(0,0,0,.06); }
.bar .ico-btn { display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 10px; color: var(--sub); min-width: 38px; position: relative; }
.bar .ico-btn svg { font-size: 22px; stroke-width: 1.8; color: var(--ink); }

/* ---------- 弹层 / 提示 ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 90; max-width: var(--w); margin: 0 auto; }
.sheet-mask { position: absolute; inset: 0; background: rgba(0,0,0,.45); opacity: 0; transition: opacity .2s; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 86vh; overflow: auto; background: var(--card); border-radius: 18px 18px 0 0; padding: 18px 16px calc(16px + var(--safe-b)); transform: translateY(100%); transition: transform .22s ease; }
.sheet.center { left: 32px; right: 32px; bottom: auto; top: 50%; border-radius: 16px; transform: translateY(-40%); opacity: 0; transition: transform .2s, opacity .2s; padding: 22px 18px 18px; }
.sheet-wrap.show .sheet-mask { opacity: 1; }
.sheet-wrap.show .sheet { transform: none; }
.sheet-wrap.show .sheet.center { transform: translateY(-50%); opacity: 1; }
.sheet-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.sheet-h h3 { font-size: 17px; }
.sheet-x { width: 30px; height: 30px; border-radius: 50%; background: rgba(0,0,0,.05); display: flex; align-items: center; justify-content: center; font-size: 16px; }
.dlg p { font-size: 15px; text-align: center; line-height: 1.6; }
.toast { position: fixed; left: 50%; top: 45%; transform: translate(-50%, -50%) scale(.9); z-index: 100; padding: 11px 18px; border-radius: 12px; background: rgba(20,20,20,.86); color: #fff; font-size: 14px; max-width: 80vw; text-align: center; opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; }
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ---------- 布局工具 ---------- */
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.between { justify-content: space-between; }
.center { justify-content: center; }
.wrap { flex-wrap: wrap; }
.f1 { flex: 1; min-width: 0; }
.g4 { gap: 4px; } .g6 { gap: 6px; } .g8 { gap: 8px; } .g10 { gap: 10px; } .g12 { gap: 12px; } .g16 { gap: 16px; }
.px { padding-left: 16px; padding-right: 16px; }
.mx { margin-left: 14px; margin-right: 14px; }
.mt4 { margin-top: 4px; } .mt6 { margin-top: 6px; } .mt8 { margin-top: 8px; } .mt10 { margin-top: 10px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mt20 { margin-top: 20px; } .mt24 { margin-top: 24px; }
.fs10 { font-size: 10px; } .fs11 { font-size: 11px; } .fs12 { font-size: 12px; } .fs13 { font-size: 13px; } .fs15 { font-size: 15px; } .fs16 { font-size: 16px; } .fs17 { font-size: 17px; } .fs18 { font-size: 18px; } .fs20 { font-size: 20px; } .fs22 { font-size: 22px; } .fs24 { font-size: 24px; } .fs28 { font-size: 28px; } .fs32 { font-size: 32px; }
.b { font-weight: 700; } .b9 { font-weight: 900; } .m { font-weight: 500; }
.sub { color: var(--sub); } .c1 { color: var(--c1); } .acc { color: var(--accent); } .white { color: #fff; } .red { color: var(--price); }
.tc { text-align: center; } .tr { text-align: right; }
.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ell2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lh1 { line-height: 1; }
.num { font-family: "DIN Alternate", "Bahnschrift", "Segoe UI", sans-serif; font-weight: 700; letter-spacing: -.2px; }
.hide { display: none !important; }

/* ---------- 组件 ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 14px; }
.shadow { box-shadow: 0 4px 16px rgba(0,0,0,.05); }
.price { color: var(--price); font-weight: 700; font-family: "DIN Alternate", "Bahnschrift", sans-serif; }
.price::before { content: "¥"; font-size: .7em; margin-right: 1px; }
.del { color: var(--sub); text-decoration: line-through; font-size: 11px; }
.tag { display: inline-flex; align-items: center; height: 18px; padding: 0 5px; font-size: 10px; border-radius: 4px; font-weight: 600; line-height: 1; white-space: nowrap; vertical-align: middle; }
.tag.o { border: 1px solid currentColor; }
.tag.s { background: var(--c1-soft); color: var(--c1); }
.tag.hot { background: #ffece8; color: #ff4d2e; }
.tag.gray { background: rgba(0,0,0,.05); color: var(--sub); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 44px; padding: 0 22px; border-radius: 22px; font-size: 15px; font-weight: 700; background: var(--c1); color: var(--on-c1); white-space: nowrap; transition: transform .1s, opacity .15s; }
.btn:active { transform: scale(.97); }
.btn.sm { height: 28px; padding: 0 12px; font-size: 12px; border-radius: 14px; }
.btn.md { height: 36px; padding: 0 16px; font-size: 14px; border-radius: 18px; }
.btn.ghost { background: transparent; color: var(--c1); box-shadow: inset 0 0 0 1px var(--c1); }
.btn.soft { background: var(--c1-soft); color: var(--c1); }
.btn.gray { background: rgba(0,0,0,.05); color: var(--ink); }
.btn.block { display: flex; width: 100%; }
.btn[disabled], .btn.disabled { opacity: .4; pointer-events: none; }
.btn.round { width: 26px; height: 26px; padding: 0; border-radius: 50%; font-size: 15px; }
.stepper { display: inline-flex; align-items: center; gap: 10px; }
.stepper b { min-width: 14px; text-align: center; font-size: 14px; }
.search { height: 38px; border-radius: 19px; display: flex; align-items: center; gap: 6px; padding: 0 14px; background: var(--card); color: var(--sub); font-size: 14px; }
.search input { flex: 1; min-width: 0; color: var(--ink); height: 100%; }
.search input::placeholder { color: var(--sub); }
.pic { position: relative; overflow: hidden; border-radius: 10px; background: #e9e6e1; flex: none; isolation: isolate; }
.pic > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pic > :not(img) { position: absolute; z-index: 1; }
.pic.shade::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,.6)); }
.av { border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; overflow: hidden; color: #fff; font-weight: 700; background: linear-gradient(145deg, var(--g1, #bbb), var(--g2, #888)); position: relative; }
.av img { width: 100%; height: 100%; object-fit: cover; }
.sec { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 16px 10px; }
.sec h3 { font-size: 17px; font-weight: 800; }
.sec .more { font-size: 12px; color: var(--sub); display: flex; align-items: center; }
.icons { display: grid; grid-template-columns: repeat(5, 1fr); row-gap: 14px; }
.icons.c4 { grid-template-columns: repeat(4, 1fr); }
.icons li, .icons a { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; }
.icons .ic { width: 46px; height: 46px; border-radius: 15px; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.stars { color: #ffb400; font-size: 11px; letter-spacing: -1px; }
.hr { height: .5px; background: var(--line); }
.badge-n { position: absolute; top: -4px; right: -8px; min-width: 16px; height: 16px; border-radius: 8px; background: #ff3b30; color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; border: 1.5px solid var(--card); font-style: normal; line-height: 1; }
.seg { display: flex; background: rgba(0,0,0,.05); border-radius: 18px; padding: 3px; }
.seg button { flex: 1; height: 30px; border-radius: 15px; font-size: 13px; font-weight: 600; color: var(--sub); }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.tabs { display: flex; gap: 22px; padding: 0 16px; font-size: 15px; color: var(--sub); font-weight: 500; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
.tabs::-webkit-scrollbar, .hscroll::-webkit-scrollbar { display: none; }
.tabs button { position: relative; padding: 8px 0; color: inherit; font-weight: inherit; flex: none; }
.tabs button.on { color: var(--ink); font-weight: 800; }
.tabs button.on::after { content: ""; position: absolute; left: 50%; bottom: 2px; width: 18px; height: 3px; margin-left: -9px; border-radius: 2px; background: var(--c1); }
.hscroll { display: flex; gap: 10px; overflow-x: auto; scrollbar-width: none; padding: 0 16px; }
.hscroll > * { flex: none; }
.chip { height: 32px; padding: 0 14px; border-radius: 16px; background: var(--card); font-size: 13px; display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--sub); box-shadow: inset 0 0 0 1px var(--line); white-space: nowrap; }
.chip.on { background: var(--c1-soft); color: var(--c1); box-shadow: inset 0 0 0 1.5px var(--c1); }
.prog { height: 6px; border-radius: 3px; background: rgba(0,0,0,.07); overflow: hidden; }
.prog i { display: block; height: 100%; border-radius: 3px; background: var(--c1); transition: width .3s; }
.kv { display: flex; align-items: center; padding: 14px 0; font-size: 14px; gap: 10px; }
.kv + .kv { border-top: .5px solid var(--line); }
.kv .k { width: 76px; color: var(--sub); flex: none; }
.field { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: .5px solid var(--line); }
.field label { width: 76px; color: var(--sub); flex: none; }
.field input, .field textarea, .field select { flex: 1; min-width: 0; font-size: 14px; }
.field textarea { resize: none; height: 60px; }
.radio { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #cfd3db; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.radio.on { border: 6px solid var(--c1); }
.ck { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #cfd3db; flex: none; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; }
.ck.on { background: var(--c1); border-color: var(--c1); }
.switch { width: 46px; height: 28px; border-radius: 14px; background: #d9dce2; position: relative; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; left: 2px; top: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.15); transition: left .2s; }
.switch.on { background: var(--c1); }
.switch.on::after { left: 20px; }
.empty { padding: 60px 20px; text-align: center; color: var(--sub); }
.empty .emoji { font-size: 48px; display: block; margin-bottom: 12px; }
.steps { display: flex; align-items: flex-start; }
.steps .st { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11px; color: var(--sub); width: 56px; flex: none; }
.steps .st i { width: 22px; height: 22px; border-radius: 50%; background: #e3e5ea; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; font-style: normal; }
.steps .st.done i, .steps .st.cur i { background: var(--c1); }
.steps .st.cur { color: var(--c1); font-weight: 700; }
.steps .st.cur i { box-shadow: 0 0 0 5px var(--c1-soft); }
.steps .ln { flex: 1; height: 2px; background: #e3e5ea; margin-top: 10px; }
.steps .ln.done { background: var(--c1); }
.list-item { display: flex; align-items: center; gap: 12px; padding: 14px 0; }
.list-item + .list-item { border-top: .5px solid var(--line); }
.status { font-size: 13px; font-weight: 700; color: var(--c1); }
.fab-dot { width: 8px; height: 8px; border-radius: 4px; background: var(--c1); display: inline-block; }
.cd { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 700; }
.cd b { min-width: 22px; height: 22px; padding: 0 3px; border-radius: 6px; background: #1c1c1c; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-family: Bahnschrift, sans-serif; font-weight: 600; }
.qr { background: #fff; padding: 12px; border-radius: 14px; display: inline-block; }
.reset-link { display: block; text-align: center; color: var(--sub); font-size: 12px; padding: 24px 0 8px; }

/* Connected demo status and merchant operating tools. */
.sync-notice{padding:8px 14px;font-size:11px;line-height:1.5;background:#edf3ed;color:#466350}.sync-notice.warning{background:#fff0db;color:#885717}.sync-notice button{margin-left:8px;text-decoration:underline;color:inherit}.merchant-toolbar{display:flex;gap:8px;flex-wrap:wrap;margin:12px 14px}.merchant-toolbar .btn{flex:1;min-width:120px}.merchant-filters{display:grid;grid-template-columns:1fr 1fr;gap:10px}.merchant-filters label{font-size:12px}.merchant-filters input,.merchant-filters select{display:block;width:100%;min-width:0;padding:10px 8px;margin-top:5px;border:1px solid var(--line);border-radius:8px;background:var(--bg);color:var(--ink);font-size:13px}.merchant-metrics{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:20px 0}.merchant-metrics small{display:block;color:var(--sub);font-size:12px}.merchant-metrics b{display:block;color:var(--c1);font-size:22px;margin-top:6px}.merchant-columns{display:grid;gap:14px;margin:14px}.merchant-stage{border:1px solid var(--line);border-radius:12px;padding:12px;background:var(--bg)}.merchant-stage h3{font-size:14px}.merchant-stage .card{background:#fff}.merchant-stage p{font-size:12px}.merchant-stage .empty{padding:18px;font-size:12px}.merchant-event{padding:14px 0;border-bottom:1px solid var(--line);font-size:12px;overflow-wrap:anywhere}.merchant-event small{color:var(--sub)}.merchant-error{padding:12px 14px;background:#fff0db;color:#885717;font-size:12px;line-height:1.6}.merchant-error button{margin-left:8px;text-decoration:underline}@media(min-width:700px){.merchant-columns{grid-template-columns:repeat(2,minmax(0,1fr))}}
