/* 门店管理后台 · 视觉规范（沿用小程序品牌色：深海蓝 #0A5C85 / 珊瑚橙 #C2410C） */
:root {
  --brand: #0A5C85;
  --brand-d: #084A6B;
  --accent: #C2410C;
  --bg: #F4F7F9;
  --card: #FFFFFF;
  --line: #E3E9EE;
  --text: #1B2733;
  --muted: #6B7C8D;
  --ok: #1E8E57;
  --warn: #C2410C;
  --radius: 12px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}
.hidden { display: none !important; }
.ta-r { text-align: right; }

/* ---------- 登录 ---------- */
.login-mask {
  position: fixed; inset: 0; background: linear-gradient(160deg, #084A6B 0%, #0A5C85 60%, #1276A5 100%);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.login-box {
  width: 340px; background: #fff; border-radius: 16px; padding: 32px 26px;
  box-shadow: 0 18px 48px rgba(8, 74, 107, .28);
}
.login-title { font-size: 19px; font-weight: 700; color: var(--brand); }
.login-sub { font-size: 11px; color: var(--muted); letter-spacing: .5px; margin-bottom: 22px; }
.login-input {
  width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 8px;
  padding: 0 12px; font-size: 14px; outline: none;
}
.login-input:focus { border-color: var(--brand); }
.login-err { color: var(--warn); font-size: 12px; min-height: 18px; margin: 8px 0 4px; }
.login-tip { margin-top: 14px; font-size: 11px; color: var(--muted); text-align: center; }

/* ---------- 按钮 ---------- */
.btn {
  border: 1px solid var(--line); background: #fff; color: var(--text);
  border-radius: 8px; padding: 8px 16px; font-size: 13px; cursor: pointer;
  font-family: inherit; transition: .15s;
}
.btn:hover { border-color: var(--brand); color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-d); color: #fff; }
.btn.danger:hover { border-color: var(--warn); color: var(--warn); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.block { width: 100%; margin-top: 6px; height: 42px; font-size: 15px; }

/* ---------- 布局 ---------- */
.app { min-height: 100vh; }
.topbar {
  height: 56px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 24px; padding: 0 20px;
  position: sticky; top: 0; z-index: 20;
}
.brand-name { font-size: 16px; font-weight: 700; color: var(--brand); }
.brand-en { font-size: 10px; color: var(--muted); letter-spacing: 2px; margin-left: 6px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav-item {
  background: none; border: none; font-family: inherit; font-size: 14px; color: var(--muted);
  padding: 6px 14px; border-radius: 8px; cursor: pointer;
}
.nav-item.active { background: #E8F1F6; color: var(--brand); font-weight: 600; }
.top-right { display: flex; align-items: center; gap: 10px; }
.sync-at { font-size: 11px; color: var(--muted); }
.main { padding: 20px; max-width: 1180px; margin: 0 auto; }

/* ---------- 卡片 ---------- */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px;
}
.card .k { font-size: 12px; color: var(--muted); }
.card .v { font-size: 26px; font-weight: 700; color: var(--brand); margin-top: 4px; }
.card .v.accent { color: var(--accent); }
.accent { color: var(--accent); font-weight: 600; }

.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 16px;
}
.panel-hd { display: flex; align-items: baseline; gap: 8px; margin-bottom: 14px; }
.pt { font-size: 15px; font-weight: 700; }
.pt-en { font-size: 10px; color: var(--muted); letter-spacing: 1.5px; }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; font-weight: 600; color: var(--muted); font-size: 12px;
  padding: 10px 8px; border-bottom: 1px solid var(--line);
}
.table td { padding: 11px 8px; border-bottom: 1px solid #F0F4F7; vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.gcell { display: flex; align-items: center; gap: 10px; }
.gthumb { width: 38px; height: 38px; border-radius: 8px; background: #EEF4F8; object-fit: cover; }
.gname { font-weight: 600; }
.gmeta { font-size: 11px; color: var(--muted); }

.tag { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; }
.tag.on { background: #E6F4EC; color: var(--ok); }
.tag.off { background: #F2F4F6; color: var(--muted); }
.tag.pay { background: #FDEBE1; color: var(--warn); }
.tag.ship { background: #E8F1F6; color: var(--brand); }
.tag.done { background: #E6F4EC; color: var(--ok); }

/* ---------- 工具栏 ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.input {
  height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px;
  font-size: 13px; font-family: inherit; outline: none; background: #fff; color: var(--text);
}
.input:focus { border-color: var(--brand); }
.toolbar .input { flex: 1; max-width: 260px; }
textarea.input { height: auto; padding: 8px 10px; line-height: 1.6; resize: vertical; }
.tabs { flex-wrap: wrap; }
.tab {
  background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 5px 14px;
  font-size: 12px; cursor: pointer; font-family: inherit; color: var(--muted);
}
.tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 12px; color: var(--muted); }
.field.full { grid-column: 1 / -1; margin-top: 14px; }
.field .input { width: 100%; }
.form-actions { margin-top: 18px; display: flex; align-items: center; gap: 12px; }
.msg { font-size: 12px; color: var(--ok); }
.note { margin-top: 10px; font-size: 11px; color: var(--muted); }

/* ---------- 图片上传 ---------- */
.img-row { display: flex; gap: 14px; align-items: flex-start; }
.img-prev {
  width: 108px; height: 108px; flex: none; border: 1px dashed var(--line); border-radius: 10px;
  background: #F7FAFC; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 12px; overflow: hidden; text-align: center; padding: 4px;
}
.img-prev img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
.img-acts { flex: 1; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.img-acts .input { width: 100%; }

/* ---------- 详情图 / 满减规则行 ---------- */
.dimg-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.dimg-item {
  position: relative; width: 92px; height: 92px; border: 1px solid #D7E3EA; border-radius: 10px;
  overflow: hidden; background: #F4F8FA; display: flex; align-items: center; justify-content: center;
}
.dimg-item img { width: 100%; height: 100%; object-fit: cover; }
.dimg-txt { font-size: 12px; color: #7A8B96; }
.dimg-x {
  position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; line-height: 18px;
  border: none; border-radius: 50%; background: rgba(35, 50, 59, .72); color: #fff;
  font-size: 14px; cursor: pointer; text-align: center; padding: 0;
}
.dimg-empty { font-size: 13px; color: #8FA3AE; padding: 12px 0; }
.rule-row { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #4A606C; }
.rule-in { width: 92px; display: inline-block; }

/* ---------- 横幅配图 ---------- */
.bimg-row { align-items: center; gap: 8px; }
.bthumb {
  width: 92px; height: 46px; flex: none; object-fit: cover;
  border: 1px solid #D7E3EA; border-radius: 8px; background: #F4F8FA;
}

/* ---------- 可增删的行式编辑（横幅/推荐/宫格/等级/时段/热词等） ---------- */
.stack-list { display: flex; flex-direction: column; gap: 10px; margin: 10px 0 4px; }
.srow {
  border: 1px solid var(--line); border-radius: 10px; background: #FAFCFD;
  padding: 10px 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.srow .slab { font-size: 12px; color: var(--muted); flex: none; }
.srow .grow { flex: 1; min-width: 130px; }
.srow .input { height: 32px; width: 100%; }
.srow .mini { width: 92px; flex: none; }
.srow .tiny { width: 72px; flex: none; }
.srow .color { width: 44px; height: 32px; padding: 2px; flex: none; }
.srow .switch {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 3px 10px; cursor: pointer; flex: none;
}
.srow .switch.on { border-color: var(--ok); color: var(--ok); background: #E6F4EC; }
.srow .ops { display: flex; gap: 6px; margin-left: auto; flex: none; }
.stack-empty { padding: 18px; text-align: center; color: var(--muted); font-size: 13px; border: 1px dashed var(--line); border-radius: 10px; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(12, 25, 36, .45); z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  width: 620px; max-width: 100%; max-height: 88vh; background: #fff; border-radius: 14px;
  display: flex; flex-direction: column; overflow: hidden;
}
.modal-hd {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--line); font-weight: 700;
}
.modal-hd .x { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--muted); }
.modal-bd { padding: 18px; overflow: auto; }
.modal-ft { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; align-items: center; }
.sm-select { height: 36px; }

.order-lines { margin: 10px 0; }
.ol-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.ol-total { display: flex; justify-content: space-between; font-weight: 700; margin-top: 10px; color: var(--brand); }
.kv { display: flex; gap: 8px; font-size: 13px; padding: 3px 0; }
.kv .k { color: var(--muted); width: 74px; flex: none; }

/* ---------- 待处理 ---------- */
.pending-list { display: flex; flex-direction: column; gap: 8px; }
.pl-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; background: #FAFCFD; border: 1px solid var(--line); border-radius: 10px; }
.empty { padding: 26px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
  background: #1B2733; color: #fff; padding: 10px 20px; border-radius: 8px; font-size: 13px; z-index: 99;
}

@media (max-width: 720px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 10px; }
  .nav { order: 3; width: 100%; overflow-x: auto; }
  .main { padding: 14px; }
}
