/* ============================================================================
 * mobile-extras.css — 手机端扩展模块样式
 * 铁律：所有选择器以 .mx- 前缀开头（或 .mx-* 限定的后代），不写裸 body/button/input，
 *       不污染页面其它模块。桌面端卡片最大 720px 居中；手机端强化放在媒体查询里。
 * ==========================================================================*/

.mx-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 12px 28px;
  min-height: 100%;
  background: #f5f6f8;
  color: #1f2329;
  font-size: 15px;
  line-height: 1.5;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  box-sizing: border-box;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.mx-page, .mx-page * { box-sizing: border-box; }

/* ---------- 通用文字 / 卡片 ---------- */
.mx-title { font-size: 20px; font-weight: 700; color: #1f2329; padding: 4px 2px 2px; overflow-wrap: anywhere; }
.mx-sub { font-size: 12px; color: #8a9099; margin-top: 2px; overflow-wrap: anywhere; }
.mx-card-title { font-size: 15px; font-weight: 700; color: #1f2329; margin: 14px 2px 8px; }

.mx-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
  padding: 14px;
  margin-bottom: 12px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.mx-notice { background: #f0faf4; color: #2b6b46; font-size: 13px; border-left: 3px solid #07c160; }
.mx-notice-warn { background: #fff8e6; color: #8a6d1f; border-left-color: #ff9500; }

.mx-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.mx-stat3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mx-stat { text-align: center; padding: 14px 6px; margin-bottom: 0; }
.mx-stat-n { font-size: 18px; font-weight: 700; color: #07c160; overflow-wrap: anywhere; }
.mx-stat-l { font-size: 12px; color: #8a9099; margin-top: 4px; }

.mx-empty {
  text-align: center; color: #8a9099; font-size: 14px;
  padding: 30px 16px; margin-bottom: 12px;
  background: #fff; border-radius: 12px; box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
  overflow-wrap: anywhere;
}
.mx-empty.small { padding: 12px; font-size: 12px; box-shadow: none; background: transparent; }
.mx-empty .mx-btn { margin-top: 12px; }

.mx-badge {
  display: inline-block; font-size: 11px; line-height: 1.4;
  padding: 1px 7px; border-radius: 10px;
  background: #e8f7ee; color: #07a050; vertical-align: middle;
}
.mx-badge.ok { background: #e8f7ee; color: #07a050; }
.mx-badge.warn { background: #fff3e0; color: #d98000; }

.mx-toolbar { margin-bottom: 12px; }
.mx-search {
  width: 100%; font-size: 16px; padding: 11px 14px; min-height: 44px;
  border: 1px solid #e3e6eb; border-radius: 10px;
  background: #fff; color: #1f2329; outline: none;
  -webkit-appearance: none; appearance: none; min-width: 0;
}
.mx-search:focus { border-color: #07c160; }

.mx-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.mx-chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 6px 14px;
  font-size: 13px; color: #5a626d;
  background: #fff; border: 1px solid #e3e6eb; border-radius: 18px;
  cursor: pointer; user-select: none; -webkit-user-select: none;
}
.mx-chip.active { background: #07c160; border-color: #07c160; color: #fff; font-weight: 600; }

.mx-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 10px 18px;
  font-size: 15px; font-weight: 600;
  color: #1f2329; background: #fff;
  border: 1px solid #e3e6eb; border-radius: 10px;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  -webkit-appearance: none; appearance: none;
  text-align: center; min-width: 0; overflow-wrap: anywhere;
}
.mx-btn.primary { background: #07c160; border-color: #07c160; color: #fff; }
.mx-btn:disabled, .mx-btn[disabled] { opacity: .5; cursor: not-allowed; }
.mx-btn-block { display: flex; width: 100%; }
.mx-btn.mini { min-height: 44px; padding: 5px 12px; font-size: 12px; }

.mx-form { padding: 14px; }
.mx-form-row { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; min-width: 0; }
.mx-form-label { font-size: 13px; color: #5a626d; }
.mx-form-label em { color: #e5484d; font-style: normal; }
.mx-input {
  width: 100%; font-size: 16px; min-height: 44px; padding: 10px 12px;
  border: 1px solid #e3e6eb; border-radius: 10px;
  background: #fff; color: #1f2329; outline: none;
  -webkit-appearance: none; appearance: none; min-width: 0;
}
.mx-input:focus { border-color: #07c160; }
.mx-input:disabled, .mx-input[disabled] { background: #f5f6f8; color: #9aa0a8; }
.mx-input-sm { width: 110px; flex: 0 1 110px; min-width: 0; text-align: right; }

.mx-kv {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 7px 2px; font-size: 13px; border-bottom: 1px solid #f0f1f3; min-width: 0;
}
.mx-kv:last-child { border-bottom: none; }
.mx-kv span { color: #8a9099; overflow-wrap: anywhere; min-width: 0; }
.mx-kv b { color: #1f2329; font-weight: 600; text-align: right; overflow-wrap: anywhere; min-width: 0; }

.mx-modal-body { font-size: 14px; color: #1f2329; min-width: 0; overflow-wrap: anywhere; }
.mx-modal-body p { margin: 6px 0; }
.mx-chev { color: #b0b6bf; font-size: 18px; }
.mx-radio-row { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 15px; color: #1f2329; cursor: pointer; }
.mx-radio-row input { width: 18px; height: 18px; accent-color: #07c160; flex: 0 0 auto; }

/* ---------- 2. 会员注册 ---------- */
.mx-mbr-card { padding: 0; overflow: hidden; }
.mx-mbr-head { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 12px 14px; cursor: pointer; min-width: 0; }
.mx-mbr-info { flex: 1 1 auto; min-width: 0; }
.mx-mbr-name { font-size: 15px; font-weight: 700; color: #1f2329; overflow-wrap: anywhere; }
.mx-mbr-phone { font-size: 12px; color: #8a9099; margin-top: 2px; overflow-wrap: anywhere; }
.mx-mbr-bal { font-size: 14px; font-weight: 700; color: #07c160; flex: 0 0 auto; }
.mx-mbr-arrow { color: #b0b6bf; font-size: 14px; flex: 0 0 auto; }
.mx-mbr-foot {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 10px 14px; font-size: 12px; color: #8a9099;
  border-top: 1px solid #f0f1f3; min-width: 0; overflow-wrap: anywhere;
}
.mx-mbr-card .mx-kv, .mx-mbr-card .mx-mbr-tx-title, .mx-mbr-card .mx-row-actions { margin-left: 14px; margin-right: 14px; }
.mx-mbr-tx-title { font-size: 13px; font-weight: 700; color: #5a626d; margin-top: 12px; margin-bottom: 4px; }
.mx-row-actions { padding: 12px 0 14px; }

/* ---------- 3. 按菜品查桌台 ---------- */
.mx-dish-table { padding: 0; overflow: hidden; }
.mx-dish-table-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 56px; padding: 12px 14px; cursor: pointer; background: #f7fbf8; min-width: 0;
}
.mx-dish-table-name { font-size: 15px; font-weight: 700; color: #1f2329; overflow-wrap: anywhere; }
.mx-dish-items { padding: 6px 14px; }
.mx-dish-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 0; border-bottom: 1px solid #f0f1f3; min-width: 0;
}
.mx-dish-item:last-child { border-bottom: none; }
.mx-dish-item-name { font-size: 14px; color: #1f2329; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.mx-dish-item-name b { color: #07c160; }
.mx-dish-item-right { flex: 0 0 auto; font-size: 12px; color: #8a9099; display: flex; align-items: center; gap: 6px; }
.mx-dish-note { font-size: 12px; color: #9aa0a8; padding: 0 0 6px; overflow-wrap: anywhere; }
.mx-dish-table .mx-kv { margin: 0 14px 10px; border-top: 1px solid #f0f1f3; border-bottom: none; padding-top: 10px; }

/* v20261107d 按菜找桌增强：实时更新标记 + 桌台「已上菜 X/Y」进度 */
.mx-dish-live { float: right; font-size: 11px; color: #07a050; font-weight: 600; }
.mx-dish-progress { display: flex; align-items: center; gap: 8px; padding: 4px 14px 0; flex-wrap: wrap; }
.mx-dish-progress .mx-badge { font-size: 12px; }
.mx-dish-progress-hint { font-size: 12px; color: #8a9099; }
.mx-dish-progress-hint.ok { color: #07a050; font-weight: 600; }

/* ---------- 4. 使用帮助 ---------- */
.mx-help-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mx-help-cat { margin-bottom: 0; padding: 14px 12px; cursor: pointer; min-height: 96px; }
.mx-help-cat-icon { font-size: 24px; line-height: 1; margin-bottom: 6px; }
.mx-help-cat-name { font-size: 14px; font-weight: 700; color: #1f2329; }
.mx-help-cat-n { font-size: 11px; color: #07c160; margin-top: 6px; }
.mx-help-doc-link {
  display: flex; flex-direction: column; justify-content: center;
  min-height: 44px; padding: 12px 14px; border-bottom: 1px solid #f0f1f3;
  font-size: 14px; color: #1f2329; cursor: pointer; min-width: 0; overflow-wrap: anywhere;
}
.mx-help-doc-link:last-child { border-bottom: none; }
.mx-help-body { padding: 14px; }
.mx-help-html { font-size: 14px; color: #33383f; line-height: 1.7; min-width: 0; overflow-wrap: anywhere; }
.mx-help-html p { margin: 8px 0; }
.mx-help-html ul, .mx-help-html ol { padding-left: 20px; margin: 8px 0; }
.mx-help-html h4 { font-size: 14px; margin: 12px 0 6px; }
.mx-help-html table { width: 100%; border-collapse: collapse; }
.mx-help-html td, .mx-help-html th { border: 1px solid #e3e6eb; padding: 6px; font-size: 12px; }
.mx-nav-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mx-nav-cell {
  margin-bottom: 0; padding: 12px 4px; text-align: center; font-size: 12px; color: #1f2329;
  cursor: pointer; min-height: 76px; min-width: 0; overflow-wrap: anywhere;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
}
.mx-nav-ic { font-size: 22px; }
.mx-help-bottom { display: flex; gap: 10px; margin-top: 4px; }
.mx-help-bottom .mx-btn { flex: 1 1 0; min-width: 0; }

/* ---------- 5. 基础收银设置 ---------- */
.mx-set { padding-top: 0; }
.mx-set-header {
  display: flex; align-items: center; justify-content: space-between;
  background: #07c160; color: #fff; padding: 14px 16px; margin: 0 -12px 0; min-height: 52px;
}
.mx-set-header-title { font-size: 17px; font-weight: 700; }
.mx-set-sync { font-size: 13px; color: #eafff2; cursor: pointer; padding: 8px 4px; min-height: 44px; display: inline-flex; align-items: center; }
.mx-set-tabs { display: flex; background: #fff; margin: 0 -12px 12px; padding: 0 8px; box-shadow: 0 1px 4px rgba(0, 0, 0, .06); overflow-x: auto; }
.mx-set-tab {
  flex: 1 0 auto; text-align: center; font-size: 13px; color: #5a626d;
  padding: 12px 8px; min-height: 48px; white-space: nowrap; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  border-bottom: 3px solid transparent;
}
.mx-set-tab.active { color: #07c160; font-weight: 700; border-bottom-color: #07c160; }

.mx-set-body { background: #fff; border-radius: 12px; box-shadow: 0 1px 4px rgba(0, 0, 0, .06); overflow: hidden; margin-bottom: 12px; }
.mx-set-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 56px; padding: 10px 14px; border-bottom: 1px solid #f0f1f3; min-width: 0;
}
.mx-set-row:last-child { border-bottom: none; }
.mx-set-row-label { font-size: 14px; color: #1f2329; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.mx-set-row-value { font-size: 14px; color: #5a626d; flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.mx-set-row.link { cursor: pointer; }
.mx-set-row.link:active { background: #f7f8fa; }
.mx-set-row.sub { background: #fafbfc; }

.mx-switch {
  position: relative; flex: 0 0 auto; min-width: 50px;
  width: 50px; height: 30px; border-radius: 15px;
  background: #d8dce2; cursor: pointer; transition: background .2s;
}
.mx-switch::before { content: ''; position: absolute; top: -8px; bottom: -8px; left: 0; right: 0; }
.mx-switch.on { background: #07c160; }
.mx-switch.disabled { opacity: .5; cursor: not-allowed; }
.mx-switch-knob {
  position: absolute; top: 3px; left: 3px;
  width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
  transition: left .2s;
}
.mx-switch.on .mx-switch-knob { left: 23px; }

.mx-range { flex: 1 1 auto; min-width: 0; max-width: 58%; height: 44px; accent-color: #07c160; }
.mx-set-confirm { margin-top: 4px; height: 48px; font-size: 16px; }
.mx-set-reset {
  text-align: center; color: #8a9099; font-size: 13px; padding: 14px;
  min-height: 44px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}

/* ---------- 6. 账号信息 ---------- */
.mx-account { padding-top: 0; }
.mx-account-header {
  display: flex; align-items: center; justify-content: space-between;
  background: #07c160; color: #fff; padding: 12px 16px; margin: 0 -12px 16px;
  min-height: 52px; font-size: 17px; font-weight: 700;
}
.mx-account-back { font-size: 26px; line-height: 1; cursor: pointer; width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: flex-start; }
.mx-account-header-r { width: 44px; }
.mx-info-card { background: #fff; border-radius: 12px; box-shadow: 0 1px 4px rgba(0, 0, 0, .06); padding: 4px 14px; margin-bottom: 16px; overflow: hidden; }
.mx-info-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  min-height: 52px; padding: 12px 0; border-bottom: 1px solid #f0f1f3; min-width: 0;
}
.mx-info-row:last-child { border-bottom: none; }
.mx-info-row.editable { cursor: pointer; }
.mx-info-row.editable:active { background: #f7f8fa; }
.mx-info-label { font-size: 14px; color: #5a626d; flex: 0 0 40%; min-width: 0; overflow-wrap: anywhere; }
.mx-info-value { font-size: 14px; color: #1f2329; font-weight: 600; text-align: right; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; word-break: break-all; }
.mx-lic-ok { color: #07a050; }
.mx-lic-bad { color: #e5484d; }
.mx-info-suffix { display: block; font-size: 11px; color: #8a9099; font-weight: 400; margin-top: 3px; }
.mx-info-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; font-weight: 400; word-break: break-all; }
.mx-account-actions { display: flex; gap: 12px; }
.mx-btn-sync { flex: 1 1 0; min-width: 0; background: #ff9500; border-color: #ff9500; color: #fff; height: 52px; font-size: 16px; }
.mx-btn-logout { flex: 1 1 0; min-width: 0; background: #07c160; border-color: #07c160; color: #fff; height: 52px; font-size: 16px; }

/* ---------- 手机端专属强化（桌面保持上述基础样式） ---------- */
@media (max-width: 1023px) {
  .mx-page { padding: 10px 10px 24px; }
  .mx-title { font-size: 21px; }
  .mx-set-header { margin: 0 -10px 0; padding: 14px; }
  .mx-set-tabs { margin: 0 -10px 12px; }
  .mx-account-header { margin: 0 -10px 14px; }
  .mx-set-tab { min-height: 50px; }
  .mx-chip, .mx-btn.mini { min-height: 44px; }
  .mx-input, .mx-search, .mx-btn { font-size: 16px; }
  .mx-info-label { flex-basis: 38%; }
  .mx-nav-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ===== v20261107a：按菜找桌直跳 —— 桌台卡片高亮闪烁 ===== */
.tbb-card.tbb-flash {
  animation: tbbFlash 0.65s ease-in-out 4;
  box-shadow: 0 0 0 3px #07c160 !important;
  border-radius: 14px;
}
@keyframes tbbFlash {
  0%, 100% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.06); filter: brightness(1.12); }
}

/* ★ v20261108a：工作台常用功能磁贴（点餐宝式：淡色底 + 大图标 + 短标签） */
.wb-wrap { padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
.wb-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px 6px; padding: 4px 2px; }
@media (max-width: 359px) { .wb-grid { grid-template-columns: repeat(3, 1fr); } }
.wb-card { display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.wb-card:active .wb-ic { transform: scale(.92); }
.wb-ic { width: 54px; height: 54px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 27px; line-height: 1; transition: transform .12s ease; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.wb-name { font-size: 12.5px; color: #333; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== v20261108e 会员消费明细查询/打印 ===== */
.mx-tx-table { width: 100%; border-collapse: collapse; margin: 8px 0; background: #fff; }
.mx-tx-table th, .mx-tx-table td { border: 1px solid #eee; padding: 7px 8px; font-size: 12.5px; text-align: left; }
.mx-tx-table th { background: #fafafa; color: #555; font-weight: 600; }
.mx-tx-table tbody tr:nth-child(even) { background: #fcfcfc; }
.mx-tx-table td:nth-child(3), .mx-tx-table td:nth-child(4), .mx-tx-table td:nth-child(5) { text-align: right; white-space: nowrap; }
.mx-tx-sum { padding: 8px 4px; font-size: 13px; color: #333; border-top: 1px dashed #eee; }
.mx-tx-sum b { color: #d4380d; font-size: 15px; }
#mx-tx-detail .mx-form-row { margin-bottom: 6px; }
