/* ============================================================
   NUTS·BAR Design System
   ------------------------------------------------------------
   视觉基调：深黑绿底 + 荧光绿高亮 + 金色点缀（夜间酒吧场景）
   底色   深黑偏绿 #0A0F0C，面板略提亮 #131A16
   主色   荧光绿 #3FD07A → #6EF2A6（渐变）
   强调   香槟金 #C8A96A / 暖黄 #F0C874（下单、金额、券）
   文字   主 #F2F6F3 / 次 #93A39A / 弱 #5F6F66
   图标   全部内联 SVG（ui.js icon()），零 Emoji
   层次   阴影 + 微弱渐变，不用生硬单线边框
   ============================================================ */

:root {
  /* 背景层 */
  --bg: #0A0F0C;
  --bg-soft: #0E1511;
  --panel: #131A16;
  --panel-2: #18211C;
  --panel-3: #1E2822;

  /* 边框 / 分隔（低对比，靠阴影拉层次） */
  --line: rgba(140, 190, 160, .10);
  --line-strong: rgba(140, 190, 160, .20);

  /* 文字 */
  --txt: #F2F6F3;
  --txt-2: #93A39A;
  --txt-3: #5F6F66;

  /* 主色：荧光绿 */
  --brand: #3FD07A;
  --brand-hi: #6EF2A6;
  --brand-dk: #22A25C;
  --brand-soft: rgba(63, 208, 122, .12);
  --brand-glow: rgba(63, 208, 122, .35);

  /* 强调：金 */
  --gold: #C8A96A;
  --gold-soft: rgba(200, 169, 106, .13);
  --amber: #F0C874;

  /* 语义 */
  --ok: #3FD07A;
  --warn: #E8B34B;
  --danger: #E85D5D;
  --violet: #A78BFA;

  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 28px -14px rgba(0,0,0,.85);
  --shadow-lg: 0 28px 64px -20px rgba(0,0,0,.9);
  --ease: cubic-bezier(.4, 0, .2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* 顶层氛围光：深绿光晕，模拟吧台灯带 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(880px 460px at 14% -14%, rgba(63, 208, 122, .13), transparent 64%),
    radial-gradient(700px 400px at 92% 2%, rgba(200, 169, 106, .09), transparent 62%);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ---------- 图标 ---------- */
.i {
  width: 20px; height: 20px;
  display: inline-block;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  vertical-align: -0.18em;
}
.i.sm { width: 16px; height: 16px; }
.i.lg { width: 24px; height: 24px; }
.i.xl { width: 30px; height: 30px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--brand-hi), var(--brand));
  color: #06210F;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .01em;
  cursor: pointer;
  transition: transform .16s var(--ease), box-shadow .2s var(--ease), filter .2s;
  box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 10px 22px -12px var(--brand-glow);
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.985); }
.btn:disabled, .btn[disabled] { opacity: .4; cursor: not-allowed; transform: none; filter: none; box-shadow: none; }

/* 描边按钮：荧光绿细边 + 深底（截图里的「复制 / 导航 / 拨打」） */
.btn.ghost {
  background: rgba(63, 208, 122, .06);
  color: var(--brand-hi);
  border-color: rgba(63, 208, 122, .34);
  box-shadow: none;
}
.btn.ghost:hover { background: rgba(63, 208, 122, .13); }

/* 金色按钮：下单 / 兑换（截图里的「下单」暖黄胶囊） */
.btn.gold {
  background: linear-gradient(180deg, #F3D18C, var(--gold));
  color: #2A1E06;
  box-shadow: 0 1px 0 rgba(255,255,255,.4) inset, 0 10px 22px -12px rgba(200,169,106,.55);
}

.btn.danger {
  background: rgba(232, 93, 93, .12);
  color: #F3A3A3;
  border-color: rgba(232, 93, 93, .32);
  box-shadow: none;
}
.btn.danger:hover { background: rgba(232, 93, 93, .22); }

.btn.ok {
  background: rgba(63, 208, 122, .14);
  color: var(--brand-hi);
  border-color: rgba(63, 208, 122, .34);
  box-shadow: none;
}
.btn.ok:hover { background: rgba(63, 208, 122, .24); }

.btn.sm { padding: 6px 12px; font-size: 12px; }
.btn.block { width: 100%; }
.btn.lg { padding: 13px 24px; font-size: 15px; }

/* ---------- 卡片 / 面板 ---------- */
.card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

/* 高亮卡：荧光绿细边（截图里的「我的酒水券」大卡） */
.card.accent {
  background: linear-gradient(160deg, rgba(63, 208, 122, .10), rgba(19, 26, 22, .9) 55%);
  border-color: rgba(63, 208, 122, .22);
  box-shadow: 0 0 0 1px rgba(63, 208, 122, .05), var(--shadow);
}

/* 区块小标题：竖条 + 文字（截图里的「| 积分兑换」） */
.sec-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .01em;
}
.sec-title::before {
  content: "";
  width: 3px;
  height: 15px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--brand-hi), var(--brand-dk));
  box-shadow: 0 0 8px var(--brand-glow);
}

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field > label {
  display: block;
  font-size: 12px;
  color: var(--txt-2);
  font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: .02em;
}
.input {
  width: 100%;
  padding: 11px 14px;
  background: rgba(10, 15, 12, .85);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--txt);
  font-size: 14px;
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.input::placeholder { color: var(--txt-3); }
.input:focus {
  border-color: rgba(63, 208, 122, .6);
  background: rgba(10, 15, 12, .95);
  box-shadow: 0 0 0 3px rgba(63, 208, 122, .13);
}
.input:disabled { opacity: .45; }

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2393A39A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 36px;
}

/* ---------- 表格 ---------- */
.table-wrap {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow);
}
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left;
  padding: 12px 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--txt-3);
  background: rgba(10, 15, 12, .55);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  color: var(--txt);
}
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr, table.data tr { transition: background .15s; }
table.data tr:hover td { background: rgba(63, 208, 122, .035); }

/* ---------- 徽章 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
  background: rgba(147, 163, 154, .10);
  color: var(--txt-2);
}
.badge.blue   { background: rgba(63,208,122,.12);  color: #7FE9A9; border-color: rgba(63,208,122,.28); }
.badge.violet { background: rgba(167,139,250,.14); color: #C4B5FD; border-color: rgba(167,139,250,.28); }
.badge.amber  { background: var(--gold-soft);      color: var(--amber); border-color: rgba(200,169,106,.30); }
.badge.green  { background: rgba(63,208,122,.12);  color: #7FE9A9; border-color: rgba(63,208,122,.28); }
.badge.red    { background: rgba(232,93,93,.13);   color: #F3A3A3; border-color: rgba(232,93,93,.28); }
.badge.gray   { background: rgba(147,163,154,.09); color: var(--txt-3); border-color: var(--line-strong); }

/* ---------- 空态 ---------- */
.empty {
  text-align: center;
  padding: 44px 20px;
  color: var(--txt-3);
  font-size: 13px;
}
.empty .i { display: block; margin: 0 auto 10px; opacity: .5; }

/* ---------- 层叠顺序（统一在根上下文） ----------
 *  0     body::before 氛围光
 *  1     页面内容 .shell
 *  90    顶部导航 .topbar
 *  95    侧边栏（移动端抽屉）
 * 999    弹层 .overlay（必须盖住顶栏与侧边栏）
 * 1000   Toast
 */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: rgba(3, 6, 4, .78);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  display: none;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 32px 16px;
  /* 弹层自身作为独立层叠上下文，避免被父级 overflow / z-index 裁切 */
  isolation: isolate;
}
/* 弹层已挂到 body 上时，顶层栏必须让位 */
body.overlay-open .topbar,
body.overlay-open .side {
  /* 视觉上仍存在，但不再拦截点击 */
  pointer-events: none;
}
.overlay.show { display: block; animation: fade .2s var(--ease); }
.overlay > .modal {
  background: linear-gradient(180deg, var(--panel-3), var(--panel));
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  max-width: 480px;
  margin: 0 auto;
  animation: pop .24s var(--ease);
}
.modal-head {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}
.modal-head h3 { font-size: 16px; font-weight: 700; letter-spacing: .01em; }
.modal-head .x {
  margin-left: auto; background: none; border: none; color: var(--txt-2);
  cursor: pointer; padding: 5px; border-radius: 9px; display: flex;
}
.modal-head .x:hover { background: rgba(147,163,154,.12); color: var(--txt); }
.modal-body { padding: 20px; }
.modal-foot { display: flex; gap: 10px; padding: 0 20px 20px; }
.modal-foot .btn { flex: 1; }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 44px;
  transform: translate(-50%, 20px);
  background: rgba(19, 26, 22, .97);
  border: 1px solid rgba(63, 208, 122, .24);
  color: var(--txt);
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s, transform .22s var(--ease);
  display: flex; align-items: center; gap: 8px;
  max-width: 88vw;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast .i { color: var(--brand); }
.toast.err { border-color: rgba(232, 93, 93, .38); }
.toast.err .i { color: #F3A3A3; }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(147,163,154,.20); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(147,163,154,.32); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 工具 ---------- */
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }

/* ---------- 商品缩略图：图片铺满整个框 ----------
 * 图标居中垫底，有图时图片绝对定位盖在上面。
 * 全局生效：点单 .prod / 商城 .m / 订单列表等所有用到 .thumb 的地方，
 * 不再依赖各页面单独写 img 尺寸（之前只有点单页写了对齐规则，
 * 商城等处的图片按原始尺寸渲染，填不满框）。 */
.thumb {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.thumb > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.spacer { flex: 1; }
.muted { color: var(--txt-2); }
.tiny { font-size: 11px; color: var(--txt-3); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* 金额 / 数字用等宽数字，避免跳动 */
.num { font-variant-numeric: tabular-nums; }

/* ---------- 明细行（兑换确认弹层用） ---------- */
.xb-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  font-size: 13px;
  color: var(--txt-2);
  border-bottom: 1px solid var(--line);
}
.xb-row:last-child { border-bottom: none; }
.xb-row b {
  color: var(--txt);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.xb-row.xb-total {
  padding-top: 13px;
  margin-top: 3px;
  border-top: 1px solid var(--line-strong);
  border-bottom: none;
  font-size: 13.5px;
}
.xb-row.xb-total b { font-size: 16px; }
