/* ===================================================================
   君月寻宝俱乐部 V3 - 克制现代风格
   实色 + 细边框 + 扁平 + 无悬浮动效 + 无渐变堆叠
   双端: 移动 .m-* / 桌面 .d-*
   =================================================================== */

:root {
  /* 实色主色 (克制专业, 不堆渐变) */
  --primary: #6366F1;        /* 靛蓝, 沉稳 */
  --primary-soft: #EEF0FF;
  --pink: #EC4899;
  --blue: #3B82F6;
  --green: #10B981;
  --orange: #F59E0B;
  --red: #EF4444;
  --gray: #64748B;

  /* 背景层 (干净中性) */
  --bg: #F8FAFC;
  --bg-soft: #F1F5F9;
  --card: #FFFFFF;
  --border: #E2E8F0;
  --border-soft: #EFF2F7;

  /* 文字 */
  --t-title: #0F172A;
  --t-body: #475569;
  --t-aux: #94A3B8;
  --t-faint: #CBD5E1;

  /* 状态色 */
  --st-pending: #F59E0B;
  --st-paid: #6366F1;
  --st-taking: #3B82F6;
  --st-serving: #F59E0B;
  --st-done: #10B981;
  --st-cancel: #94A3B8;

  /* 圆角 (适中, 不夸张) */
  --r-lg: 14px;
  --r-md: 10px;
  --r-sm: 8px;
  --r-pill: 999px;
  --r-sheet: 16px;

  /* 阴影 (极轻, 几乎无) */
  --sh-card: 0 1px 2px rgba(15, 23, 42, 0.04);
  --sh-line: inset 0 0 0 1px var(--border);
  --sh-float: 0 4px 12px rgba(15, 23, 42, 0.08);

  /* 桌面 */
  --d-bg: #F8FAFC;
  --d-surface: #FFFFFF;
  --d-surface-2: #F8FAFC;
  --d-title: #0F172A;
  --d-body: #475569;
  --d-muted: #94A3B8;
  --d-border: #E2E8F0;
  --d-sidebar: #FFFFFF;
  --d-r: 10px;

  --font: -apple-system, "PingFang SC", "MiSans", "HarmonyOS Sans", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--t-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
input, textarea, button, select { font-family: inherit; }
svg { display: inline-block; vertical-align: middle; }

/* ========== 共用 ========== */
.m-app { min-height: 100vh; padding-bottom: 80px; }
.t-title { color: var(--t-title); }
.t-aux { color: var(--t-aux); }
.fs-12 { font-size: 12px; } .fs-13 { font-size: 13px; } .fs-14 { font-size: 14px; } .fs-16 { font-size: 16px; } .fs-20 { font-size: 20px; } .fs-24 { font-size: 24px; }
.fw-500 { font-weight: 500; } .fw-600 { font-weight: 600; } .fw-700 { font-weight: 700; }
.price { color: var(--t-title); font-weight: 700; }
.row { display: flex; align-items: center; }
.row.between { justify-content: space-between; }
.row.center { justify-content: center; }
.col { display: flex; flex-direction: column; }
.gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }

/* 图标 (线性) */
.ic { width: 18px; height: 18px; stroke-width: 1.8; stroke: currentColor; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* 状态标签 (扁平 pill) */
.tag { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: var(--r-pill); font-size: 11px; font-weight: 600; line-height: 1.6; }
.tag-pending { background: #FEF3C7; color: #92400E; }
.tag-paid { background: #EEF0FF; color: #4F46E5; }
.tag-taking { background: #DBEAFE; color: #1E40AF; }
.tag-serving { background: #FEF3C7; color: #92400E; }
.tag-done { background: #D1FAE5; color: #065F46; }
.tag-cancel { background: #F1F5F9; color: #64748B; }
.tag-type-hall { background: #DBEAFE; color: #1E40AF; }
.tag-type-assign { background: #EEF0FF; color: #4F46E5; }
.tag-type-designated { background: #FCE7F3; color: #9D174D; }

/* 按钮 (扁平, 无悬浮) */
.m-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; cursor: pointer; border-radius: var(--r-md);
  font-size: 14px; font-weight: 600; padding: 10px 20px; transition: background 0.12s, border-color 0.12s;
}
.m-btn:active { transform: scale(0.98); }
.m-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.m-btn svg { width: 16px; height: 16px; }
.m-btn-primary { background: var(--primary); color: #fff; }
.m-btn-danger { background: var(--red); color: #fff; }
.m-btn-success { background: var(--green); color: #fff; }
.m-btn-ghost { background: var(--card); color: var(--t-title); border: 1px solid var(--border); }
.m-btn-text { background: transparent; color: var(--primary); padding: 4px 8px; }
.m-btn-block { display: flex; width: 100%; padding: 12px; font-size: 14px; }
.m-btn-sm { padding: 6px 14px; font-size: 12px; border-radius: var(--r-sm); }

/* 表单 (干净) */
.m-field { margin-bottom: 14px; }
.m-field > label { display: block; font-size: 12px; color: var(--t-aux); margin-bottom: 6px; font-weight: 600; }
.m-input {
  width: 100%; padding: 11px 14px; font-size: 14px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-md); color: var(--t-title); outline: none; transition: border-color 0.12s, box-shadow 0.12s;
}
.m-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1); }
textarea.m-input { min-height: 80px; resize: vertical; }

/* toast */
.m-toast {
  position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%); z-index: 999;
  background: var(--t-title); color: #fff; padding: 10px 20px; border-radius: var(--r-pill); font-size: 13px;
  max-width: 80vw; text-align: center; animation: toastIn 0.2s;
}
@keyframes toastIn { from { opacity:0; transform: translate(-50%,8px); } to { opacity:1; transform: translate(-50%,0); } }

/* empty */
.empty { text-align: center; padding: 48px 20px; color: var(--t-aux); }
.empty svg { width: 44px; height: 44px; margin-bottom: 10px; opacity: 0.4; }

/* ============================================================
   移动端
   ============================================================ */
.m-topbar {
  position: sticky; top: 0; z-index: 50; height: 46px; display: flex; align-items: center; padding: 0 14px;
  background: var(--card); border-bottom: 1px solid var(--border);
}
.m-topbar .tb-back { width: 24px; cursor: pointer; display: flex; }
.m-topbar .tb-back svg { width: 20px; height: 20px; color: var(--t-title); }
.m-topbar .tb-title { flex: 1; text-align: center; font-size: 15px; font-weight: 600; color: var(--t-title); }
.m-topbar .tb-right { width: 24px; text-align: right; cursor: pointer; }

.m-content { padding: 16px 16px 24px; }

.m-tabbar {
  position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%); z-index: 100;
  display: flex; gap: 2px; padding: 6px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-pill); box-shadow: var(--sh-float); max-width: 94vw;
}
.m-tabbar .tab-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 14px; border-radius: var(--r-pill); cursor: pointer; transition: background 0.15s; min-width: 52px;
}
.m-tabbar .tab-item svg { width: 20px; height: 20px; color: var(--t-aux); }
.m-tabbar .tab-item span { font-size: 10px; color: var(--t-aux); font-weight: 500; }
.m-tabbar .tab-item.active { background: var(--primary-soft); }
.m-tabbar .tab-item.active svg, .m-tabbar .tab-item.active span { color: var(--primary); }

.m-card { background: var(--card); border-radius: var(--r-lg); padding: 16px; border: 1px solid var(--border); position: relative; }
.m-card + .m-card { margin-top: 10px; }
.m-card.tappable { cursor: pointer; transition: background 0.12s; }
.m-card.tappable:active { background: var(--bg-soft); }
.m-card.with-bar { border-left: 3px solid var(--primary); }
.card-flow { display: flex; flex-direction: column; gap: 10px; }

.banner { background: var(--primary); color: #fff; border-radius: var(--r-lg); padding: 20px; position: relative; overflow: hidden; }
.banner .shop-name { font-size: 20px; font-weight: 700; }
.banner .shop-sub { font-size: 12px; opacity: 0.85; margin-top: 4px; }

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat-cell { background: var(--card); border-radius: var(--r-md); padding: 14px; border: 1px solid var(--border); }
.stat-cell .num { font-size: 22px; font-weight: 700; color: var(--t-title); }
.stat-cell .lbl { font-size: 11px; color: var(--t-aux); margin-top: 2px; }

.captcha-row { display: flex; gap: 10px; align-items: center; }
.captcha-row .m-input { flex: 1; }
.captcha-img { width: 110px; height: 42px; border-radius: var(--r-sm); cursor: pointer; border: 1px solid var(--border); background: var(--card); }

.product-img { width: 100%; height: 140px; object-fit: cover; border-radius: var(--r-md); background: var(--bg-soft); }
.product-img-ph { color: var(--t-faint); }
.product-img-ph svg { width: 36px; height: 36px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; }

/* 付款页打勾 (实色圆, 非渐变非发光) */
.pay-check { width: 52px; height: 52px; border-radius: 50%; background: var(--primary); color: #fff; }
.pay-check svg { width: 26px; height: 26px; }

/* 下单须知 (干净等宽文本块, 无装饰) */
.notice-pre { white-space: pre-wrap; font-family: inherit; font-size: 13px; line-height: 1.7; color: var(--t-body); }

/* 凭证图 (统一圆角) */
.proof-img { width: 100%; border-radius: var(--r-md); }

/* 操作记录行 (细分割线) */
.log-row { padding: 6px 0; border-bottom: 1px solid var(--border); }
.log-row:last-child { border-bottom: none; }

/* 接单前客户信息隐藏提示 (实色块, 无emoji) */
.locked-tip { text-align: center; padding: 12px; background: var(--bg-soft); border-radius: var(--r-md); color: var(--t-aux); font-size: 12px; }

/* Sheet */
.m-mask {
  position: fixed; inset: 0; z-index: 200; background: rgba(15, 23, 42, 0.4); backdrop-filter: blur(2px);
  display: flex; align-items: flex-end; animation: fadeIn 0.18s;
}
.m-sheet {
  width: 100%; background: var(--card); border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  max-height: 85vh; display: flex; flex-direction: column; animation: sheetUp 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  padding-bottom: env(safe-area-inset-bottom);
}
.m-sheet .grip { width: 36px; height: 4px; background: var(--border); border-radius: 4px; margin: 10px auto 4px; }
.m-sheet .s-title { text-align: center; font-size: 15px; font-weight: 600; color: var(--t-title); padding: 4px 16px 12px; }
.m-sheet .s-body { flex: 1; overflow-y: auto; padding: 0 16px; }
.m-sheet .s-foot { padding: 12px 16px 16px; display: flex; gap: 10px; }
.m-sheet .s-foot .m-btn { flex: 1; }
@keyframes fadeIn { from{opacity:0;} to{opacity:1;} }
@keyframes sheetUp { from{transform:translateY(100%);} to{transform:translateY(0);} }

/* ============================================================
   桌面端
   ============================================================ */
.d-layout { display: flex; min-height: 100vh; }
.d-sidebar {
  width: 220px; background: var(--d-sidebar); border-right: 1px solid var(--d-border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; flex-shrink: 0;
}
.d-sidebar .d-brand { padding: 20px 18px; border-bottom: 1px solid var(--d-border); }
.d-sidebar .d-brand .bn-title { font-size: 15px; font-weight: 700; color: var(--d-title); }
.d-sidebar .d-brand .bn-sub { font-size: 11px; color: var(--d-muted); margin-top: 2px; }
.d-sidebar .nav { flex: 1; padding: 10px 8px; overflow-y: auto; }
.d-sidebar .nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-sm);
  cursor: pointer; color: var(--d-body); font-size: 13px; margin-bottom: 2px; transition: background 0.12s; position: relative; font-weight: 500;
}
.d-sidebar .nav-item svg { width: 17px; height: 17px; color: var(--d-muted); }
.d-sidebar .nav-item:hover { background: var(--d-surface-2); }
.d-sidebar .nav-item.active { background: var(--primary-soft); color: var(--primary); }
.d-sidebar .nav-item.active svg { color: var(--primary); }
.d-sidebar .nav-group { font-size: 10px; color: var(--d-muted); padding: 14px 14px 6px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }

.d-main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--d-bg); }
.d-topbar {
  height: 52px; background: var(--d-surface); border-bottom: 1px solid var(--d-border);
  display: flex; align-items: center; padding: 0 28px; position: sticky; top: 0; z-index: 30;
}
.d-topbar .crumb { font-size: 14px; color: var(--d-title); font-weight: 600; }
.d-topbar .spacer { flex: 1; }
.d-topbar .user-chip { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 5px 10px; border-radius: var(--r-sm); transition: background 0.12s; }
.d-topbar .user-chip:hover { background: var(--d-surface-2); }
.d-topbar .user-chip .uname { font-size: 12px; color: var(--d-title); font-weight: 600; }
.d-topbar .user-chip .urole { font-size: 10px; color: var(--d-muted); }

.d-content { padding: 24px 28px; max-width: 1280px; width: 100%; margin: 0 auto; flex: 1; }
.d-content .page-title { font-size: 22px; font-weight: 700; color: var(--d-title); margin-bottom: 20px; }

.d-card { background: var(--d-surface); border-radius: var(--d-r); border: 1px solid var(--d-border); }
.d-card-pad { padding: 20px; }

.d-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.d-stat { background: var(--d-surface); border: 1px solid var(--d-border); border-radius: var(--d-r); padding: 18px 20px; position: relative; overflow: hidden; }
.d-stat::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--primary); }
.d-stat.s-green::before { background: var(--green); }
.d-stat.s-orange::before { background: var(--orange); }
.d-stat.s-red::before { background: var(--red); }
.d-stat .d-num { font-size: 26px; font-weight: 700; color: var(--d-title); }
.d-stat .d-lbl { font-size: 11px; color: var(--d-muted); margin-top: 2px; }

.d-table { width: 100%; border-collapse: collapse; }
.d-table th { text-align: left; padding: 11px 14px; font-size: 11px; color: var(--d-muted); font-weight: 600; background: var(--d-surface-2); border-bottom: 1px solid var(--d-border); }
.d-table td { padding: 12px 14px; font-size: 13px; color: var(--d-body); border-bottom: 1px solid var(--border-soft); }
.d-table tr:last-child td { border-bottom: none; }

.d-form { max-width: 520px; }
.d-form .d-field { margin-bottom: 16px; }
.d-form .d-field > label { display: block; font-size: 12px; color: var(--d-body); margin-bottom: 6px; font-weight: 600; }
.d-input {
  width: 100%; padding: 10px 14px; font-size: 13px; background: var(--d-surface);
  border: 1px solid var(--d-border); border-radius: var(--r-sm); color: var(--d-title); outline: none; transition: border-color 0.12s;
}
.d-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1); }
textarea.d-input { min-height: 90px; resize: vertical; }

.d-mask { position: fixed; inset: 0; z-index: 200; background: rgba(15, 23, 42, 0.45); display: flex; align-items: center; justify-content: center; animation: fadeIn 0.18s; }
.d-modal { background: var(--d-surface); border-radius: var(--r-lg); width: 90%; max-width: 560px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: var(--sh-float); animation: modalIn 0.18s; overflow: hidden; }
.d-modal .m-title { padding: 16px 20px; font-size: 15px; font-weight: 700; color: var(--d-title); border-bottom: 1px solid var(--d-border); }
.d-modal .m-body { flex: 1; overflow-y: auto; padding: 20px; }
.d-modal .m-foot { padding: 12px 20px; display: flex; gap: 10px; justify-content: flex-end; border-top: 1px solid var(--d-border); }
@keyframes modalIn { from{opacity:0; transform:scale(0.97);} to{opacity:1; transform:scale(1);} }

.d-login-wrap { min-height: 100vh; display: flex; }
.d-login-left { flex: 1; background: var(--primary); color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 60px; }
.d-login-left .ll-title { font-size: 36px; font-weight: 700; }
.d-login-left .ll-sub { font-size: 14px; opacity: 0.9; margin-top: 14px; max-width: 400px; line-height: 1.7; }
.d-login-right { width: 440px; background: var(--d-surface); display: flex; align-items: center; justify-content: center; padding: 40px; }

.d-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.d-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.d-empty { text-align: center; padding: 56px 20px; color: var(--d-muted); }
.d-empty svg { width: 44px; height: 44px; margin-bottom: 10px; opacity: 0.4; }

.d-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.d-item-card { background: var(--d-surface); border: 1px solid var(--d-border); border-radius: var(--d-r); padding: 18px; cursor: pointer; transition: border-color 0.12s; position: relative; }
.d-item-card:hover { border-color: var(--primary); }

@media (max-width: 1023px) { .d-layout { display: none; } }

/* ============================================================
   极简居中登录页 (Notion/Linear 风格, 双端共用)
   ============================================================ */
/* 菜单列表 (个人中心等) */
.menu-list { display: flex; flex-direction: column; gap: 8px; }
.menu-item {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--r-md);
  cursor: pointer; transition: background 0.12s;
}
.menu-item:active { background: var(--bg-soft); }
.menu-item .m-ic { width: 36px; height: 36px; border-radius: var(--r-sm); background: var(--primary-soft); color: var(--primary); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.menu-item .m-ic svg { width: 18px; height: 18px; }
.menu-item .m-label { flex: 1; font-size: 14px; color: var(--t-title); font-weight: 500; }
.menu-item .m-val { font-size: 12px; color: var(--t-aux); }
.menu-item .m-arrow svg { width: 16px; height: 16px; color: var(--t-aux); }

/* 信息行 */
.info-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.info-row:last-child { border-bottom: none; }
.info-row .ir-label { color: var(--t-aux); }
.info-row .ir-value { color: var(--t-title); font-weight: 600; }

.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 24px;
}
.auth-card {
  width: 100%; max-width: 380px; background: transparent;
}
.auth-logo {
  width: 48px; height: 48px; border-radius: 12px; background: var(--primary);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 20px;
  color: #fff; font-weight: 700; font-size: 20px;
}
.auth-title { text-align: center; font-size: 20px; font-weight: 700; color: var(--t-title); margin-bottom: 6px; }
.auth-sub { text-align: center; font-size: 13px; color: var(--t-aux); margin-bottom: 28px; }
.auth-field { margin-bottom: 18px; }
.auth-field > label { display: block; font-size: 12px; color: var(--t-aux); margin-bottom: 6px; font-weight: 600; }
.auth-input {
  width: 100%; padding: 10px 0; font-size: 15px;
  background: transparent; border: none; border-bottom: 1px solid var(--border);
  color: var(--t-title); outline: none; transition: border-color 0.15s; border-radius: 0;
}
.auth-input:focus { border-bottom-color: var(--primary); }
.auth-input::placeholder { color: var(--t-faint); }
.auth-captcha { display: flex; gap: 12px; align-items: flex-end; }
.auth-captcha .auth-input { flex: 1; }
.auth-captcha img { width: 100px; height: 38px; border-radius: 6px; cursor: pointer; border: 1px solid var(--border); }
.auth-btn {
  width: 100%; padding: 12px; margin-top: 8px; font-size: 15px; font-weight: 600;
  background: var(--primary); color: #fff; border: none; border-radius: 8px; cursor: pointer;
  transition: background 0.15s;
}
.auth-btn:active { transform: scale(0.98); }
.auth-btn:disabled { opacity: 0.5; }
.auth-switch { text-align: center; margin-top: 20px; font-size: 13px; color: var(--t-aux); }
.auth-switch a { color: var(--primary); cursor: pointer; font-weight: 600; }
.auth-error { text-align: center; color: var(--red); font-size: 12px; margin-top: 12px; min-height: 16px; }
.auth-tip { text-align: center; margin-top: 32px; font-size: 12px; color: var(--t-faint); line-height: 1.6; }

