/* 商家后台 · 基础：色板、字体、按钮、表单、标签、表格、弹窗、抽屉、提示 */
:root {
  --bg: #F3ECE3;
  --bg-deep: #EBE1D5;
  --surface: #FFFFFF;
  --surface-2: #FAF6F1;
  --ink: #1F1A17;
  --ink-2: #6E645C;
  --ink-3: #A99F96;
  --line: #EEE6DC;
  --line-2: #E2D8CB;
  --brand: #8A6A4F;
  --brand-soft: #EFE5DA;
  --accent: #E5671F;
  --accent-soft: #FDEADB;
  --price: #D9483B;
  --price-soft: #FBE6E2;
  --ok: #4F7A5A;
  --ok-soft: #E3EEE5;
  --warn-soft: #FFF0CF;
  --slate: #5B6F82;
  --slate-soft: #E4EAF0;

  --shadow: 0 4px 16px rgba(74, 52, 34, 0.08);
  --shadow-lg: 0 18px 48px rgba(74, 52, 34, 0.18);
  --r: 16px;

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  --num: "DIN Alternate", "DIN Condensed", "Bahnschrift", "SF Mono", ui-monospace, "Roboto Mono", Menlo, Consolas, monospace;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
[v-cloak] { display: none; }
#print-root { display: none; }
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
code { font-family: var(--mono); font-size: 0.92em; background: var(--brand-soft); color: var(--brand); padding: 1px 6px; border-radius: 6px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
::selection { background: var(--accent-soft); }

.num { font-family: var(--num); font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.mono { font-family: var(--mono); }
.eyebrow { font: 600 11px/1 var(--mono); letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); }
.eyebrow.light { color: rgba(243, 236, 227, 0.6); }
.dim { color: var(--ink-2); }
.sm { font-size: 12.5px; }
.r { text-align: right; }
.neg { color: var(--price); }
.price { color: var(--price); }
.grow { flex: 1; }
.ico { flex: none; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 18px; border-radius: 999px;
  border: 1.5px solid transparent; background: var(--surface);
  font-weight: 600; font-size: 15px; white-space: nowrap;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.12s, box-shadow 0.18s;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; }
.btn-sm { height: 32px; padding: 0 14px; font-size: 14px; }
.btn-lg { height: 48px; padding: 0 26px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-ink { background: var(--ink); color: #FFF7EE; }
.btn-ink:hover:not(:disabled) { background: #3A312B; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover:not(:disabled) { background: #CF5A16; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-ok:hover:not(:disabled) { background: #416949; }
.btn-ghost { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.btn-soft { background: var(--brand-soft); color: var(--brand); }
.btn-soft:hover:not(:disabled) { background: #E6D8C8; }
.btn-text { background: transparent; color: var(--brand); padding: 0 10px; }
.btn-text:hover:not(:disabled) { background: var(--brand-soft); }
.btn-text.danger { color: var(--price); }
.btn-danger-ghost { background: var(--surface); border-color: #EDC4BE; color: var(--price); }
.btn-danger-ghost:hover:not(:disabled) { background: var(--price-soft); }
.btn-danger-solid { background: var(--price); color: #fff; }
.btn-danger-solid:hover:not(:disabled) { background: #BF3A2E; }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px;
  border: 0; background: transparent; color: var(--ink-2); transition: background 0.15s, color 0.15s;
}
.icon-btn:hover:not(:disabled) { background: var(--brand-soft); color: var(--ink); }
.icon-btn:disabled { opacity: 0.3; }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 10px; }
.icon-btn.xs { width: 28px; height: 28px; border-radius: 8px; }
.icon-btn.danger:hover:not(:disabled) { background: var(--price-soft); color: var(--price); }
.icon-btn.ok { color: var(--ok); }
.icon-btn.ok:hover:not(:disabled) { background: var(--ok-soft); color: var(--ok); }

.chip-btn {
  height: 32px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--line-2); background: var(--surface);
  font-size: 13.5px; color: var(--ink-2); transition: all 0.15s;
}
.chip-btn:hover { border-color: var(--brand); color: var(--brand); }
.chip-btn.on { background: var(--ink); border-color: var(--ink); color: #FFF7EE; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.inline { flex-direction: row; align-items: center; gap: 10px; }
.lab { font-size: 13.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.lab .req { font-style: normal; font-weight: 500; font-size: 12px; color: var(--accent); margin-left: 4px; }
.hint { font-size: 13px; color: var(--ink-3); line-height: 1.5; }
.input, .select, .textarea {
  width: 100%; height: 42px; padding: 0 14px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--surface-2); outline: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.textarea { height: auto; padding: 10px 14px; resize: vertical; line-height: 1.55; }
.select { appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236E645C' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-2); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(138, 106, 79, 0.15); }
.input:disabled { opacity: 0.55; cursor: not-allowed; }
.input-lg { height: 50px; font-size: 16px; }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.form-stack { display: flex; flex-direction: column; gap: 16px; }
.form-err { color: var(--price); font-size: 14px; font-weight: 500; margin-top: 8px; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
input[type="number"] { -moz-appearance: textfield; }
.search-box { position: relative; display: flex; align-items: center; }
.search-box .ico { position: absolute; left: 13px; color: var(--ink-3); pointer-events: none; }
.search-box .input { padding-left: 40px; }

/* ---------- 开关 ---------- */
.sw { width: 46px; height: 28px; border-radius: 14px; border: 0; background: #D8CFC4; position: relative; padding: 0; flex: none; transition: background 0.2s; }
.sw i { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(31, 26, 23, 0.3); transition: transform 0.22s cubic-bezier(0.3, 0.9, 0.3, 1); }
.sw.on { background: var(--ok); }
.sw.on i { transform: translateX(18px); }
.sw:disabled { opacity: 0.5; }

/* ---------- 标签 ---------- */
.st { display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.st-gray { background: var(--bg-deep); color: var(--ink-2); }
.st-accent { background: var(--accent-soft); color: #C2560F; }
.st-brand { background: var(--brand-soft); color: var(--brand); }
.st-ok { background: var(--ok-soft); color: var(--ok); }
.st-done { background: #EAF1EB; color: #5E8468; }
.st-slate { background: var(--slate-soft); color: var(--slate); }
.st-danger { background: var(--price-soft); color: var(--price); }

.mode-tag { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 8px; font-size: 13.5px; font-weight: 600; white-space: nowrap; background: var(--brand-soft); color: var(--brand); }
.mode-tag.m-delivery { background: var(--slate-soft); color: var(--slate); }
.mode-tag.m-takeaway { background: var(--warn-soft); color: #9A6A12; }

.pay-badge { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.pay-badge.mock { background: var(--warn-soft); color: #9A6A12; border: 1.5px dashed #E0B866; }
.pay-badge.wx { background: var(--ok-soft); color: var(--ok); border: 1.5px solid #B8D2BE; }
.pay-badge.big { height: 34px; padding: 0 16px; font-size: 15px; }

/* ---------- 卡片 ---------- */
.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 0; }
.card-h h3 { font-size: 17px; font-weight: 700; }
.link { display: inline-flex; align-items: center; gap: 2px; color: var(--brand); font-weight: 600; font-size: 14.5px; }
.link:hover { color: var(--ink); }

/* ---------- 表格 ---------- */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { text-align: left; font-weight: 600; font-size: 13px; color: var(--ink-3); padding: 14px 16px; white-space: nowrap; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; }
.tbl td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th.r, .tbl td.r { text-align: right; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl-click tbody tr { cursor: pointer; transition: background 0.12s; }
.tbl-click tbody tr:hover, .tbl-click tbody tr:focus-visible { background: var(--surface-2); outline: none; }
.tbl tbody.dim { opacity: 0.5; }

/* ---------- 分页 ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 18px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-2); }
.pager-btns { display: flex; align-items: center; gap: 6px; }
.pg { min-width: 36px; height: 36px; padding: 0 12px; border-radius: 10px; border: 1.5px solid var(--line-2); background: var(--surface); font-weight: 600; transition: all 0.15s; }
.pg:hover:not(:disabled):not(.on) { border-color: var(--brand); color: var(--brand); }
.pg.on { background: var(--ink); border-color: var(--ink); color: #FFF7EE; }
.pg:disabled { opacity: 0.4; }
.pg-gap { color: var(--ink-3); padding: 0 2px; }

/* ---------- 分段选择 ---------- */
.seg { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--bg-deep); gap: 2px; }
.seg button { height: 36px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent; font-weight: 600; color: var(--ink-2); display: inline-flex; align-items: center; gap: 8px; transition: all 0.18s; }
.seg button:hover:not(.on) { color: var(--ink); }
.seg button.on { background: var(--ink); color: #FFF7EE; box-shadow: 0 2px 8px rgba(31, 26, 23, 0.25); }
.seg-lg button { height: 44px; padding: 0 26px; font-size: 16px; }
.seg em { font-style: normal; font-size: 12.5px; opacity: 0.7; }

/* ---------- 空状态 / 加载失败 ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 56px 24px; gap: 6px; }
.empty-ico { width: 60px; height: 60px; border-radius: 20px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 8px; }
.empty-t { font-size: 17px; font-weight: 700; }
.empty-s { color: var(--ink-2); max-width: 320px; }
.empty-a { margin-top: 12px; }
.empty-a:empty { display: none; }
.load-err { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px 24px; text-align: center; color: var(--price); font-weight: 500; }
.load-err.inline { padding: 40px 24px; }

/* ---------- 遮罩 / 弹窗 / 抽屉 ---------- */
.mask { position: fixed; inset: 0; z-index: 100; background: rgba(31, 26, 23, 0.46); display: flex; align-items: center; justify-content: center; padding: 24px; }
.mask-right { justify-content: flex-end; padding: 0; }
/* 居中弹窗（确认框、退款、改密码）要盖在右侧抽屉之上，否则抽屉里弹出的确认框会被压在后面点不到 */
.mask:not(.mask-right) { z-index: 110; }
.modal { max-width: 100%; max-height: calc(100vh - 48px); display: flex; flex-direction: column; background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg); }
.modal-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 20px 4px 26px; }
.modal-h h3 { font-size: 19px; font-weight: 700; margin-top: 6px; }
.modal-h .eyebrow { margin-top: 2px; }
.modal-b { padding: 12px 26px 8px; overflow: auto; }
.modal-f { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 26px 22px; }
.confirm-msg { color: var(--ink-2); line-height: 1.65; font-size: 15.5px; }

.drawer { height: 100vh; max-width: 100vw; display: flex; flex-direction: column; background: var(--bg); box-shadow: var(--shadow-lg); }
.drawer-h { display: flex; align-items: flex-start; justify-content: space-between; padding: 20px 18px 14px 26px; background: var(--surface); border-bottom: 1px solid var(--line); }
.drawer-h h3 { font-size: 19px; font-weight: 700; margin-top: 6px; }
.drawer-b { flex: 1; overflow-y: auto; padding: 18px 22px 24px; }
.drawer-f { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 22px; background: var(--surface); border-top: 1px solid var(--line); }
.drawer-tip { padding: 40px 24px; text-align: center; color: var(--ink-2); display: flex; flex-direction: column; align-items: center; gap: 12px; }

.fade-enter-active, .fade-leave-active { transition: opacity 0.22s ease; }
.fade-enter-from, .fade-leave-to { opacity: 0; }
.fade-enter-active .modal, .fade-leave-active .modal { transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
.fade-enter-from .modal, .fade-leave-to .modal { transform: translateY(14px) scale(0.98); }
.slide-enter-active, .slide-leave-active { transition: opacity 0.24s ease; }
.slide-enter-from, .slide-leave-to { opacity: 0; }
.slide-enter-active .drawer, .slide-leave-active .drawer { transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
.slide-enter-from .drawer, .slide-leave-to .drawer { transform: translateX(48px); }
.pop-enter-active, .pop-leave-active { transition: opacity 0.16s ease, transform 0.18s ease; }
.pop-enter-from, .pop-leave-to { opacity: 0; transform: translateY(-6px); }

/* ---------- 提示 ---------- */
.toasts { position: fixed; z-index: 300; top: 84px; left: calc(50% + 108px); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 10px; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 14px; background: var(--ink); color: #FFF7EE; font-weight: 500; box-shadow: var(--shadow-lg); max-width: 560px; }
.toast .ico { flex: none; }
.t-ok .ico { color: #8FCB9B; }
.t-err { background: #7A2A22; }
.t-err .ico { color: #FFB4A8; }
.t-info .ico { color: #F2B27F; }
.toast-enter-active, .toast-leave-active { transition: all 0.26s cubic-bezier(0.2, 0.8, 0.2, 1); }
.toast-enter-from { opacity: 0; transform: translateY(-14px) scale(0.96); }
.toast-leave-to { opacity: 0; transform: translateY(-8px); }

@media (max-width: 1180px) { .toasts { left: calc(50% + 39px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
