/* =========================================================
   光汇娱乐 H5 —— 单文件样式表
   设计基准 375px；1px 线用 0.5px（hairline）处理
   三套主题全部走 CSS 变量，同一套 DOM
   ========================================================= */

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: var(--fs-body);
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  background-image: var(--bg-image);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}
img { display: block; max-width: 100%; border: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, p { margin: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- 主题变量 ---------- */
:root {
  --fs-title: 22px;
  --fs-body: 14px;
  --fs-sub: 12.5px;
  --fs-btn: 14px;
  --fs-foot: 10.5px;

  --w-title: 800;
  --w-btn: 600;

  --hairline: 0.5px;
  --radius-s: 10px;
  --radius: 14px;
  --radius-l: 20px;
  --tap: 44px;

  --page-pad: 16px;
  --tabbar-h: 60px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

/* neon —— 默认 */
html[data-theme="neon"] {
  --bg: #0B0B13;
  --bg-image: radial-gradient(120% 80% at 50% 0%, #151527 0%, #0B0B13 62%);
  --card: rgba(255, 255, 255, .055);
  --card-solid: #15152a;
  --card-2: rgba(255, 255, 255, .09);
  --text: #F7F7FB;
  --text-2: rgba(247, 247, 251, .62);
  --text-3: rgba(247, 247, 251, .38);
  --line: rgba(255, 255, 255, .10);
  --accent: #7C5CFF;
  --accent-2: #FF5CA8;
  --accent-3: #22D3EE;
  --accent-grad: linear-gradient(100deg, #7C5CFF 0%, #FF5CA8 52%, #22D3EE 100%);
  --on-accent: #fff;
  --price: #FF8FD0;
  --danger: #FF6B6B;
  --ok: #35D6A4;
  --shadow: 0 12px 30px rgba(0, 0, 0, .45);
  --shadow-soft: 0 2px 10px rgba(0, 0, 0, .28);
  --border-style: var(--hairline) solid var(--line);
}

/* light */
html[data-theme="light"] {
  --bg: #EEF1F6;
  --bg-image: none;
  --card: #FFFFFF;
  --card-solid: #FFFFFF;
  --card-2: #F5F7FB;
  --text: #0F172A;
  --text-2: #5A6478;
  --text-3: #93A0B4;
  --line: rgba(15, 23, 42, .10);
  --accent: #10B981;
  --accent-2: #38BDF8;
  --accent-3: #38BDF8;
  --accent-grad: linear-gradient(100deg, #10B981 0%, #38BDF8 100%);
  --on-accent: #fff;
  --price: #0F766E;
  --danger: #E11D48;
  --ok: #059669;
  --shadow: 0 10px 26px rgba(15, 23, 42, .10);
  --shadow-soft: 0 1px 4px rgba(15, 23, 42, .06);
  --border-style: var(--hairline) solid var(--line);
}

/* street */
html[data-theme="street"] {
  --bg: #0E0E12;
  --bg-image: radial-gradient(100% 60% at 0% 0%, #1A1A22 0%, #0E0E12 60%);
  --card: #15151C;
  --card-solid: #15151C;
  --card-2: #1D1D26;
  --text: #FFFFFF;
  --text-2: rgba(255, 255, 255, .66);
  --text-3: rgba(255, 255, 255, .40);
  --line: rgba(255, 255, 255, .16);
  --accent: #DFFF3F;
  --accent-2: #7C4DFF;
  --accent-3: #DFFF3F;
  --accent-grad: linear-gradient(100deg, #DFFF3F 0%, #B9FF2E 60%, #7C4DFF 100%);
  --on-accent: #0E0E12;
  --price: #DFFF3F;
  --danger: #FF5E5E;
  --ok: #DFFF3F;
  --shadow: 6px 6px 0 rgba(0, 0, 0, .9);
  --shadow-soft: 3px 3px 0 rgba(0, 0, 0, .9);
  --border-style: 1.5px solid var(--line);
}

/* ---------- 布局 ---------- */
.app { min-height: 100vh; padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 28px); }
.page { padding: 0 var(--page-pad); }
.page-head {
  display: flex; align-items: center; gap: 10px;
  height: 52px; position: sticky; top: 0; z-index: 20;
  background: var(--bg); background-image: var(--bg-image);
  margin: 0 calc(-1 * var(--page-pad)); padding: 0 var(--page-pad);
}
.page-title { font-size: var(--fs-title); font-weight: var(--w-title); letter-spacing: -.02em; flex: 1; }
.back-btn {
  width: var(--tap); height: var(--tap); display: grid; place-items: center;
  margin-left: -8px; border-radius: 50%; font-size: 20px;
}
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.foot { font-size: var(--fs-foot); color: var(--text-3); }
.mono { font-variant-numeric: tabular-nums; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.center { text-align: center; }

/* ---------- 卡片 / 按钮 ---------- */
.card {
  background: var(--card);
  border: var(--border-style);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-soft);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
html[data-theme="light"] .card { -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: var(--shadow-soft); }

.btn {
  min-height: var(--tap); padding: 0 18px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font-size: var(--fs-btn); font-weight: var(--w-btn);
  border: var(--border-style); background: var(--card-2); color: var(--text);
  transition: transform .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(.97); opacity: .9; }
.btn-primary { background-image: var(--accent-grad); border: 0; color: var(--on-accent); }
html[data-theme="street"] .btn-primary { color: #0E0E12; }
.btn-block { width: 100%; }
.btn-sm { min-height: 34px; padding: 0 14px; font-size: var(--fs-sub); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-ghost { background: transparent; }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: var(--card-solid);
  border-top: var(--border-style);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: var(--fs-foot); color: var(--text-3); min-width: var(--tap);
}
.tabbar a.on { color: var(--accent); font-weight: 600; }
.tabbar .ico { font-size: 18px; line-height: 1; }

/* ---------- 悬浮购物车条 ---------- */
.cartbar {
  position: fixed; left: 12px; right: 12px; z-index: 45;
  bottom: calc(var(--tabbar-h) + var(--safe-b) + 10px);
  display: none; align-items: center; gap: 12px;
  min-height: 52px; padding: 8px 10px 8px 14px;
  border-radius: 999px; background: var(--card-solid);
  border: var(--border-style); box-shadow: var(--shadow);
}
.cartbar.show { display: flex; animation: cartin .22s cubic-bezier(.2,.8,.2,1); }
@keyframes cartin { from { transform: translateY(24px); opacity: .5 } to { transform: none; opacity: 1 } }
.cartbar .sum { flex: 1; min-width: 0; }
.cartbar .num { font-size: 17px; font-weight: 700; color: var(--price); }
.cartbar .txt { font-size: var(--fs-foot); color: var(--text-3); }
.cart-badge {
  position: absolute; top: -6px; left: 34px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px;
  display: grid; place-items: center;
}

/* ---------- 落地页 ---------- */
.hero { padding: 34px 0 18px; }
.hero .brand { font-size: 30px; font-weight: 800; letter-spacing: .04em; }
.hero .slogan { margin-top: 6px; color: var(--text-2); font-size: var(--fs-sub); }
.hero-card {
  margin-top: 18px; border-radius: var(--radius-l); overflow: hidden;
  background-image: var(--accent-grad); color: var(--on-accent);
  padding: 22px 18px; box-shadow: var(--shadow);
}
html[data-theme="street"] .hero-card { color: #0E0E12; }
.hero-card h2 { font-size: 20px; font-weight: 800; }
.hero-card p { margin-top: 6px; opacity: .85; font-size: var(--fs-sub); }
.hero-actions { margin-top: 18px; display: flex; gap: 10px; }
.hero-actions .btn { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.3); color: inherit; }
html[data-theme="light"] .hero-actions .btn { background: #fff; border: 0; color: #0F172A; }

/* ---------- 点单页 ---------- */
.menu-wrap { display: flex; gap: 10px; align-items: flex-start; }
.cats {
  position: sticky; top: 52px; flex: 0 0 88px; width: 88px;
  display: flex; flex-direction: column; gap: 4px;
  max-height: calc(100vh - 190px); overflow-y: auto;
  padding: 6px 0 60px; scrollbar-width: none;
}
.cats::-webkit-scrollbar { display: none; }
.cat-item {
  min-height: var(--tap); display: flex; align-items: center;
  padding: 0 10px; border-radius: var(--radius-s);
  font-size: var(--fs-sub); color: var(--text-2); line-height: 1.2;
}
.cat-item.on { background: var(--card-2); color: var(--text); font-weight: 600; }
html[data-theme="neon"] .cat-item.on { background-image: var(--accent-grad); color: #fff; }
html[data-theme="street"] .cat-item.on { background: var(--accent); color: #0E0E12; }

.goods-list { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; padding-bottom: 80px; }
.goods-item {
  display: flex; gap: 10px; padding: 10px; border-radius: var(--radius);
  background: var(--card); border: var(--border-style);
}
.goods-item .thumb {
  width: 84px; height: 84px; flex: 0 0 84px; border-radius: var(--radius-s);
  background: var(--card-2); object-fit: cover;
}
.goods-item .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.goods-item .nm { font-weight: 600; font-size: 15px; }
.goods-item .bf { font-size: var(--fs-foot); color: var(--text-3); }
.goods-item .bt { margin-top: auto; display: flex; align-items: flex-end; gap: 6px; }
.price { color: var(--price); font-weight: 700; font-size: 16px; }
.price .cur { font-size: 11px; margin-right: 1px; }
.price-old { color: var(--text-3); text-decoration: line-through; font-size: var(--fs-foot); }
.add-btn {
  margin-left: auto; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-size: 20px; line-height: 1;
  background-image: var(--accent-grad); color: var(--on-accent);
}
html[data-theme="street"] .add-btn { color: #0E0E12; }
.soldout-tag { font-size: var(--fs-foot); color: var(--text-3); border: var(--border-style); padding: 1px 8px; border-radius: 999px; }

/* ---------- 商品详情 ---------- */
.detail-hero { margin: 0 calc(-1 * var(--page-pad)); height: 240px; background: var(--card-2); }
.detail-hero img { width: 100%; height: 100%; object-fit: cover; }
.detail-name { margin-top: 14px; font-size: 20px; font-weight: 800; }
.spec-group { margin-top: 14px; }
.spec-title { font-size: var(--fs-sub); color: var(--text-2); margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 36px; padding: 0 14px; border-radius: 999px; display: inline-flex; align-items: center;
  border: var(--border-style); background: var(--card); font-size: var(--fs-sub); color: var(--text-2);
}
.chip.on { color: var(--text); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.qty {
  display: inline-flex; align-items: center; gap: 2px; border: var(--border-style); border-radius: 999px;
}
.qty button { width: 34px; height: 34px; font-size: 18px; display: grid; place-items: center; }
.qty span { min-width: 28px; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- 购物车 ---------- */
.cart-line { display: flex; gap: 10px; padding: 12px 0; border-bottom: var(--border-style); }
.cart-line:last-child { border-bottom: 0; }
.cart-thumb { width: 56px; height: 56px; border-radius: var(--radius-s); object-fit: cover; background: var(--card-2); }
.cart-meta { font-size: var(--fs-foot); color: var(--text-3); margin-top: 2px; }

/* ---------- 表单 ---------- */
.field { margin-top: 14px; }
.field label { display: block; font-size: var(--fs-sub); color: var(--text-2); margin-bottom: 6px; }
.input, .textarea, .select {
  width: 100%; min-height: var(--tap); padding: 11px 12px;
  border-radius: var(--radius-s); border: var(--border-style);
  background: var(--card); color: var(--text); font-size: var(--fs-body);
  -webkit-appearance: none; appearance: none;
}
.textarea { min-height: 88px; resize: vertical; }
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); }
.input[readonly] { color: var(--text-2); background: var(--card-2); }
.form-hint { margin-top: 6px; font-size: var(--fs-foot); color: var(--text-3); }

/* ---------- 底部结算条 ---------- */
.paybar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: flex; align-items: center; gap: 12px;
  padding: 10px var(--page-pad) calc(10px + var(--safe-b));
  background: var(--card-solid); border-top: var(--border-style);
}
.paybar .total { flex: 1; }
.paybar .total .num { font-size: 20px; font-weight: 800; color: var(--price); }

/* ---------- 列表 / 订单 ---------- */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { min-height: 34px; padding: 0 14px; border-radius: 999px; border: var(--border-style); font-size: var(--fs-sub); color: var(--text-2); white-space: nowrap; }
.tab.on { background-image: var(--accent-grad); border: 0; color: var(--on-accent); }
html[data-theme="street"] .tab.on { color: #0E0E12; }

.order-card { display: block; }
.order-card .top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.status-tag { font-size: var(--fs-foot); padding: 2px 8px; border-radius: 999px; border: var(--border-style); color: var(--text-2); }
.status-0 { color: #FFB020; border-color: rgba(255,176,32,.5); }
.status-1 { color: var(--ok); border-color: currentColor; }
.status-3 { color: var(--text-3); }

.timeline { margin-top: 14px; padding-left: 14px; border-left: var(--hairline) solid var(--line); }
.timeline li { position: relative; padding: 0 0 14px 12px; font-size: var(--fs-sub); color: var(--text-2); }
.timeline li::before {
  content: ""; position: absolute; left: -19px; top: 6px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 3px var(--card);
}

/* ---------- 取餐码 ---------- */
.pickup { text-align: center; padding: 26px 0 10px; }
.pickup .code {
  font-size: 64px; font-weight: 800; letter-spacing: .1em; line-height: 1.1;
  background-image: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.pickup .lbl { color: var(--text-2); font-size: var(--fs-sub); margin-top: 4px; }

/* ---------- 推广码 ---------- */
.promo-grid { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.promo-card {
  position: relative; border-radius: 18px; overflow: hidden;
  aspect-ratio: 730 / 356; display: flex; padding: 18px; gap: 16px;
  box-shadow: var(--shadow);
  background: var(--pc-bg, #101020); color: var(--pc-fg, #fff);
}
.promo-card .left { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; }
.promo-card .pc-name { font-size: 20px; font-weight: 800; letter-spacing: .02em; }
.promo-card .pc-tag { font-size: var(--fs-foot); opacity: .78; }
.promo-card .pc-qr { width: 42%; max-width: 168px; aspect-ratio: 1; background: #fff; border-radius: 10px; padding: 8px; align-self: center; }
.promo-card .pc-qr img { width: 100%; height: 100%; }
@media (max-width: 620px) {
  .promo-grid { gap: 12px; }
}
.promo-tip { margin-top: 10px; font-size: var(--fs-foot); color: var(--text-3); line-height: 1.6; }

/* ---------- 空状态 / 骨架 ---------- */
.empty { padding: 56px 20px; text-align: center; color: var(--text-3); }
.empty .ico { font-size: 34px; margin-bottom: 10px; }
.skeleton { background: var(--card-2); border-radius: var(--radius); min-height: 84px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: .55 } 50% { opacity: .9 } }
.err-box { margin-top: 12px; padding: 14px; border-radius: var(--radius); border: var(--hairline) solid var(--danger); color: var(--text-2); }

/* ---------- toast / sheet ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + 78px);
  transform: translateX(-50%); z-index: 90; max-width: 80vw;
  padding: 10px 16px; border-radius: 999px; background: rgba(0,0,0,.82); color: #fff;
  font-size: var(--fs-sub); box-shadow: var(--shadow);
}
.sheet-mask { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.5); display: flex; align-items: flex-end; }
.sheet {
  width: 100%; background: var(--card-solid); border-radius: 20px 20px 0 0;
  padding: 18px var(--page-pad) calc(18px + var(--safe-b)); box-shadow: var(--shadow);
  animation: up .22s cubic-bezier(.2,.8,.2,1);
}
@keyframes up { from { transform: translateY(24px); opacity: .6 } to { transform: none; opacity: 1 } }
.sheet h3 { font-size: 16px; font-weight: 700; margin-bottom: 10px; }
.sheet .acts { display: flex; gap: 10px; margin-top: 16px; }
.sheet .acts .btn { flex: 1; }

/* ---------- 页脚 ---------- */
.site-foot { margin: 22px 0 8px; text-align: center; font-size: var(--fs-foot); color: var(--text-3); line-height: 1.8; }
.site-foot a { text-decoration: underline; }

/* ---------- 骨架 / 断网 ---------- */
.retry { text-align: center; padding: 40px 0; }

/* ---------- 小程序入口 ---------- */
.mp-entry { margin-top: 12px; }
.mp-entry .btn { width: 100%; }

/* ---------- 打印/桌面 ---------- */
@media (min-width: 620px) {
  .app { max-width: 736px; margin: 0 auto; }
  .tabbar, .cartbar, .paybar { max-width: 560px; }
  .tabbar { left: 50%; transform: translateX(-50%); }
  .cartbar { left: 50%; transform: translateX(-50%); }
  .paybar { left: 50%; transform: translateX(-50%); }
  .promo-card .pc-name { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

.noscript { padding: 40px; text-align: center; color: #fff; }
