/* ============================================================
   土鸡蛋小铺 · 管理后台样式
   暖色蛋系主题，零依赖、纯原生 CSS
   ============================================================ */
:root {
  --primary: #ff8c42;
  --primary-2: #ffb347;
  --primary-soft: #fff3e8;
  --ink: #2f2a24;
  --ink-2: #6a6258;
  --ink-3: #9a8f80;
  --line: #efe7da;
  --line-2: #e6dccb;
  --bg: #f7f3ec;
  --card: #ffffff;
  --danger: #e8552b;
  --danger-soft: #fdede8;
  --success: #2ba84a;
  --success-soft: #e8f6ec;
  --info: #3a86ff;
  --info-soft: #e9f1ff;
  --warn: #f0a01e;
  --warn-soft: #fff4df;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(180, 140, 60, 0.10);
  --shadow-sm: 0 4px 14px rgba(180, 140, 60, 0.08);
  --sidebar-w: 232px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

button, input, select, textarea { font: inherit; color: inherit; }

a { cursor: pointer; }

/* ---------- 通用按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 999px; cursor: pointer;
  padding: 10px 22px; font-size: 14px; font-weight: 600;
  transition: transform .06s ease, box-shadow .2s ease, background .2s ease, opacity .2s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--primary-2), var(--primary)); color: #fff; box-shadow: 0 6px 16px rgba(255, 140, 66, .32); }
.btn-primary:hover { box-shadow: 0 8px 22px rgba(255, 140, 66, .42); }
.btn-ghost { background: #fff; color: var(--ink-2); border: 1px solid var(--line-2); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ============================================================
   登录视图
   ============================================================ */
.login-view {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px;
  background: radial-gradient(1200px 600px at 50% -10%, #fff6e9, var(--bg));
}
.login-card {
  width: 360px; max-width: calc(100vw - 40px);
  background: var(--card); border-radius: 22px; padding: 38px 34px 30px;
  box-shadow: var(--shadow); text-align: center;
}
.login-logo {
  width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 22px;
  display: flex; align-items: center; justify-content: center; font-size: 42px;
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  box-shadow: 0 10px 24px rgba(255, 140, 66, .35);
}
.login-title { font-size: 24px; font-weight: 800; letter-spacing: 1px; }
.login-sub { color: var(--ink-3); margin-top: 4px; margin-bottom: 24px; }
.login-field { display: block; text-align: left; margin-bottom: 18px; }
.login-field span { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 8px; font-weight: 600; }
.login-field input {
  width: 100%; padding: 13px 16px; border: 1.5px solid var(--line-2);
  border-radius: 12px; outline: none; transition: border .2s, box-shadow .2s; background: #fcfaf6;
}
.login-field input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); background: #fff; }
.login-btn { width: 100%; padding: 13px; font-size: 16px; letter-spacing: 4px; }
.login-hint { margin-top: 16px; font-size: 12px; color: var(--ink-3); }
.login-hint.error { color: var(--danger); font-weight: 600; }
.login-foot { color: var(--ink-3); font-size: 12px; }

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

/* ---------- 侧栏 ---------- */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; position: sticky; top: 0; height: 100vh;
  background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 22px 16px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 22px; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 12px; font-size: 22px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  box-shadow: 0 6px 14px rgba(255, 140, 66, .3);
}
.brand-text { font-weight: 800; font-size: 17px; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border-radius: 12px; color: var(--ink-2); font-weight: 600; font-size: 14.5px;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--primary-soft); color: var(--primary); }
.nav-item.active { background: linear-gradient(135deg, var(--primary-2), var(--primary)); color: #fff; box-shadow: 0 6px 16px rgba(255, 140, 66, .3); }
.nav-ico { font-size: 17px; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; padding-top: 14px; border-top: 1px solid var(--line); }
.nav-logout:hover { background: var(--danger-soft); color: var(--danger); }

/* ---------- 主区 ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 30px; background: var(--bg); position: sticky; top: 0; z-index: 5;
  border-bottom: 1px solid var(--line);
}
.page-title { font-size: 22px; font-weight: 800; }
.page-sub { color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.today { color: var(--ink-2); font-size: 13px; background: #fff; padding: 8px 14px; border-radius: 999px; box-shadow: var(--shadow-sm); }
.content { padding: 26px 30px 40px; }

/* ---------- 移动端菜单按钮 / 抽屉遮罩 ---------- */
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.menu-btn {
  display: none; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
  font-size: 20px; line-height: 1; color: var(--ink-2); background: #fff;
  border: 1px solid var(--line); box-shadow: var(--shadow-sm); cursor: pointer;
  transition: color .15s, border-color .15s;
}
.menu-btn:hover { color: var(--primary); border-color: var(--primary); }
.sidebar-overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .35);
  opacity: 0; visibility: hidden; transition: opacity .2s; z-index: 40;
}
.sidebar-overlay.show { opacity: 1; visibility: visible; }

/* ---------- 卡片 ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.card-title { font-size: 16px; font-weight: 700; }

/* ============================================================
   看板
   ============================================================ */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 22px; }
.stat-card {
  background: var(--card); border-radius: var(--radius); padding: 22px;
  box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.stat-card::after {
  content: ""; position: absolute; right: -20px; top: -20px; width: 90px; height: 90px;
  border-radius: 50%; opacity: .12; background: var(--primary);
}
.stat-ico { font-size: 24px; }
.stat-label { color: var(--ink-3); font-size: 13px; margin: 12px 0 6px; }
.stat-value { font-size: 28px; font-weight: 800; letter-spacing: .5px; }
.stat-value .unit { font-size: 14px; font-weight: 600; color: var(--ink-3); margin-left: 2px; }
.stat-card.accent::after { background: var(--primary); }
.stat-card.green::after { background: var(--success); }
.stat-card.blue::after { background: var(--info); }
.stat-card.warn::after { background: var(--warn); }

.dash-cols { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; }
@media (max-width: 1100px) { .dash-cols { grid-template-columns: 1fr; } }

.mini-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 22px; border-bottom: 1px solid var(--line); }
.mini-row:last-child { border-bottom: none; }
.mini-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.mini-thumb { width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 20px; overflow: hidden; }
.mini-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mini-name { font-weight: 600; }
.mini-sub { color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.mini-amount { font-weight: 700; color: var(--primary); }

.lowstock-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 22px; border-bottom: 1px solid var(--line); }
.lowstock-item:last-child { border-bottom: none; }

/* ============================================================
   表格 / 通用
   ============================================================ */
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.search {
  display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line-2);
  border-radius: 999px; padding: 8px 16px; min-width: 220px;
}
.search input { border: none; outline: none; background: transparent; flex: 1; }
/* 订单搜索：独占一行、加大尺寸，便于输入与查看 */
.order-search { width: 100%; margin-bottom: 18px; padding: 13px 22px; min-width: 0; }
.order-search span { font-size: 18px; }
.order-search input { font-size: 15px; }
.order-search input::placeholder { color: #B5ACA0; }
/* 订单刷新按钮：图标在刷新中旋转 */
.order-refresh { flex-shrink: 0; }
.order-refresh .ic { display: inline-block; line-height: 1; }
.order-refresh.spinning .ic { animation: spin .7s linear infinite; }
.select {
  background: #fff; border: 1px solid var(--line-2); border-radius: 999px;
  padding: 9px 16px; outline: none; cursor: pointer;
}

table.tbl { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.tbl thead th { text-align: left; font-size: 12.5px; color: var(--ink-3); font-weight: 700; padding: 14px 16px; background: #fcf8f1; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl tbody td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: #fffaf3; }
.cell-prod { display: flex; align-items: center; gap: 12px; }
.prod-thumb { width: 46px; height: 46px; border-radius: 12px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 24px; overflow: hidden; }
.prod-thumb img { width: 100%; height: 100%; object-fit: cover; }
.prod-name { font-weight: 600; }
.prod-tags { color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.price { color: var(--danger); font-weight: 700; }
.muted { color: var(--ink-3); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- 徽章 ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.unpaid { color: #E8552B; background: #FDEAE2; }
.badge.pending, .badge.paid { color: var(--primary); background: var(--primary-soft); }
.badge.shipped { color: var(--info); background: var(--info-soft); }
.badge.done { color: var(--success); background: var(--success-soft); }
.badge.canceled { color: var(--ink-3); background: #f0ece4; }
.badge.on { color: var(--success); background: var(--success-soft); }
.badge.off { color: var(--ink-3); background: #f0ece4; }
.badge.pay-wechat { color: #07c160; background: #e7f9ee; }
.badge.pay-cod { color: var(--warn); background: var(--warn-soft); }
.stock-low { color: var(--danger); font-weight: 700; }

/* ---------- 开关 ---------- */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; cursor: pointer; }
.switch input { display: none; }
.switch .slider { position: absolute; inset: 0; background: #d8cfc0; border-radius: 999px; transition: .2s; }
.switch .slider::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .slider { background: linear-gradient(135deg, var(--primary-2), var(--primary)); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* ---------- 标签页（订单筛选） ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; background: #fff; padding: 6px; border-radius: 18px; box-shadow: var(--shadow-sm); }
.tab { padding: 8px 18px; border-radius: 999px; color: var(--ink-2); font-weight: 600; cursor: pointer; transition: .15s; white-space: nowrap; }
.tab:hover { color: var(--primary); }
.tab.active { background: linear-gradient(135deg, var(--primary-2), var(--primary)); color: #fff; }
.tab .count { font-size: 12px; opacity: .8; margin-left: 4px; }

/* ---------- 订单卡片 ---------- */
.order-list { display: flex; flex-direction: column; gap: 16px; }
.order-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.order-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; background: #fcf8f1; border-bottom: 1px solid var(--line); }
.order-no { font-weight: 700; font-family: ui-monospace, monospace; }
.order-time { color: var(--ink-3); font-size: 12px; margin-left: 12px; }
.order-body { padding: 16px 20px; display: grid; grid-template-columns: 1fr 260px; gap: 18px; }
@media (max-width: 860px) { .order-body { grid-template-columns: 1fr; } }
.order-items { display: flex; flex-direction: column; gap: 10px; }
.oi { display: flex; align-items: center; gap: 12px; }
.oi-thumb { width: 42px; height: 42px; border-radius: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 21px; overflow: hidden; }
.oi-thumb img { width: 100%; height: 100%; object-fit: cover; }
.oi-name { font-weight: 600; }
.oi-spec { color: var(--ink-3); font-size: 12px; margin-top: 1px; }
.oi-qty { margin-left: auto; color: var(--ink-2); }
.order-side { border-left: 1px dashed var(--line-2); padding-left: 18px; font-size: 13px; }
@media (max-width: 860px) { .order-side { border-left: none; padding-left: 0; border-top: 1px dashed var(--line-2); padding-top: 14px; } }
.side-row { display: flex; gap: 8px; margin-bottom: 8px; color: var(--ink-2); }
.side-row .k { color: var(--ink-3); flex-shrink: 0; width: 56px; }
.order-foot { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-top: 1px solid var(--line); }
.order-total .price { font-size: 19px; }

/* 退款申请横幅 */
.refund-banner { display: flex; align-items: center; gap: 10px; padding: 10px 20px; background: var(--warn-soft); border-bottom: 1px solid var(--line); font-size: 13px; }
.refund-banner.rejected { background: var(--danger-soft); }
.refund-flag { flex-shrink: 0; font-weight: 700; color: var(--warn); background: #fff; border: 1px solid currentColor; border-radius: 999px; padding: 2px 10px; font-size: 12px; }
.refund-banner.rejected .refund-flag { color: var(--danger); }
.refund-reason { color: var(--ink-2); word-break: break-all; }
.refund-reason.muted { color: var(--ink-3); }

/* ============================================================
   弹层 / Modal
   ============================================================ */
.overlay { position: fixed; inset: 0; background: rgba(40, 30, 15, .42); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { background: var(--card); border-radius: 20px; width: 560px; max-width: 100%; max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0,0,0,.25); animation: pop .18s ease; }
@keyframes pop { from { transform: translateY(12px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal.lg { width: 680px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.modal-title { font-size: 18px; font-weight: 800; }
.modal-close { font-size: 22px; color: var(--ink-3); cursor: pointer; line-height: 1; border: none; background: none; }
.modal-close:hover { color: var(--danger); }
.modal-body { padding: 22px 24px; overflow-y: auto; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 12px; }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field .req { color: var(--danger); }
.input, .textarea, .field select {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--line-2); border-radius: 10px;
  outline: none; background: #fcfaf6; transition: border .2s, box-shadow .2s;
}
.input:focus, .textarea:focus, .field select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); background: #fff; }
.textarea { resize: vertical; min-height: 72px; }
.hint { font-size: 12px; color: var(--ink-3); }

.picker-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pick { width: 40px; height: 40px; border-radius: 10px; border: 2px solid transparent; display: flex; align-items: center; justify-content: center; font-size: 20px; cursor: pointer; background: #f3eee4; }
.pick.color { font-size: 0; }
.pick.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

.spec-editor { display: flex; flex-direction: column; gap: 10px; }
.spec-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr auto; gap: 10px; align-items: center; }
.spec-row .input { padding: 9px 12px; }
.spec-del { color: var(--danger); cursor: pointer; font-size: 13px; padding: 6px; white-space: nowrap; }
.spec-add { color: var(--primary); font-weight: 600; cursor: pointer; font-size: 13px; }
.preview-thumb { width: 60px; height: 60px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 30px; overflow: hidden; }
.preview-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* 主图：地址输入 + 本地上传按钮同一行 */
.img-input-row { display: flex; align-items: center; gap: 8px; }
.img-input-row .input { flex: 1; min-width: 0; }
.img-input-row .btn { flex-shrink: 0; white-space: nowrap; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: 70px 20px; color: var(--ink-3); }
.empty-emoji { font-size: 54px; margin-bottom: 14px; }

/* ---------- 加载 ---------- */
.loading { text-align: center; padding: 60px; color: var(--ink-3); }
.spinner { width: 30px; height: 30px; border: 3px solid var(--line-2); border-top-color: var(--primary); border-radius: 50%; margin: 0 auto 14px; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 36px; transform: translateX(-50%);
  background: #2f2a24; color: #fff; padding: 12px 22px; border-radius: 999px;
  font-size: 14px; z-index: 200; box-shadow: 0 12px 30px rgba(0,0,0,.3); animation: toastin .2s ease;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
@keyframes toastin { from { transform: translate(-50%, 12px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* ---------- 详情描述列表 ---------- */
.desc-list { display: flex; flex-direction: column; gap: 0; }
.desc-list .dl-row { display: flex; padding: 11px 0; border-bottom: 1px solid var(--line); }
.desc-list .dl-row:last-child { border-bottom: none; }
.desc-list .dl-k { width: 92px; color: var(--ink-3); flex-shrink: 0; }
.desc-list .dl-v { flex: 1; }

/* ============================================================
   用户 / 客户管理
   ============================================================ */
.cell-user { display: flex; align-items: center; gap: 12px; }
.u-ava {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
}
.u-name { font-weight: 700; }
.u-addr { font-size: 12px; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; }

.u-order-title { font-weight: 800; margin-bottom: 10px; }
.u-order { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.u-order:last-child { margin-bottom: 0; }
.u-order-top { display: flex; align-items: center; justify-content: space-between; }
.u-order-sub { font-size: 12px; margin-top: 4px; }
.u-order-foot { font-size: 13px; margin-top: 6px; }
.u-order-thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* ============================================================
   优惠券
   ============================================================ */
.cell-coupon { display: flex; align-items: center; gap: 14px; }
.coupon-face {
  flex-shrink: 0; width: 96px; padding: 9px 6px; border-radius: 12px;
  text-align: center; color: #fff; line-height: 1.15;
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  box-shadow: 0 5px 12px rgba(255, 140, 66, .28);
}
.coupon-face.discount { background: linear-gradient(135deg, #ff9a6b, var(--danger)); box-shadow: 0 5px 12px rgba(232, 85, 43, .26); }
.coupon-face.direct { background: linear-gradient(135deg, #ffc24b, #ff7e5f); box-shadow: 0 5px 12px rgba(255, 126, 95, .26); }
.cf-main { font-size: 21px; font-weight: 800; letter-spacing: .3px; }
.cf-main small { font-size: 12px; font-weight: 700; margin: 0 1px; }
.cf-sub { font-size: 11px; opacity: .92; margin-top: 2px; }
.c-name { font-weight: 700; }
.c-type { font-size: 12px; margin-top: 3px; }
.c-date { font-size: 13px; }
.c-date.muted { font-size: 12px; margin-top: 2px; }

.badge.c-active { color: var(--success); background: var(--success-soft); }
.badge.c-upcoming { color: var(--info); background: var(--info-soft); }
.badge.c-expired { color: var(--ink-3); background: #f0ece4; }
.badge.c-disabled { color: var(--ink-3); background: #f0ece4; }

/* ============================================================
   分类管理
   ============================================================ */
.cat-add { display: flex; gap: 10px; }
.cat-add .input { flex: 1; }
.cat-list { display: flex; flex-direction: column; gap: 10px; }
.cat-row { display: flex; align-items: center; gap: 10px; }
.cat-row .cat-name { flex: 1; }
.cat-count { font-size: 12px; white-space: nowrap; min-width: 36px; text-align: right; }

/* ============================================================
   店铺设置
   ============================================================ */
.settings-wrap { max-width: 720px; display: flex; flex-direction: column; gap: 18px; }
.settings-card .settings-body { padding: 20px 22px 6px; }
.settings-body .field:last-child { margin-bottom: 14px; }
.settings-foot { display: flex; justify-content: flex-end; }
.notice-preview {
  display: inline-flex; align-items: center; gap: 12px; max-width: 100%;
  background: var(--primary-soft); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px;
}
.np-tag { background: var(--primary); color: #fff; font-size: 12px; padding: 3px 10px; border-radius: 6px; flex-shrink: 0; font-weight: 700; }
.np-text { color: var(--ink-2); font-size: 14px; }

/* ============================================================
   评价管理
   ============================================================ */
.review-list { display: flex; flex-direction: column; gap: 14px; }
.review-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow-sm); }
.r-head { display: flex; align-items: center; justify-content: space-between; }
.r-user { display: flex; align-items: center; gap: 12px; }
.r-ava { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.r-ava-ph { display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; background: linear-gradient(135deg, #ffb347, #ff8c42); }
.r-name { font-weight: 600; font-size: 14px; }
.r-stars { color: #ffb320; font-size: 14px; letter-spacing: 2px; }
.r-stars-off { color: #e6dccb; }
.r-time { color: var(--ink-3); font-size: 12px; }
.r-prod { font-size: 12px; margin-top: 10px; }
.r-content { font-size: 14px; color: var(--ink); line-height: 1.6; margin-top: 8px; }
.r-pics { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.r-pic { width: 78px; height: 78px; border-radius: 8px; object-fit: cover; cursor: pointer; }
.r-reply { margin-top: 12px; background: var(--primary-soft); border-radius: 10px; padding: 10px 12px; font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.r-reply-tag { color: var(--primary); font-weight: 700; margin-right: 8px; }
.r-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.r-quote { background: var(--bg); border-radius: 10px; padding: 12px; color: var(--ink-2); font-size: 13px; line-height: 1.6; margin-bottom: 14px; }

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
  .menu-btn { display: inline-flex; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 50; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .content { padding: 18px; }
  .topbar { padding: 16px 18px; }
}

/* ============================================================
   视觉优化：卡片悬浮微抬升 + 图片悬停放大，增强层次与反馈
   ============================================================ */
.stat-card, .order-card, .review-card {
  transition: transform .16s ease, box-shadow .25s ease;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.order-card:hover, .review-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.r-pic, .oi-thumb img, .prod-thumb img { transition: transform .18s ease; }
.r-pic:hover { transform: scale(1.06); }

/* 列表行 hover 时主操作更醒目 */
.tbl tbody tr:hover .btn-ghost { border-color: var(--primary); color: var(--primary); }

/* 移动端：表格转卡片（商品 / 客户 / 优惠券），免横向滑动 */
@media (max-width: 760px) {
  table.tbl { display: block; background: transparent; box-shadow: none; overflow: visible; }
  table.tbl thead { display: none; }
  table.tbl tbody { display: block; }
  table.tbl tr {
    display: block; background: var(--card); border-radius: 16px;
    box-shadow: var(--shadow-sm); padding: 4px 16px 10px; margin-bottom: 14px;
  }
  table.tbl tbody tr:hover { background: var(--card); }
  table.tbl td {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; text-align: right; white-space: normal;
    padding: 11px 0; border-bottom: 1px solid var(--line-2);
  }
  table.tbl td:last-child { border-bottom: none; }
  table.tbl td::before {
    content: attr(data-label); flex-shrink: 0; text-align: left;
    font-size: 12.5px; font-weight: 700; color: var(--ink-3); white-space: nowrap;
  }
  /* 首列（主体：商品/客户/券面）整行展示、无标签 */
  table.tbl td:first-child { display: block; text-align: left; padding-top: 13px; }
  table.tbl td:first-child::before { display: none; }
  /* 操作按钮整行靠右排布 */
  table.tbl td .row-actions { justify-content: flex-end; }
  /* 多行内容（有效期、领取/核销）右对齐竖排，避免被 flex 拆散 */
  table.tbl td .cell-stack { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
  .u-addr { max-width: none; white-space: normal; }
}
