/* app.css — 今天吃什么 · 菜签版 生产 H5。三主题换肤 + 杂志签卡 + 组件 + 弹层。 */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: #d9d4ca;
  font-family: -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
:root {
  --font-smiley: 'Smiley Sans Oblique', 'Smiley Sans', sans-serif;
  --font-hero: 'General Sans', 'Geist', system-ui, sans-serif;
  --font-serif: 'Source Serif 4', Georgia, serif;
  --font-mono: 'Geist Mono', 'SF Mono', monospace;
  --font-num: 'Outfit', sans-serif;
}

/* ---------- 三主题(按性别换肤)---------- */
#app[data-theme="female"] { --bg:#FFF6EC; --surface:#fff; --text:#1A1A1A; --muted:#6B6B6B; --accent:#FF5C8A; --accent2:#5FD0C5; --accent3:#FFD23F; --highlight:#FFE08A; --border:#FFD9C2; --on-accent:#fff; --hl-ink:#1A1A1A; }
#app[data-theme="male"] { --bg:#0E0E10; --surface:#1C1C22; --text:#F2F2F0; --muted:#A8A8B0; --accent:#C6FF2E; --accent2:#C6FF2E; --accent3:#C6FF2E; --highlight:#C6FF2E; --border:#2A2A2E; --on-accent:#0E0E10; --hl-ink:#0E0E10; }
#app[data-theme="neutral"] { --bg:#F5F3EE; --surface:#fff; --text:#1F1F1C; --muted:#6E6E68; --accent:#FF7A4D; --accent2:#FF7A4D; --accent3:#FF7A4D; --highlight:#FFD9B0; --border:#E6E1D6; --on-accent:#fff; --hl-ink:#1F1F1C; }

/* ---------- 外壳:手机竖屏 ---------- */
#app {
  max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; position: relative; overflow: hidden;
  background: var(--bg); color: var(--text);
}
.noscroll::-webkit-scrollbar { width: 0; height: 0; }
.noscroll { scrollbar-width: none; }
.hidden { display: none !important; }

/* ---------- 通用组件 ---------- */
.brandbar { flex: none; display: flex; align-items: center; justify-content: center; padding: 38px 20px 12px; background: var(--bg); }
.brandbar .wm { font-family: var(--font-smiley); font-size: 19px; color: var(--text); }
.stage { flex: 1; overflow: auto; min-height: 0; }
.pad { padding: 8px 20px 28px; }

.pill { width: 100%; height: 54px; border: none; border-radius: 9999px; background: var(--accent); color: var(--on-accent); font-family: var(--font-smiley); font-size: 18px; cursor: pointer; transition: transform .08s; }
.pill:active { transform: scale(.98); }
.ghost { border-radius: 9999px; border: 2px solid var(--border); background: var(--surface); color: var(--text); font-size: 15px; font-weight: 600; cursor: pointer; transition: transform .08s; }
.ghost:active { transform: scale(.98); }
.chip { padding: 9px 16px; border-radius: 9999px; font-size: 14px; cursor: pointer; transition: all .15s ease; white-space: nowrap; background: var(--surface); color: var(--muted); border: 2px solid var(--border); }
.chip.on { background: var(--accent); color: var(--on-accent); font-weight: 700; border-color: var(--accent); }
.opt { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-radius: 16px; font-size: 16px; cursor: pointer; transition: all .15s; background: var(--surface); color: var(--text); border: 2px solid var(--border); }
.opt.on { background: var(--accent); color: var(--on-accent); font-weight: 700; border-color: var(--accent); }
.opt:active { transform: scale(.985); }
.inp { width: 100%; padding: 14px 16px; border-radius: 16px; border: 2px solid var(--border); background: var(--surface); color: var(--text); font-size: 15px; outline: none; }
.inp:focus { border-color: var(--accent); }
.flabel { font-size: 14px; font-weight: 600; color: var(--text); }
.star { font-size: 21px; cursor: pointer; line-height: 1; }
.muted { color: var(--muted); }
.req { color: var(--accent); }

/* ---------- onboarding ---------- */
.ob { display: flex; flex-direction: column; height: 100%; min-height: 0; padding: 50px 22px 28px; }
.ob-top { display: flex; align-items: center; justify-content: space-between; }
.ob-top .l { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); }
.ob-top .lk { cursor: pointer; }
.ob-top .lk:active { opacity: .5; }
.bar { margin-top: 12px; height: 6px; border-radius: 9999px; background: var(--border); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 9999px; transition: width .4s cubic-bezier(.16,1,.3,1); }
.q { margin-top: 30px; font-family: var(--font-smiley); font-size: 27px; line-height: 1.25; color: var(--text); }
.q-sub { margin-top: 9px; font-size: 13.5px; color: var(--muted); }
.opts { margin-top: 24px; display: flex; flex-direction: column; gap: 11px; overflow: auto; flex: 1; min-height: 0; }
.ob-tip { margin-top: 14px; text-align: center; font-size: 12px; color: var(--muted); }

/* ---------- 可晒卡(签卡 / 人格卡)---------- */
.card { width: 100%; position: relative; border-radius: 20px; overflow: hidden; padding: 22px 20px 18px; background: var(--surface); color: var(--text); box-shadow: 0 18px 44px -22px rgba(0,0,0,.45); }
.card .topstrip { position: absolute; top: 0; left: 0; right: 0; height: 7px; background: var(--accent); }
.card .seal { position: absolute; top: 18px; right: 18px; width: 54px; height: 54px; transform: rotate(-7deg); border: 2.5px solid var(--accent); border-radius: 10px; display: grid; grid-template-columns: 1fr 1fr; place-items: center; color: var(--accent); font-family: var(--font-serif); font-weight: 600; font-size: 13px; }
.card .eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; color: var(--muted); }
.card .mealpill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px; border-radius: 9999px; background: var(--highlight); color: var(--hl-ink); font-weight: 600; font-size: 12px; margin-top: 14px; }
.card .mealpill .en { opacity: .6; font-family: var(--font-mono); letter-spacing: .14em; font-size: 10px; }
.card .dish { margin-top: 14px; font-family: var(--font-hero); font-weight: 700; font-size: 40px; line-height: 1.02; letter-spacing: -.02em; color: var(--text); }
.card .pname { margin-top: 8px; font-family: var(--font-hero); font-weight: 700; font-size: 29px; line-height: 1.04; letter-spacing: -.01em; color: var(--text); }
.card .label { font-family: var(--font-mono); font-weight: 700; font-size: 10px; letter-spacing: .3em; color: var(--accent); margin-top: 18px; }
.card .qsay { margin: 9px 0 0; font-family: var(--font-serif); font-size: 17px; line-height: 1.62; color: var(--text); }
.card .qsay .hi { background: var(--highlight); color: var(--hl-ink); padding: 0 .14em; border-radius: 3px; }
.card .yiji { margin-top: 18px; display: flex; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.card .yiji > div { flex: 1; padding: 12px 2px; }
.card .yiji .k { font-family: var(--font-mono); font-weight: 700; font-size: 10px; letter-spacing: .2em; margin-bottom: 5px; }
.card .yiji .v { font-family: var(--font-serif); font-size: 15px; }
.card .yiji .vline { width: 1px; background: var(--border); flex: none; padding: 0; }
.card .tagline { margin-top: 9px; font-family: var(--font-serif); font-size: 15px; color: var(--muted); }
.card .bar2 { margin-top: 16px; }
.card .bar2 .row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.card .bar2 .bk { font-family: var(--font-mono); font-size: 10px; letter-spacing: .16em; color: var(--muted); }
.card .bar2 .bv { font-family: var(--font-mono); font-weight: 700; font-size: 11px; color: var(--accent); }
.card .bar2 .track { position: relative; height: 6px; border-radius: 3px; background: var(--border); }
.card .bar2 .dot { position: absolute; top: 50%; transform: translate(-50%,-50%); width: 13px; height: 13px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--surface); }
.card .bar2 .ends { display: flex; justify-content: space-between; margin-top: 6px; font-family: var(--font-mono); font-size: 9px; letter-spacing: .08em; color: var(--muted); }
.card .chips-mini { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 6px; }
.card .chips-mini > span { padding: 5px 11px; border-radius: 9999px; background: var(--highlight); color: var(--hl-ink); font-size: 12px; }
.card .signrow { margin-top: 18px; display: flex; gap: 9px; }
.card .signrow button { flex: 1; height: 46px; border-radius: 9999px; border: 1.5px solid var(--border); background: transparent; color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; }
.card .jumpline { margin-top: 14px; font-size: 11.5px; color: var(--muted); }
.card .jumps { margin-top: 9px; display: flex; gap: 8px; }
.card .jumps > div { flex: 1; text-align: center; padding: 11px 0; border-radius: 12px; border: 1.5px solid var(--border); color: var(--text); font-size: 13px; font-weight: 600; cursor: pointer; }
.card .divtop { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }

.actions { display: flex; gap: 10px; margin-top: 14px; }
.actions button { height: 52px; }

/* ---------- 历史店横幅 ---------- */
.histbanner { margin-bottom: 14px; padding: 12px 14px; border-radius: 14px; background: var(--highlight); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.histbanner .t { font-size: 13px; color: var(--hl-ink); line-height: 1.4; }
.histbanner .b { flex: none; font-size: 13px; font-weight: 700; color: var(--hl-ink); text-decoration: underline; cursor: pointer; white-space: nowrap; }

/* ---------- drawing spinner ---------- */
.spin-wrap { padding: 60px 20px; display: flex; flex-direction: column; align-items: center; }
.spin { width: 48px; height: 48px; border-radius: 50%; border: 4px solid var(--border); border-top-color: var(--accent); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 列表卡(附近/群/私聊)---------- */
.lcard { border-radius: 16px; background: var(--surface); border: 2px solid var(--border); padding: 13px 14px; cursor: pointer; display: flex; align-items: center; gap: 12px; }
.lcard:active { opacity: .7; }
.av { width: 46px; height: 46px; border-radius: 50%; background: var(--highlight); color: var(--hl-ink); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; flex: none; background-size: cover; background-position: center; }
.av.sq { border-radius: 14px; }
.lcard .nm { font-weight: 700; font-size: 15px; color: var(--text); }
.lcard .sub { margin-top: 4px; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag-mini { padding: 2px 8px; border-radius: 9999px; background: var(--bg); color: var(--accent); font-size: 10px; font-weight: 600; white-space: nowrap; }
.chev { flex: none; font-size: 18px; color: var(--muted); }
.dashed { width: 100%; height: 48px; border: 2px dashed var(--border); border-radius: 14px; background: transparent; color: var(--accent); font-size: 14px; font-weight: 600; cursor: pointer; }
.empty { margin-top: 50px; text-align: center; font-size: 13px; color: var(--muted); line-height: 1.7; }
.subtabs { margin-top: 16px; display: flex; gap: 9px; }
.col { display: flex; flex-direction: column; gap: 11px; }

/* ---------- 收藏菜品卡 + 店铺编辑 ---------- */
.favitem { border-radius: 18px; background: var(--surface); border: 2px solid var(--border); padding: 16px 16px 14px; }
.favitem .head { cursor: pointer; }
.favitem .dish { font-family: var(--font-smiley); font-size: 21px; color: var(--text); }
.favitem .roast { display: inline-block; padding: 7px 12px; border-radius: 11px; background: var(--highlight); color: var(--hl-ink); font-size: 13px; font-weight: 600; line-height: 1.4; }
.store { border-radius: 13px; background: var(--bg); border: 1.5px solid var(--border); padding: 11px 12px; }
.store .inp2 { padding: 9px 11px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font-size: 13.5px; outline: none; width: 100%; }
.store .inp2:focus { border-color: var(--accent); }
.switch { width: 46px; height: 27px; border-radius: 9999px; position: relative; cursor: pointer; transition: background .2s; flex: none; background: var(--border); }
.switch.on { background: var(--accent); }
.switch > i { position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.switch.on > i { left: 22px; }

/* ---------- 底部 Tab ---------- */
.tabbar { flex: none; display: flex; background: var(--surface); border-top: 1px solid var(--border); padding-bottom: 18px; }
.tabbar > div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0 6px; cursor: pointer; color: var(--muted); }
.tabbar > div.on { color: var(--accent); }
.tabbar .lbl { font-size: 10.5px; font-weight: 600; }

/* ---------- 弹层 ---------- */
.overlay { position: fixed; inset: 0; max-width: 480px; margin: 0 auto; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; z-index: 50; animation: fade .2s; }
.overlay.center { align-items: center; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet { width: 100%; background: var(--surface); border-radius: 22px 22px 0 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); max-height: 88vh; overflow: auto; animation: rise .28s cubic-bezier(.16,1,.3,1); }
.sheet.modal { border-radius: 22px; margin: 0 16px; animation: pop .28s cubic-bezier(.16,1,.3,1); }
@keyframes rise { from { transform: translateY(30px); } to { transform: translateY(0); } }
@keyframes pop { from { transform: scale(.96); opacity: .6; } to { transform: scale(1); opacity: 1; } }
.sheet h3 { margin: 0 0 16px; font-family: var(--font-smiley); font-size: 21px; }
.sheet .field { margin-bottom: 12px; }
.sheet .x { float: right; font-size: 22px; color: var(--muted); cursor: pointer; line-height: 1; }

/* ---------- 聊天 ---------- */
.chat-wrap { position: fixed; inset: 0; max-width: 480px; margin: 0 auto; background: var(--bg); z-index: 60; display: flex; flex-direction: column; }
.chat-head { flex: none; display: flex; align-items: center; gap: 12px; padding: 44px 16px 12px; background: var(--surface); border-bottom: 1px solid var(--border); }
.chat-body { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 76%; padding: 10px 13px; border-radius: 16px; font-size: 14px; line-height: 1.45; word-break: break-word; }
.bubble.me { align-self: flex-end; background: var(--accent); color: var(--on-accent); }
.bubble.them { align-self: flex-start; background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.bubble .who { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.collection-msg { border-radius: 12px; background: var(--bg); border: 1px solid var(--border); padding: 10px; }
.chat-foot { flex: none; display: flex; gap: 8px; padding: 10px 12px calc(16px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%); background: rgba(20,18,15,.92); color: #fff; padding: 11px 18px; border-radius: 12px; font-size: 14px; z-index: 100; animation: toastin .2s; max-width: 88%; text-align: center; }
@keyframes toastin { from { opacity: 0; transform: translate(-50%,8px); } to { opacity: 1; transform: translate(-50%,0); } }

/* ---------- 晒图卡 ---------- */
.saved-qr { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 12px; }
.qr-box { width: 56px; height: 56px; border-radius: 8px; background: var(--bg); border: 1px solid var(--border); display: grid; place-items: center; flex: none; }
