/* Ordinex 无界序 —— 品牌样式
   品牌色：#5B2CFF / #2176FF / #00D4FF / #FFFFFF
   顾客端浅色底突出菜品与信任；经营端深色专业风。 */

:root {
  --brand-1: #5B2CFF;
  --brand-2: #2176FF;
  --brand-3: #00D4FF;
  --brand-grad: linear-gradient(120deg, #5B2CFF, #2176FF 55%, #00D4FF);
  --ok: #16a34a;
  --warn: #d97706;
  --err: #dc2626;
  --radius: 14px;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; }
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }

/* ================= 顾客端（浅色） ================= */
.c-body {
  background: #f3f4f6;
  color: #1f2937;
  min-height: 100vh;
}
.c-wrap { max-width: 480px; margin: 0 auto; padding-bottom: 90px; }
/* 套餐主图：真实图片按原比例完整显示（自适应高度不裁切）；占位块保持固定比例 */
.c-hero { width: 100%; display: block; background: #e5e7eb; }
img.c-hero { height: auto; }
div.c-hero { aspect-ratio: 16/10; }
.c-card { background: #fff; border-radius: var(--radius); margin: 12px; padding: 18px; box-shadow: 0 2px 12px rgba(0,0,0,.05); }
.c-title { font-size: 20px; font-weight: 700; margin: 0 0 8px; }
.c-store { font-size: 13px; color: #6b7280; }
.price-row { display: flex; align-items: baseline; gap: 10px; margin: 12px 0; }
.price-now { font-size: 30px; font-weight: 800; color: var(--brand-1); }
.price-now small { font-size: 15px; }
.price-old { font-size: 15px; color: #9ca3af; text-decoration: line-through; }
.badge { display: inline-block; background: rgba(91,44,255,.1); color: var(--brand-1); font-size: 12px; padding: 3px 10px; border-radius: 20px; }
.kv { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid #f1f1f4; font-size: 14px; }
.kv:last-child { border-bottom: none; }
.kv .k { color: #6b7280; }
.rules { font-size: 13px; color: #6b7280; line-height: 1.8; white-space: pre-line; }
/* 团购详情：栏目菜单 */
.menu-sec-title { font-weight: 700; color: #111827; font-size: 15px; margin: 16px 0 4px; }
.menu-sec-title:first-of-type { margin-top: 8px; }
.menu-item { display: flex; align-items: baseline; gap: 10px; padding: 7px 0; border-bottom: 1px dashed #eee; }
.menu-item:last-child { border-bottom: none; }
.mi-name { flex: 1; color: #374151; font-size: 14px; line-height: 1.5; min-width: 0; }
.mi-qty { color: #9ca3af; font-size: 13px; flex: 0 0 auto; }
.mi-price { color: #374151; font-size: 14px; font-weight: 600; flex: 0 0 auto; min-width: 50px; text-align: right; }
.trust { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.trust span { font-size: 12px; background: #f3f4f6; color: #4b5563; padding: 4px 10px; border-radius: 8px; }

.cta-bar { position: fixed; bottom: 0; left: 0; right: 0; max-width: 480px; margin: 0 auto;
  background: #fff; border-top: 1px solid #eee; padding: 10px 12px; display: flex; gap: 10px; }
.btn { border: none; border-radius: 10px; padding: 13px; font-size: 15px; font-weight: 600; flex: 1;
  text-decoration: none; text-align: center; display: inline-block; }
.btn-primary { background: var(--brand-grad); color: #fff; }
.btn-ghost { background: #eef2ff; color: var(--brand-1); flex: 0 0 auto; padding: 13px 16px; }
.btn:disabled { opacity: .5; }

.c-input { width: 100%; padding: 13px; border: 1px solid #d1d5db; border-radius: 10px; font-size: 16px; margin-top: 8px; }
.c-input:focus { outline: none; border-color: var(--brand-2); }
.field-label { font-size: 13px; color: #6b7280; margin-top: 14px; display: block; }
.msg { font-size: 13px; margin-top: 12px; min-height: 18px; text-align: center; }
.msg.err { color: var(--err); } .msg.ok { color: var(--ok); }

/* 预约表单组件（时间段芯片 / 人数步进器 / 开关） */
.slot-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.slot { border: 1px solid #d1d5db; border-radius: 10px; background: #fff; padding: 10px 4px;
  text-align: center; font-size: 14px; font-weight: 600; color: #374151; cursor: pointer; }
.slot.on { border-color: var(--brand-1); background: rgba(91,44,255,.08); color: var(--brand-1); }
.slot.wide { grid-column: span 2; }
.stepper { display: flex; align-items: center; gap: 14px; margin-top: 8px; }
.stepper button { width: 38px; height: 38px; border-radius: 50%; border: none; background: #f3f4f6;
  font-size: 18px; color: #374151; }
.stepper .num { font-size: 18px; font-weight: 700; min-width: 24px; text-align: center; }
.switch { position: relative; width: 46px; height: 26px; appearance: none; background: #e5e7eb;
  border-radius: 20px; cursor: pointer; transition: background .2s; outline: none; }
.switch:checked { background: var(--brand-1); }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; transition: left .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch:checked::after { left: 23px; }
.c-textarea { width: 100%; padding: 12px; border: 1px solid #d1d5db; border-radius: 10px;
  font-size: 15px; font-family: inherit; min-height: 76px; margin-top: 8px; resize: vertical; }
.c-textarea:focus { outline: none; border-color: var(--brand-2); }
.inline-row { display: flex; gap: 8px; margin-top: 8px; }
.inline-row .c-input { margin-top: 0; flex: 1; min-width: 0; }
.inline-row .btn { flex: 0 0 auto; }
/* 门店信息卡（导航/电话） */
.store-card { display: flex; align-items: center; gap: 12px; }
.store-ico { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 10px; background: rgba(91,44,255,.1);
  display: flex; align-items: center; justify-content: center; font-size: 20px; }
.store-actions { display: flex; gap: 10px; margin-top: 14px; }
.store-actions a { flex: 1; text-align: center; border: 1px solid #d1d5db; border-radius: 10px;
  padding: 11px; font-size: 14px; color: #374151; text-decoration: none; font-weight: 600; }

.qr-box { text-align: center; padding: 20px; }
.qr-box img { width: 220px; height: 220px; }
.backup { font-size: 15px; color: #374151; letter-spacing: 3px; margin-top: 10px; }
.status-chip { display: inline-block; padding: 6px 16px; border-radius: 20px; font-weight: 700; font-size: 14px; }
.st-usable { background: rgba(22,163,74,.12); color: var(--ok); }
.st-redeemed { background: #f3f4f6; color: #6b7280; }
.st-expired, .st-cancelled { background: rgba(220,38,38,.1); color: var(--err); }
.st-pending { background: rgba(217,119,6,.12); color: var(--warn); }

/* ================= 经营端（深色） ================= */
.k-body { background: #0b1020; color: #e5e7eb; min-height: 100vh; }
.k-top { background: #11162a; border-bottom: 1px solid #1f2740; padding: 12px 18px; display: flex;
  align-items: center; gap: 14px; position: sticky; top: 0; z-index: 5; }
.k-logo { font-weight: 800; background: var(--brand-grad); -webkit-background-clip: text;
  background-clip: text; color: transparent; font-size: 17px; }
.k-top .sp { flex: 1; }
.k-nav { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 18px; background: #0d1226; }
.k-nav a { font-size: 13px; color: #9aa4bf; padding: 6px 12px; border-radius: 8px; text-decoration: none; }
.k-nav a:hover, .k-nav a.active { background: #1b2340; color: #fff; }
.k-main { padding: 18px; max-width: 1100px; margin: 0 auto; }
.k-h1 { font-size: 20px; margin: 0 0 16px; }
.k-card { background: #11162a; border: 1px solid #1f2740; border-radius: 12px; padding: 18px; margin-bottom: 16px; }
.k-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: #141a30; border: 1px solid #1f2740; border-radius: 14px; padding: 15px; }
.stat .n { font-size: 24px; font-weight: 800; color: #fff; line-height: 1.1; }
.stat .n.brand { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .l { font-size: 12px; color: #8b95b3; margin-top: 4px; }
/* KPI 图标卡 */
.stat-grid { margin-bottom: 14px; }
.stat-grid .stat { display: flex; align-items: center; gap: 12px; }
.stat-badge { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center; }
.stat-body { min-width: 0; }
.stat-note { display: inline-block; margin-left: 5px; font-size: 10px; color: #6b7590;
  background: #1a2138; padding: 1px 6px; border-radius: 6px; vertical-align: middle; }
.card-h { font-weight: 700; font-size: 15px; margin-bottom: 14px; color: #eef1f8; }
/* 转化率小条 */
.conv-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.conv { flex: 1 1 120px; background: #141a30; border: 1px solid #1f2740; border-radius: 10px;
  padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.conv span { font-size: 11px; color: #8b95b3; }
.conv b { font-size: 17px; color: #fff; }
/* 渠道效果行 */
.chan-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid #1a2138; }
.chan-row:last-child { border-bottom: none; }
.chan-name { flex: 0 0 78px; font-size: 13px; color: #dbe1f2; }
.chan-track { flex: 1; height: 8px; background: #1a2138; border-radius: 5px; overflow: hidden; min-width: 30px; }
.chan-bar { height: 100%; background: var(--brand-grad); border-radius: 5px; min-width: 2px; }
.chan-nums { flex: 0 0 auto; font-size: 12px; color: #cdd5ee; display: flex; align-items: center; }
.chan-rate { margin-left: 10px; background: rgba(34,197,94,.14); color: #4ade80; font-size: 11px;
  padding: 2px 8px; border-radius: 8px; }
table.k-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.k-table th, .k-table td { text-align: left; padding: 10px; border-bottom: 1px solid #1f2740; }
.k-table th { color: #8b95b3; font-weight: 600; }
.k-table tr:hover td { background: #141a30; }
.k-input, .k-select { background: #0e142a; border: 1px solid #2a3350; color: #e5e7eb;
  padding: 9px 11px; border-radius: 8px; font-size: 14px; width: 100%; }
.k-btn { background: var(--brand-grad); color: #fff; border: none; border-radius: 8px; padding: 9px 16px; font-size: 14px; }
.k-btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 6px; }
/* 表格内多个操作按钮：统一间距、可换行、不挤在一起 */
.k-table td form { display: inline-block; margin: 0 4px 4px 0; }
.k-table td .k-btn-sm, .k-table td .k-tag { margin: 2px 4px 2px 0; }
.k-table td a.k-tag { display: inline-block; }
.k-btn-ghost { background: #1b2340; color: #cdd5ee; }
.k-btn-danger { background: rgba(220,38,38,.15); color: #fca5a5; }
.k-tag { font-size: 11px; padding: 2px 9px; border-radius: 10px; background: #1b2340; color: #9aa4bf; }
.k-tag.on { background: rgba(22,163,74,.18); color: #4ade80; }
.k-tag.off { background: rgba(220,38,38,.15); color: #fca5a5; }
.k-tag.warn { background: rgba(217,119,6,.18); color: #fbbf24; }
/* 登录密码可见性 */
.pwd-wrap { position: relative; }
.pwd-wrap .k-input { padding-right: 42px; }
.pwd-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: #8b95b3; padding: 6px; cursor: pointer; display: flex; }
.pwd-eye:hover { color: #cdd5ee; }

.funnel-step { display: flex; align-items: center; gap: 10px; margin: 8px 0; padding: 0 4px; }
.funnel-track { flex: 1; height: 26px; background: #141a30; border-radius: 6px; overflow: hidden; min-width: 0; }
.funnel-bar { height: 100%; background: var(--brand-grad); border-radius: 6px; min-width: 3px; }
.funnel-step .lbl { width: 110px; flex: 0 0 110px; font-size: 13px; color: #b9c0d8; }
.funnel-step .val { font-weight: 700; flex: 0 0 auto; min-width: 28px; text-align: right; }
.muted { color: #8b95b3; font-size: 12px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px,1fr)); gap: 12px; margin-bottom: 12px; }
.form-row label { font-size: 12px; color: #8b95b3; display: block; margin-bottom: 5px; }
/* 二维码：参考图上传 + 可折叠下载 */
.ref-box { margin-top: 12px; padding-top: 12px; border-top: 1px solid #1f2740; }
.ref-form { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.qr-fold { margin-top: 12px; }
.qr-fold summary { cursor: pointer; color: #9aa4bf; font-size: 13px; padding: 8px 12px;
  background: #141a30; border: 1px solid #1f2740; border-radius: 8px; list-style: none; }
.qr-fold summary::-webkit-details-marker { display: none; }
.qr-fold summary::before { content: "▸ "; }
.qr-fold[open] summary::before { content: "▾ "; }
.qr-fold .k-tag { margin: 2px 3px 2px 0; display: inline-block; }
.qr-row { display: flex; align-items: center; gap: 8px; padding: 9px 4px;
  border-bottom: 1px solid #1a2138; font-size: 12px; flex-wrap: wrap; }
.qr-row:last-child { border-bottom: none; }
.qr-row a { text-decoration: none; }
/* 校准页操作行：等宽按钮、窄屏自动换行 */
.ref-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.ref-actions .k-btn { text-align: center; padding: 11px 8px; }

/* 增长策略提示面板（套餐编辑辅助）*/
.strategy-hint { margin-top: 12px; padding: 14px; background: #141a30;
  border: 1px solid #2a3350; border-radius: 10px; }
.hint-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 10px; }
.hint-grid > div { display: flex; flex-direction: column; gap: 3px; }
.hint-grid span { font-size: 11px; color: #8b95b3; }
.hint-grid b { font-size: 13px; color: #e5e7eb; font-weight: 600; }

/* 页面永不横向滚动；宽内容各自在容器内滚。用 clip 而非 hidden，避免破坏 sticky 顶栏 */
html, body { max-width: 100%; overflow-x: clip; }
/* 横向滚动区加固：overscroll-behavior 防滚动链劫持；
   去掉已废弃的 -webkit-overflow-scrolling（部分安卓 WebView 上会造成滚动冻结） */
.k-nav { overflow-x: auto; flex-wrap: nowrap; white-space: nowrap;
  overscroll-behavior-x: contain; touch-action: pan-x pan-y; }
.k-nav::-webkit-scrollbar { height: 0; }
/* 宽表格在自身容器内横向滚动，不撑破页面（base_console 的脚本自动包裹） */
.k-table-wrap { width: 100%; overflow-x: auto;
  overscroll-behavior-x: contain; touch-action: pan-x pan-y; }
.k-table-wrap::-webkit-scrollbar { height: 3px; }
/* 预约卡片 */
.res-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: #cdd5ee; margin-top: 10px; }
.res-ops { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.res-ops form { margin: 0; }

/* ================= 手机适配 ================= */
@media (max-width: 640px) {
  .k-top { padding: 11px 14px; }
  .k-nav { padding: 8px 12px; gap: 4px; }
  .k-nav a { padding: 7px 12px; }               /* 更大点触区 */
  .k-main { padding: 12px; }
  .k-h1 { font-size: 18px; }
  .k-card { padding: 14px; border-radius: 10px; }
  /* 表单单列铺满，输入框 16px 防 iOS 聚焦缩放 */
  .form-row { grid-template-columns: 1fr; gap: 10px; }
  .k-input, .k-select { font-size: 16px; padding: 11px 12px; }
  /* 宽表格：由 JS 包裹 .k-table-wrap 提供真机可靠的横向触摸滚动 */
  table.k-table { white-space: nowrap; }
  .k-table th, .k-table td { padding: 9px 10px; }
  /* 统计卡两列，指标数字略小 */
  .k-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 13px; }
  .stat .n { font-size: 21px; }
  /* 表内操作按钮更易点 */
  .k-btn-sm { padding: 7px 12px; font-size: 12px; }
  .funnel-step .lbl { width: 92px; flex-basis: 92px; font-size: 12px; }
}

@media (max-width: 380px) {
  .k-grid { grid-template-columns: 1fr; }
}
