/* ==========================================================================
   店小二 · 门店运营管理系统 — 设计系统
   手机优先，≥960px 自动切换为侧边栏桌面布局
   ========================================================================== */

:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #eef2f9;
  --border: #e5e9f2;
  --border-2: #d7dde9;
  --text: #0f1729;
  --text-2: #5a6a85;
  --text-3: #93a0b5;
  --pri: #3b6ef6;
  --pri-dark: #2c58d4;
  --pri-soft: #eef3ff;
  --pri-line: #cddcff;
  --accent: #ff7a45;
  --accent-soft: #fff2ec;
  --ok: #10b981;
  --ok-soft: #e8f8f2;
  --warn: #f59e0b;
  --warn-soft: #fff7e8;
  --danger: #ef4444;
  --danger-soft: #feefef;
  --purple: #7c5cff;
  --purple-soft: #f2efff;
  --cyan: #06b6d4;
  --cyan-soft: #e6f9fd;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 7px;
  --shadow-1: 0 1px 2px rgba(15, 23, 41, .05), 0 2px 8px rgba(15, 23, 41, .04);
  --shadow-2: 0 4px 12px rgba(15, 23, 41, .07), 0 12px 32px rgba(15, 23, 41, .07);
  --shadow-3: 0 12px 40px rgba(15, 23, 41, .16);
  --sidebar-w: 236px;
  --topbar-h: 58px;
  --tabbar-h: 60px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--pri); text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cfd7e6; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================== 布局壳 ============================== */
.app { min-height: 100vh; }

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--topbar-h);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  z-index: 40;
}
.topbar .brand-mark {
  display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px;
  white-space: nowrap;
}
.topbar .brand-mark .logo {
  width: 28px; height: 28px; border-radius: 8px; flex: 0 0 28px;
  background: linear-gradient(135deg, #3b6ef6, #7c5cff);
  display: grid; place-items: center; color: #fff; font-size: 15px;
  box-shadow: 0 2px 8px rgba(59, 110, 246, .35);
}
.topbar .spacer { flex: 1; }
.topbar .store-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-3); color: var(--text-2);
  padding: 5px 10px; border-radius: 999px; font-size: 12px; max-width: 42vw;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.topbar .me {
  display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px;
  border-radius: 999px; cursor: pointer; border: 1px solid transparent;
}
.topbar .me:hover { background: var(--surface-2); border-color: var(--border); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--pri-soft); color: var(--pri-dark); font-size: 14px; flex: 0 0 30px;
}
.me .who { line-height: 1.15; }
.me .who b { font-size: 12.5px; display: block; }
.me .who span { font-size: 11px; color: var(--text-3); }
@media (max-width: 720px) { .me .who { display: none; } }

.side {
  position: fixed; top: var(--topbar-h); bottom: 0; left: 0; width: var(--sidebar-w);
  background: var(--surface); border-right: 1px solid var(--border);
  padding: 12px 10px; overflow-y: auto; z-index: 30;
}
.side .nav-group { font-size: 11px; color: var(--text-3); padding: 12px 10px 6px; letter-spacing: .04em; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: var(--radius-sm);
  color: var(--text-2); font-size: 13.5px; cursor: pointer; margin-bottom: 2px; font-weight: 500;
}
.nav-item i { font-style: normal; font-size: 15px; width: 18px; text-align: center; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--pri-soft); color: var(--pri-dark); font-weight: 650; }
.nav-item .dot { margin-left: auto; background: var(--danger); color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 999px; }

.main {
  padding: calc(var(--topbar-h) + 16px) 16px calc(var(--tabbar-h) + 24px);
  max-width: 1280px;
}
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; height: var(--tabbar-h);
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px);
  border-top: 1px solid var(--border); display: flex; z-index: 40;
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar .tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 10.5px; color: var(--text-3); cursor: pointer; padding-top: 6px;
}
.tabbar .tab i { font-style: normal; font-size: 18px; line-height: 1; }
.tabbar .tab.active { color: var(--pri); font-weight: 650; }

@media (min-width: 960px) {
  .side { display: block; }
  .tabbar { display: none; }
  .main { margin-left: var(--sidebar-w); padding: calc(var(--topbar-h) + 22px) 24px 40px; }
  .topbar { padding-left: 18px; }
}
@media (max-width: 959px) {
  .side { display: none; }
}

/* ============================== 页面标题 ============================== */
.page-hd { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-hd h2 { font-size: 20px; }
.page-hd .sub { color: var(--text-3); font-size: 12.5px; }
.page-hd .right { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ============================== 卡片 ============================== */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-1); overflow: hidden;
}
.card + .card { margin-top: 14px; }
.card-hd {
  display: flex; align-items: center; gap: 10px; padding: 13px 15px;
  border-bottom: 1px solid var(--border);
}
.card-hd h3 { font-size: 14.5px; }
.card-hd .sub { font-size: 11.5px; color: var(--text-3); }
.card-hd .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-bd { padding: 15px; }
.card-bd.tight { padding: 0; }
.card-ft { padding: 11px 15px; background: var(--surface-2); border-top: 1px solid var(--border); font-size: 12px; color: var(--text-2); }

/* ============================== 栅格 ============================== */
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .g2, .g3, .g4, .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g2.full-mobile, .g3.full-mobile { grid-template-columns: 1fr; }
}
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.tight { gap: 6px; }
.row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 10px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; }

/* ============================== 指标卡 ============================== */
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 13px 14px; box-shadow: var(--shadow-1); position: relative; overflow: hidden;
}
.stat .lbl { font-size: 11.5px; color: var(--text-3); display: flex; align-items: center; gap: 5px; }
.stat .val { font-size: 23px; font-weight: 700; letter-spacing: -.02em; margin-top: 5px; line-height: 1.15; }
.stat .val small { font-size: 12px; font-weight: 600; color: var(--text-3); margin-left: 2px; }
.stat .foot { font-size: 11.5px; color: var(--text-3); margin-top: 4px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.stat.pri { background: linear-gradient(135deg, #eef3ff, #ffffff 65%); border-color: var(--pri-line); }
.stat.pri .val { color: var(--pri-dark); }
.stat.warn { background: linear-gradient(135deg, #fff7e8, #ffffff 65%); }
.stat.danger { background: linear-gradient(135deg, #feefef, #ffffff 65%); }
.stat.ok { background: linear-gradient(135deg, #e8f8f2, #ffffff 65%); }
@media (max-width: 480px) { .stat .val { font-size: 20px; } }

.delta { font-weight: 650; font-size: 11.5px; padding: 1px 6px; border-radius: 6px; }
.delta.up { color: #0a7d55; background: var(--ok-soft); }
.delta.down { color: #b42318; background: var(--danger-soft); }

/* ============================== 按钮 ============================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 15px; border-radius: var(--radius-sm); border: 1px solid var(--border-2);
  background: var(--surface); color: var(--text); font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: .14s; white-space: nowrap; user-select: none;
}
.btn:hover { border-color: var(--pri-line); color: var(--pri-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-pri { background: linear-gradient(135deg, #3b6ef6, #2c58d4); border-color: transparent; color: #fff; box-shadow: 0 2px 8px rgba(59, 110, 246, .28); }
.btn-pri:hover { color: #fff; filter: brightness(1.05); }
.btn-ok { background: linear-gradient(135deg, #10b981, #059669); border-color: transparent; color: #fff; }
.btn-ok:hover { color: #fff; }
.btn-warn { background: linear-gradient(135deg, #f59e0b, #d97706); border-color: transparent; color: #fff; }
.btn-warn:hover { color: #fff; }
.btn-danger { background: var(--danger-soft); border-color: #fbc9c6; color: #b42318; }
.btn-danger:hover { background: #fdd; color: #912018; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: var(--radius-xs); }
.btn-lg { padding: 13px 20px; font-size: 15px; border-radius: var(--radius-sm); }
.btn-block { width: 100%; }
.btn-icon { padding: 8px; width: 34px; height: 34px; }

/* ============================== 徽标 ============================== */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--text-2); white-space: nowrap;
}
.badge-pri { background: var(--pri-soft); color: var(--pri-dark); }
.badge-ok { background: var(--ok-soft); color: #0a7d55; }
.badge-warn { background: var(--warn-soft); color: #b54708; }
.badge-danger { background: var(--danger-soft); color: #b42318; }
.badge-purple { background: var(--purple-soft); color: #5b3ddb; }
.badge-cyan { background: var(--cyan-soft); color: #0887a0; }
.badge-accent { background: var(--accent-soft); color: #c2410c; }

/* ============================== 表单 ============================== */
.field { margin-bottom: 12px; }
.field > label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.field .hint { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }
.input, .select, .textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 14px; font-family: inherit; transition: .14s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--pri); box-shadow: 0 0 0 3px rgba(59, 110, 246, .13);
}
.input::placeholder { color: var(--text-3); }
.textarea { min-height: 92px; resize: vertical; line-height: 1.5; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4.5L6 8.5L10 4.5' stroke='%235a6a85' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }
.err { color: var(--danger); font-size: 11.5px; margin-top: 4px; }

/* 折叠区：弹层里次要内容（如商品「自动出库规则与说明」）默认收起，点标题展开 */
.fold { margin-top: 6px; border: 1px solid var(--border-2); border-radius: var(--radius-sm); background: var(--surface-2); }
.fold > summary { display: flex; align-items: center; gap: 6px; padding: 10px 12px; cursor: pointer; list-style: none; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before { content: "▸"; font-size: 11px; color: var(--text-3); transition: transform .16s; }
.fold[open] > summary::before { transform: rotate(90deg); }
.fold[open] > summary { border-bottom: 1px solid var(--border-2); }
.fold > summary i { font-style: normal; font-weight: 400; font-size: 11.5px; color: var(--text-3); }
.fold-bd { padding: 12px; }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.switch input { display: none; }
.switch .track { width: 38px; height: 22px; border-radius: 999px; background: #d0d7e4; position: relative; transition: .18s; flex: 0 0 38px; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .18s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.switch input:checked + .track { background: var(--pri); }
.switch input:checked + .track::after { left: 18px; }

.seg { display: inline-flex; background: var(--surface-3); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.seg .item { padding: 6px 13px; border-radius: var(--radius-xs); font-size: 12.5px; font-weight: 600; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.seg .item.active { background: var(--surface); color: var(--pri-dark); box-shadow: var(--shadow-1); }
.seg.scroll { display: flex; overflow-x: auto; }

/* ============================== 表格 ============================== */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th {
  text-align: left; font-size: 11.5px; font-weight: 650; color: var(--text-3);
  padding: 9px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border);
  white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .strong { font-weight: 650; }
.tbl .muted { color: var(--text-3); font-size: 12px; }
.tbl .nowrap { white-space: nowrap; }
.tbl.compact td, .tbl.compact th { padding: 7px 10px; }

/* 手机端表格转卡片 */
@media (max-width: 720px) {
  .tbl.responsive thead { display: none; }
  .tbl.responsive, .tbl.responsive tbody, .tbl.responsive tr, .tbl.responsive td { display: block; width: 100%; }
  .tbl.responsive tr { border-bottom: 1px solid var(--border); padding: 10px 12px; }
  .tbl.responsive tbody tr:hover { background: transparent; }
  .tbl.responsive td { border: none; padding: 2px 0; display: flex; justify-content: space-between; gap: 12px; }
  .tbl.responsive td::before {
    content: attr(data-l); font-size: 11.5px; color: var(--text-3); font-weight: 600; flex: 0 0 auto;
  }
  .tbl.responsive td .v { text-align: right; }
}

/* ============================== 列表项 ============================== */
.list { display: flex; flex-direction: column; }
.item {
  display: flex; align-items: center; gap: 11px; padding: 11px 15px; border-bottom: 1px solid var(--border);
  cursor: default;
}
.item:last-child { border-bottom: none; }
.item.clickable { cursor: pointer; }
.item.clickable:hover { background: var(--surface-2); }
.item .ic {
  width: 36px; height: 36px; border-radius: var(--radius-sm); display: grid; place-items: center;
  font-size: 18px; background: var(--surface-3); flex: 0 0 36px;
}
.item .body { flex: 1; min-width: 0; }
.item .body .t { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.item .body .s { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.item .tail { text-align: right; flex: 0 0 auto; }
.item .tail .m { font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.item .tail .n { font-size: 11.5px; color: var(--text-3); }

/* ============================== 进度条 ============================== */
.bar { height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #3b6ef6, #7c5cff); }
.bar.ok > i { background: linear-gradient(90deg, #10b981, #34d399); }
.bar.warn > i { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.bar.danger > i { background: linear-gradient(90deg, #ef4444, #f87171); }

/* ============================== 弹层 ============================== */
.mask {
  position: fixed; inset: 0; background: rgba(15, 23, 41, .42); z-index: 90;
  display: flex; align-items: flex-end; justify-content: center; animation: fade .16s;
}
@media (min-width: 720px) { .mask { align-items: center; } }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.985) } to { opacity: 1; transform: none } }
.modal {
  background: var(--surface); width: 100%; max-width: 560px; max-height: 90vh;
  border-radius: 18px 18px 0 0; box-shadow: var(--shadow-3); display: flex; flex-direction: column;
  animation: pop .2s; overflow: hidden;
}
@media (min-width: 720px) { .modal { border-radius: var(--radius); max-width: 620px; } }
.modal.wide { max-width: 880px; }
/* 弹层头：标题必须优先保证可读。副标题（.badge）自带 white-space:nowrap，
   窄屏下它的「最小宽度 = 全文宽度」会把标题挤成每行一个字（实测踩到过），
   所以这里让副标题可以被压缩并省略号收尾、放不下就整块换到第二行；
   关闭按钮改成绝对定位，不再挤占这一行。 */
.modal-hd { position: relative; display: flex; align-items: center; gap: 6px 10px; padding: 15px 44px 15px 17px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.modal-hd h3 { font-size: 16px; flex: 0 0 auto; }
.modal-hd .badge { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.modal-hd .x {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  cursor: pointer; color: var(--text-3); font-size: 20px; line-height: 1; padding: 2px 6px; border-radius: 6px;
}
.modal-hd .x:hover { background: var(--surface-2); color: var(--text); }
.modal-bd { padding: 17px; overflow-y: auto; flex: 1; }
.modal-ft { padding: 13px 17px; border-top: 1px solid var(--border); display: flex; gap: 9px; justify-content: flex-end; background: var(--surface-2); flex-wrap: wrap; }

/* ============================== Toast ============================== */
.toasts { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 18px); transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
@media (min-width: 960px) { .toasts { bottom: 28px; } }
.toast {
  background: #0f1729; color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 13px;
  box-shadow: var(--shadow-2); animation: pop .2s; max-width: 88vw; display: flex; align-items: center; gap: 7px;
}
.toast.ok { background: #0a7d55; }
.toast.err { background: #b42318; }
.toast.warn { background: #b54708; }

/* ============================== 图例 / 辅助 ============================== */
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--text-2); }
.legend .k { display: inline-flex; align-items: center; gap: 5px; }
.legend .d { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 9px; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.right { text-align: right; }
.empty { padding: 36px 16px; text-align: center; color: var(--text-3); font-size: 13px; }
.empty .ic { font-size: 30px; display: block; margin-bottom: 8px; opacity: .6; }
.divider { height: 1px; background: var(--border); margin: 12px 0; }
.skeleton { background: linear-gradient(90deg, #eef2f9 25%, #f7f9fc 37%, #eef2f9 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: 6px; }
@keyframes sk { 0% { background-position: 100% 50% } 100% { background-position: 0 50% } }
.loading { padding: 40px; text-align: center; color: var(--text-3); font-size: 13px; }
.spin { display: inline-block; width: 15px; height: 15px; border: 2px solid var(--pri-line); border-top-color: var(--pri); border-radius: 50%; animation: sp .7s linear infinite; vertical-align: -2px; }
@keyframes sp { to { transform: rotate(360deg) } }

/* ============================== 图表 ============================== */
.chart { width: 100%; display: block; overflow: visible; }
.chart text { font-family: var(--font); }

/* ============================== 登录页 ============================== */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background:
    radial-gradient(1100px 520px at 12% -8%, #e6edff 0%, transparent 60%),
    radial-gradient(900px 480px at 92% 4%, #f2efff 0%, transparent 58%),
    radial-gradient(700px 500px at 50% 108%, #fff2ec 0%, transparent 60%),
    var(--bg);
}
.login-card {
  width: 100%; max-width: 940px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; box-shadow: var(--shadow-2); overflow: hidden; display: grid;
  grid-template-columns: 1.05fr .95fr;
}
@media (max-width: 820px) { .login-card { grid-template-columns: 1fr; max-width: 460px; } .login-hero { display: none; } }
.login-hero {
  padding: 34px 32px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(150deg, #2c58d4 0%, #3b6ef6 42%, #7c5cff 100%);
}
.login-hero::after {
  content: ""; position: absolute; inset: 0; opacity: .16;
  background-image: linear-gradient(rgba(255,255,255,.6) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.6) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(120% 90% at 100% 0%, #000 0%, transparent 72%);
  mask-image: radial-gradient(120% 90% at 100% 0%, #000 0%, transparent 72%);
}
.login-hero .inner { position: relative; z-index: 1; }
.login-hero .hero-top { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.login-hero .hero-logo {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  font-size: 18px; font-weight: 700; background: rgba(255,255,255,.94); color: #2c58d4; flex: 0 0 auto;
}
.login-hero .tag { display: inline-block; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.28); padding: 4px 11px; border-radius: 999px; font-size: 12px; }
/* 主视觉：系统名放大加粗，是第一眼要看到的东西 */
.login-hero .hero-title { font-size: 40px; line-height: 1.1; letter-spacing: 4px; font-weight: 760; margin: 0 0 10px; }
.login-hero .hero-sub { margin: 0; font-size: 13px; line-height: 1.75; opacity: .92; max-width: 30em; }
.login-hero .hero-sub b { font-weight: 650; }
/* 四种角色的痛点卡片：谁用、解决什么，一眼看完 */
.login-hero .hero-roles { display: grid; gap: 9px; margin-top: 20px; }
.login-hero .hero-role {
  display: flex; gap: 11px; align-items: flex-start; padding: 10px 12px; border-radius: 12px;
  background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.22);
}
.login-hero .hero-role .ic {
  width: 28px; height: 28px; border-radius: 9px; background: rgba(255,255,255,.24);
  display: grid; place-items: center; font-size: 15px; flex: 0 0 28px; margin-top: 1px;
}
.login-hero .hero-role .tx { display: block; min-width: 0; }
.login-hero .hero-role b { display: block; font-size: 13.5px; font-weight: 660; letter-spacing: .2px; }
.login-hero .hero-role em { display: block; font-style: normal; font-size: 12.5px; line-height: 1.6; opacity: .87; margin-top: 2px; }
.login-form { padding: 30px 30px 26px; }
@media (max-width: 480px) { .login-form { padding: 24px 20px 22px; } }
.acc-list { display: grid; gap: 8px; margin-top: 6px; }
.acc {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; transition: .14s; background: var(--surface);
}
.acc:hover { border-color: var(--pri-line); background: var(--pri-soft); }
.acc .ic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-size: 16px; background: var(--surface-3); flex: 0 0 32px; }
.acc .b { flex: 1; min-width: 0; }
.acc .b b { display: block; font-size: 13px; }
.acc .b span { font-size: 11.5px; color: var(--text-3); }
.acc .u { font-size: 11.5px; color: var(--text-3); font-family: var(--mono); }

/* ============================== 收银台入口分层 ============================== */
/* 一级主入口（团购验券 / 门店收款码）用大卡片，次一级入口用列表行 */
.cash-hero {
  border: 1px solid var(--pri-line); border-radius: var(--radius);
  background: linear-gradient(135deg, var(--pri-soft), var(--surface) 72%);
  padding: 14px;
}
.cash-hero-hd { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; flex-wrap: wrap; }
.cash-tile {
  display: flex; align-items: center; gap: 14px; text-align: left; width: 100%;
  padding: 17px 16px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); box-shadow: var(--shadow-1); cursor: pointer; transition: .15s;
}
.cash-tile:hover { border-color: var(--pri-line); box-shadow: var(--shadow-2); transform: translateY(-1px); }
.cash-tile:active { transform: translateY(0); }
.cash-tile .ic {
  width: 46px; height: 46px; flex: 0 0 46px; border-radius: 13px;
  display: grid; place-items: center; font-size: 23px; background: var(--surface-3);
}
.cash-tile .tx { flex: 1; min-width: 0; }
.cash-tile .tx b { display: block; font-size: 16.5px; letter-spacing: -.01em; }
.cash-tile .tx i { display: block; font-style: normal; font-size: 12px; color: var(--text-3); margin-top: 3px; }
.cash-tile .arw { color: var(--text-3); font-size: 20px; line-height: 1; }
.cash-tile.pri .ic { background: var(--pri-soft); }
.cash-tile.ok .ic { background: var(--ok-soft); }
@media (max-width: 640px) {
  /* 手机上主入口改为单列铺满：两列会把标题挤断行，且这是最高频入口，值得占满一行 */
  .cash-hero .g2 { grid-template-columns: 1fr; }
  .cash-tile { padding: 15px 14px; gap: 12px; }
  .cash-tile .ic { width: 44px; height: 44px; flex: 0 0 44px; font-size: 22px; }
  .cash-tile .tx b { font-size: 16px; }
}
.cash-back { margin-bottom: 12px; }

/* ==================== 礼品导入 / 演示视频 / 试点招募 ==================== */
.dropzone {
  display: block; width: 100%; text-align: center; padding: 20px 16px;
  border: 1.5px dashed var(--border-2); border-radius: var(--radius);
  background: var(--surface-2); cursor: pointer; transition: .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--pri); background: var(--pri-soft); }
.dropzone .ic { font-size: 26px; display: block; margin-bottom: 6px; }
.dropzone b { display: block; font-size: 13.5px; color: var(--text); }
.dropzone i { font-style: normal; font-size: 11.5px; color: var(--text-3); }

.parse-preview { max-height: 264px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.parse-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border-bottom: 1px solid var(--border); font-size: 13px;
}
.parse-row:last-child { border-bottom: none; }
.parse-row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.parse-row .cols { display: flex; gap: 11px; color: var(--text-2); font-size: 12px; white-space: nowrap; }

.video-box { border-radius: var(--radius); overflow: hidden; background: #0b1020; border: 1px solid var(--border); }
.video-box video { display: block; width: 100%; max-height: 320px; background: #0b1020; }
.video-cap {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px;
  background: var(--surface-2); font-size: 12px; color: var(--text-2);
}

.pilot-flag {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
  background: linear-gradient(135deg, var(--purple), var(--pri)); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: .01em;
}
.pilot-box { border: 1px solid var(--pri-line); background: var(--pri-soft); border-radius: var(--radius); padding: 12px 13px; }
.pilot-play {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: var(--radius-sm);
  background: var(--surface-3); font-size: 12.5px; cursor: pointer; border: 1px solid var(--border);
}
.pilot-play:hover { border-color: var(--pri); }
.gift-src { font-size: 10.5px; padding: 2px 7px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }

/* ============================== 大屏 ============================== */
.kpi-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.panel-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }
@media (max-width: 900px) { .panel-2 { grid-template-columns: 1fr; } }
.panel-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 900px) { .panel-3 { grid-template-columns: 1fr; } }

.scroll-x { overflow-x: auto; padding-bottom: 4px; }
.pill-nav { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 2px; }
.pill {
  padding: 6px 13px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface);
  font-size: 12.5px; font-weight: 600; color: var(--text-2); cursor: pointer; white-space: nowrap;
}
.pill.active { background: var(--pri); border-color: var(--pri); color: #fff; }

.ai-out { font-size: 13.5px; line-height: 1.75; }
.ai-out h3 { font-size: 14.5px; margin: 14px 0 6px; }
.ai-out h3:first-child { margin-top: 0; }
.ai-out h4 { font-size: 13.5px; margin: 12px 0 5px; }
.ai-out ul, .ai-out ol { margin: 6px 0; padding-left: 20px; }
.ai-out li { margin: 3px 0; }
.ai-out strong { font-weight: 700; }
.ai-out code { background: var(--surface-3); padding: 1px 5px; border-radius: 5px; font-family: var(--mono); font-size: 12px; }
.ai-out hr { border: none; border-top: 1px dashed var(--border-2); margin: 14px 0; }
.caret::after { content: "▍"; animation: blink 1s step-end infinite; color: var(--pri); }
@keyframes blink { 50% { opacity: 0 } }

/* ==========================================================================
   兑换完成弹窗
   —— 收银现场最需要看清的是「还剩几次」，所以把它做成整个弹窗的视觉主角。
   ========================================================================== */
.rd-hero { text-align: center; padding: 2px 0 4px; }
.rd-hero .ic { display: block; font-size: 40px; line-height: 1; }
.rd-hero .t { font-size: 16px; font-weight: 700; margin-top: 8px; color: var(--text); }
.rd-hero .s { font-size: 12.5px; color: var(--text-3); margin-top: 6px; line-height: 1.65; }

.rd-rest {
  margin-top: 14px; padding: 15px 18px; text-align: center;
  border-radius: var(--radius); border: 1px solid var(--pri-line);
  background: linear-gradient(135deg, var(--pri-soft), var(--surface) 72%);
}
.rd-rest .lbl { font-size: 12.5px; color: var(--text-2); }
.rd-rest .val {
  font-size: 40px; font-weight: 800; line-height: 1.12; letter-spacing: -.03em;
  color: var(--pri-dark); margin-top: 4px;
}
.rd-rest .val small { font-size: 15px; font-weight: 600; color: var(--text-3); margin-left: 4px; }
.rd-rest .tip { font-size: 12px; color: var(--text-3); margin-top: 7px; }
.rd-rest.low { border-color: #f4d59a; background: linear-gradient(135deg, var(--warn-soft), var(--surface) 72%); }
.rd-rest.low .val { color: #a86a06; }
.rd-rest.low .tip { color: #a86a06; font-weight: 600; }

.rd-coin {
  margin-top: 12px; padding: 11px 14px; text-align: center;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2);
  font-size: 13px; color: var(--text-2);
}
.rd-coin b { color: var(--text); font-weight: 700; }

@media (max-width: 720px) {
  .rd-rest .val { font-size: 34px; }
}

/* ==========================================================================
   手机端优化（运营端优先）
   运营端是店员拿手机跑收银的现场工具，以下规则只在窄屏生效，桌面端不受影响。
   ========================================================================== */

/* 触控反馈：去掉点击蓝框、消除双击缩放带来的 300ms 延迟 */
.btn, .nav-item, .tab, .seg .item, .pill, .acc, .item.clickable, .cash-tile, .switch, .dropzone, .pilot-play {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 720px) {
  /* --- 顶栏：门店名不再被「业务日」挤成只剩一个图标 --- */
  .topbar { gap: 8px; padding: 0 12px; }
  .topbar .biz-date { display: none; }
  .topbar .store-chip { flex: 1 1 auto; min-width: 0; max-width: none; }

  /* --- 卡片头部：标题保持完整一行，副标题自然折到第二行 --- */
  .card-hd { flex-wrap: wrap; row-gap: 3px; }
  .card-hd h3 { flex: 0 0 auto; }
  /* 右上操作区：允许占满剩余宽度并自行折行 —— 否则多于 1 颗按钮时
     （如活动卡的「会员活跃度指标 / 调整活动方案 / 取消本次活动」）会被 .card 的
     overflow 裁掉右半边（文档 scrollWidth 不变，所以横向溢出检测发现不了）。 */
  .card-hd .right { flex: 1 1 auto; min-width: 0; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; }

  /* --- 表单控件 16px：低于 16px 时 iOS 聚焦会强制放大整页 --- */
  .input, .select, .textarea { font-size: 16px; }

  /* --- 分段控件超过一行时横向滚动，避免把整页撑宽 --- */
  .seg:not(.scroll) { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .seg:not(.scroll)::-webkit-scrollbar, .seg.scroll::-webkit-scrollbar { display: none; }
  .seg .item { flex: 0 0 auto; }

  /* --- 可点选项：补上「当前已选中」的视觉反馈（原来点完没有任何变化） --- */
  .acc { min-height: 52px; }
  .acc.active { border-color: var(--pri); background: var(--pri-soft); box-shadow: 0 0 0 2px rgba(59, 110, 246, .13); }
  .acc.active .b b { color: var(--pri-dark); }

  /* --- 带操作按钮的列表行：按钮折到第二行，不再和说明文字挤在一行 --- */
  .item.cta-wrap { flex-wrap: wrap; row-gap: 9px; }
  .item.cta-wrap .ic { align-self: flex-start; }
  .item.cta-wrap .body { flex: 1 1 calc(100% - 47px); }
  .item.cta-wrap .tail { margin-left: 47px; flex: 1 1 auto; text-align: left; }
  .item.cta-wrap .tail .m { font-size: 13px; }
  .item.cta-wrap .btn { flex: 0 0 auto; }

  /* --- 列表右侧副信息换行：手机上「¥33 提成 ¥0.99」会粘成一串 --- */
  .item .tail .n { display: block; }

  /* --- 表格转卡片：空单元格不再占一整行，合计行加底色便于区分 --- */
  .tbl.responsive td:empty { display: none; }
  .tbl.responsive tfoot tr { background: var(--surface-3); }
  .tbl.responsive tfoot td::before { color: var(--text-2); }

  /* --- 小按钮加大到适合手指点按 --- */
  .btn-sm { padding: 8px 13px; }

  /* --- 底部标签条留出全面屏手势区，Toast 不被压住 --- */
  .toasts { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 16px); }
}

/* 超窄屏（iPhone SE / 小屏安卓）再让一步：品牌名收起，只留 logo */
@media (max-width: 420px) {
  .topbar .brand-mark > span:not(.logo) { display: none; }
  .stat .val { font-size: 19px; }
}

.print-only { display: none; }
@media print {
  .side, .tabbar, .topbar, .page-hd .right, .btn { display: none !important; }
  .main { margin: 0; padding: 0; }
  .print-only { display: block; }
}
