/* 邻里小卖部 · 商家后台 · 基础：色板、字体、按钮、表单、标签、表格、弹窗、抽屉、提示
 * 色板来自 docs/开发约定.md 第四节：招牌黄 / 墨黑 / 货架灰 / 价签红。 */
:root {
  --bg: #F2F2F0;            /* 货架灰：页面底色 */
  --bg-deep: #E8E7E3;       /* 比底色再深一档：分段控件的槽、灰色标签 */
  --surface: #FFFFFF;
  --surface-2: #F7F7F5;     /* 输入框、表头、分类侧栏 */
  --ink: #1C1B19;           /* 墨黑：主文字、深色按钮、侧边栏 */
  --ink-2: #67625B;
  --ink-3: #A9A49C;         /* 占位、禁用、装饰 */
  --mute: #6B665F;          /* 说明小字（对白底和浅灰底的对比度都达到 4.5:1，小字号也看得清） */
  --line: #ECEAE6;
  --line-2: #DAD7D1;

  --brand: #FFE04B;         /* 招牌黄：主按钮、选中态 */
  --brand-hover: #FFD92E;
  --brand-deep: #F2C200;    /* 按下、描边、黄底上的强调 */
  --brand-soft: #FFF6D6;    /* 浅黄底：提示条、待处理 */
  --brand-ink: #A8781E;     /* 浅黄底上的文字（大字号） */
  --brand-text: #7A5410;    /* 浅黄底上的小字（对比度够） */

  --price: #FF4A26;         /* 价签红：价格、重点数字 */
  --price-deep: #D9360F;    /* 红色小字、报错文字（对比度够） */
  --price-soft: #FFEDE8;
  --price-ink: #B92B0A;     /* 浅红底（价签红的 10% 浅色）上的文字 */
  --ok: #22A06B;
  --ok-deep: #17794F;
  --ok-soft: #E1F4EA;
  --slate: #3F5168;         /* 已发货、待自提这类「在路上、等顾客」 */
  --slate-soft: #E8EDF3;

  --shadow: 0 3px 12px rgba(28, 27, 25, 0.06);
  --shadow-lg: 0 18px 48px rgba(28, 27, 25, 0.2);
  --r-card: 14px;
  --r-btn: 10px;
  --r-input: 10px;

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  --num: "DIN Alternate", "DIN Condensed", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  --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: 14px/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(--bg-deep); color: var(--ink); padding: 1px 6px; border-radius: 5px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
::selection { background: var(--brand); color: var(--ink); }

/* 数字、价格：DIN 风格 + 等宽数字，列表里竖着对齐 */
.num { font-family: var(--num); font-variant-numeric: tabular-nums; font-weight: 700; letter-spacing: 0.01em; }
.mono { font-family: var(--mono); }
.dim { color: var(--ink-2); }
.mute { color: var(--mute); }
.sm { font-size: 12.5px; }
.r { text-align: right; }
.neg { color: var(--price-deep); }
.price { color: var(--price-deep); }          /* 小号价格用深一档的价签红，保证对比度；大号数字再用 --price */
.grow { flex: 1; }
.ico { flex: none; }
.yen { font-family: var(--num); font-weight: 700; font-size: 0.55em; margin-right: 1px; }
.req { font-style: normal; font-weight: 500; font-size: 12px; color: var(--price-deep); margin-left: 4px; }
.opt { font-style: normal; font-weight: 400; font-size: 12px; color: var(--mute); margin-left: 4px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 40px; padding: 0 18px; border-radius: var(--r-btn);
  border: 1px solid transparent; background: var(--surface);
  font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: background 0.16s, border-color 0.16s, color 0.16s, transform 0.12s, box-shadow 0.16s;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 48px; padding: 0 26px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-brand { background: var(--brand); color: var(--ink); }
.btn-brand:hover:not(:disabled) { background: var(--brand-hover); }
.btn-brand:active:not(:disabled) { background: var(--brand-deep); }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover:not(:disabled) { background: #3A3835; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-ok:hover:not(:disabled) { background: var(--ok-deep); }
.btn-ghost { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover:not(:disabled) { border-color: var(--ink); }
.btn-soft { background: var(--brand-soft); color: var(--brand-text); }
.btn-soft:hover:not(:disabled) { background: #FFEFB8; }
.btn-text { background: transparent; color: var(--ink); padding: 0 10px; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.btn-text:hover:not(:disabled) { background: var(--bg-deep); text-decoration-color: transparent; }
.btn-text.danger { color: var(--price-deep); }
.btn-danger-ghost { background: var(--surface); border-color: #F2C3B8; color: var(--price-deep); }
.btn-danger-ghost:hover:not(:disabled) { background: var(--price-soft); border-color: var(--price); }
.btn-danger-solid { background: var(--price-deep); color: #fff; }
.btn-danger-solid:hover:not(:disabled) { background: #B92B0A; }

.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px;
  border: 0; background: transparent; color: var(--ink-2); transition: background 0.15s, color 0.15s;
}
.icon-btn:hover:not(:disabled) { background: var(--bg-deep); color: var(--ink); }
.icon-btn:disabled { opacity: 0.3; }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 8px; }
.icon-btn.xs { width: 26px; height: 26px; border-radius: 7px; }
.icon-btn.danger:hover:not(:disabled) { background: var(--price-soft); color: var(--price-deep); }
.icon-btn.ok { color: var(--ok-deep); }
.icon-btn.ok:hover:not(:disabled) { background: var(--ok-soft); color: var(--ok-deep); }

.chip-btn {
  height: 30px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface);
  font-size: 13px; font-weight: 500; color: var(--ink-2); transition: all 0.15s; white-space: nowrap;
}
.chip-btn:hover { border-color: var(--ink); color: var(--ink); }
.chip-btn.on { background: var(--brand); border-color: var(--brand); color: var(--ink); font-weight: 600; }
.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: 13px; font-weight: 600; color: var(--ink-2); }
.hint { font-size: 12.5px; color: var(--mute); line-height: 1.55; }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: var(--r-input);
  border: 1px solid var(--line-2); background: var(--surface); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.55; }
.select { appearance: none; padding-right: 34px; 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='%2367625B' 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 11px center; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-3); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(255, 224, 75, 0.7); }
.input:disabled, .select:disabled, .textarea:disabled { background: var(--surface-2); color: var(--ink-3); cursor: not-allowed; }
.input[readonly] { background: var(--surface-2); }
.input.bad, .select.bad, .textarea.bad { border-color: var(--price); box-shadow: 0 0 0 3px var(--price-soft); }
.input-lg { height: 48px; 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-deep); font-size: 13.5px; font-weight: 600; margin-top: 8px; line-height: 1.5; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button, input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.search-box { position: relative; display: flex; align-items: center; }
.search-box .ico { position: absolute; left: 12px; color: var(--ink-3); pointer-events: none; }
.search-box .input { padding-left: 38px; }
.with-unit { position: relative; }
.with-unit .input { padding-right: 34px; }
.with-unit > i { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 13px; color: var(--mute); pointer-events: none; }
.with-pre { position: relative; }
.with-pre .input { padding-left: 28px; }
.with-pre > i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 13px; color: var(--mute); pointer-events: none; font-family: var(--num); font-weight: 700; }
.count { align-self: flex-end; font-size: 12px; color: var(--mute); font-family: var(--num); }

/* ---------- 开关 ---------- */
.sw { width: 42px; height: 24px; border-radius: 12px; border: 0; background: #CFCCC5; position: relative; padding: 0; flex: none; transition: background 0.2s; }
.sw i { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(28, 27, 25, 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; gap: 5px; height: 24px; padding: 0 9px; border-radius: 7px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.st-gray { background: var(--bg-deep); color: #5F5A53; }
.st-todo { background: var(--brand); color: var(--ink); }
.st-soft { background: var(--brand-soft); color: var(--brand-text); }
.st-slate { background: var(--slate-soft); color: var(--slate); }
.st-ok { background: var(--ok-soft); color: var(--ok-deep); }
.st-danger { background: var(--price-soft); color: var(--price-ink); }
.st-dark { background: var(--ink); color: #fff; }
.st i.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.mode-tag { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px 0 7px; border-radius: 7px; font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--bg-deep); color: var(--ink-2); }
.mode-tag.m-delivery { background: var(--slate-soft); color: var(--slate); }
.mode-tag.m-pickup { background: var(--brand-soft); color: var(--brand-text); }

.pay-badge { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 7px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.pay-badge.mock { background: var(--brand-soft); color: var(--brand-text); border: 1px dashed #E0B866; }
.pay-badge.wx { background: var(--ok-soft); color: var(--ok-deep); border: 1px solid #B6DEC8; }
.pay-badge.big { height: 32px; padding: 0 14px; font-size: 14px; }

/* ---------- 卡片 ---------- */
.card { background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 0; }
.card-h h2 { font-size: 16px; font-weight: 700; }
.card-h .sub { font-size: 12.5px; color: var(--mute); font-weight: 400; margin-left: 8px; }
.link { display: inline-flex; align-items: center; gap: 2px; color: var(--ink); font-weight: 600; font-size: 13.5px; text-decoration: underline; text-decoration-color: var(--brand-deep); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.link:hover { text-decoration-color: var(--ink); }

/* ---------- 表格 ---------- */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--mute); padding: 11px 16px; white-space: nowrap; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.tbl th:first-child { border-top-left-radius: 10px; }
.tbl th:last-child { border-top-right-radius: 10px; }
.tbl td { padding: 12px 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; transition: opacity 0.15s; }

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

/* ---------- 分段选择 ---------- */
.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--bg-deep); gap: 2px; }
.seg button { height: 32px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; font-weight: 600; font-size: 13.5px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; transition: all 0.16s; }
.seg button:hover:not(.on) { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(28, 27, 25, 0.14); }
.seg em { font-style: normal; font-size: 12px; opacity: 0.7; font-family: var(--num); font-weight: 700; }

/* ---------- 空状态 / 加载 / 出错 ---------- */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 52px 24px; gap: 6px; }
.empty-ico { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-text); margin-bottom: 8px; }
.empty-t { font-size: 16px; font-weight: 700; }
.empty-s { color: var(--ink-2); max-width: 340px; line-height: 1.6; }
.empty-a { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.empty-a:empty { display: none; }
.load-err { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 44px 24px; text-align: center; }
.load-err .le-ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--price-soft); color: var(--price-deep); }
.load-err p { color: var(--ink); font-weight: 600; max-width: 420px; line-height: 1.55; }
.load-err small { color: var(--mute); font-size: 13px; max-width: 420px; line-height: 1.5; margin-top: -6px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 56px 24px; color: var(--ink-2); font-weight: 500; }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--bg-deep); border-top-color: var(--ink); animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 头像 / 缩略图 ---------- */
.thumb { position: relative; flex: none; display: grid; place-items: center; overflow: hidden; background: var(--bg-deep); color: var(--ink-3); }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar-i { position: relative; flex: none; display: inline-grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--brand); color: var(--ink); font-weight: 700; font-family: var(--num); }
.avatar-i img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ---------- 遮罩 / 弹窗 / 抽屉 ---------- */
.mask { position: fixed; inset: 0; z-index: 100; background: rgba(28, 27, 25, 0.5); 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: 18px; box-shadow: var(--shadow-lg); outline: none; }
.modal-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 16px 4px 24px; }
.modal-h h2 { font-size: 18px; font-weight: 700; margin-top: 4px; }
.modal-h .sub { font-size: 13px; color: var(--mute); margin-top: 2px; }
.modal-b { padding: 12px 24px 8px; overflow: auto; }
.modal-f { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px 20px; }
.confirm-msg { color: var(--ink-2); line-height: 1.7; font-size: 14.5px; white-space: pre-line; }

.drawer { height: 100vh; max-width: 100vw; display: flex; flex-direction: column; background: var(--bg); box-shadow: var(--shadow-lg); outline: none; }
.drawer-h { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 14px 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
.drawer-h h2 { font-size: 17px; font-weight: 700; }
.drawer-h .sub { font-size: 12.5px; color: var(--mute); margin-top: 1px; }
.drawer-b { flex: 1; overflow-y: auto; padding: 18px 20px 24px; }
.drawer-f { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 12px 20px; 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; }

.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: 80px; right: 24px; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 11px 14px 11px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 500; box-shadow: var(--shadow-lg); max-width: 460px; pointer-events: auto; }
.toast .ico { flex: none; }
.toast .t-act { margin-left: 6px; flex: none; height: 28px; padding: 0 12px; border: 0; border-radius: 7px; background: var(--brand); color: var(--ink); font-weight: 700; font-size: 13px; }
.toast .t-act:hover { background: var(--brand-hover); }
.t-ok .ico { color: #7BE0AA; }
.t-err { background: #8A2410; }
.t-err .ico { color: #FFB9A8; }
.t-info .ico { color: var(--brand); }
.t-new { padding: 14px 14px 14px 16px; border-left: 5px solid var(--brand); }
.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: translateX(30px); }
.toast-leave-to { opacity: 0; transform: translateX(20px); }

@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; }
}
