/* ============================================================
   拾光小铺 · 设计系统
   暖纸底色 / 墨绿主色 / 黄铜点缀
   ============================================================ */

:root {
  --paper: #f7f5ef;
  --paper-2: #f1ede4;
  --surface: #ffffff;
  --ink: #171b18;
  --ink-2: #3d453f;
  --muted: #737a73;
  --faint: #9aa097;
  --line: #e6e1d5;
  --line-soft: #efebe2;

  --pine: #11453a;
  --pine-600: #1a5a4a;
  --pine-50: #e9f0ec;
  --brass: #b8924f;
  --brass-soft: #f2e6d2;
  --cream: #f6ecda;

  --ok: #2c7a5e;
  --warn: #b0752a;
  --danger: #a3433a;
  --info: #3a6b8c;

  --radius: 20px;
  --radius-sm: 12px;
  --radius-xs: 9px;

  --shadow-sm: 0 1px 2px rgba(23, 27, 24, .05);
  --shadow: 0 2px 4px rgba(23, 27, 24, .04), 0 16px 36px -22px rgba(23, 27, 24, .28);
  --shadow-lg: 0 30px 70px -40px rgba(15, 40, 33, .45);

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  --font-serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "Source Han Serif CN", "SimSun", serif;

  --ease: cubic-bezier(.2, .7, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  background-image:
    radial-gradient(900px 460px at 100% -8%, rgba(184, 146, 79, .10), transparent 70%),
    radial-gradient(700px 420px at -10% 0%, rgba(17, 69, 58, .06), transparent 65%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }

::selection { background: var(--brass-soft); color: var(--pine); }

:focus-visible {
  outline: 2px solid var(--pine-600);
  outline-offset: 2px;
  border-radius: 6px;
}

.container {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
}

.serif { font-family: var(--font-serif); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; letter-spacing: .04em; }
.strong { font-weight: 600; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---------------- 顶栏 ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  background: rgba(247, 245, 239, .82);
  border-bottom: 1px solid rgba(230, 225, 213, .8);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 26px;
  height: 70px;
}

.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark { border-radius: 11px; box-shadow: 0 6px 16px -8px rgba(17, 69, 58, .6); flex: none; }
.brand-name {
  font-family: var(--font-serif);
  font-size: 18px;
  letter-spacing: .08em;
  color: var(--ink);
  line-height: 1.2;
}
.brand-sub {
  font-size: 10.5px;
  letter-spacing: .18em;
  color: var(--faint);
  margin-top: 2px;
}

.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 13.5px;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.nav a:hover { background: rgba(17, 69, 58, .06); color: var(--pine); }
.nav a.is-active { background: var(--pine); color: #f6f1e6; }
.nav a.is-active svg { stroke: #f6f1e6; }

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.balance-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  font-size: 13px;
  box-shadow: var(--shadow-sm);
  transition: transform .18s var(--ease), border-color .18s var(--ease);
}
.balance-chip:hover { transform: translateY(-1px); border-color: #d8cfbb; }
.balance-chip .coin {
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(140deg, #f3e3c6, #e2c795);
  color: #6d4f1e;
}
.balance-chip b { font-variant-numeric: tabular-nums; font-weight: 600; }

.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--pine-50);
  color: var(--pine);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid #dbe5df;
  flex: none;
}

/* ---------------- 按钮 ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 42px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-size: 13.5px;
  font-weight: 550;
  letter-spacing: .01em;
  transition: transform .16s var(--ease), background .16s var(--ease), box-shadow .16s var(--ease), border-color .16s var(--ease);
  white-space: nowrap;
  background: transparent;
}
.btn:active { transform: scale(.985); }
.btn svg { flex: none; }

.btn-primary {
  background: linear-gradient(160deg, var(--pine-600), var(--pine));
  color: #f7f2e7;
  box-shadow: 0 10px 24px -14px rgba(17, 69, 58, .9), inset 0 1px 0 rgba(255, 255, 255, .14);
}
.btn-primary:hover { box-shadow: 0 14px 30px -14px rgba(17, 69, 58, .85); transform: translateY(-1px); }

.btn-brass {
  background: linear-gradient(160deg, #cda766, #ab8143);
  color: #2a2011;
  box-shadow: 0 10px 22px -14px rgba(140, 102, 44, .9), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.btn-brass:hover { transform: translateY(-1px); }

.btn-ghost {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink-2);
  box-shadow: var(--shadow-sm);
}
.btn-ghost:hover { border-color: #d4cab5; color: var(--ink); }

.btn-soft { background: var(--pine-50); color: var(--pine); }
.btn-soft:hover { background: #dfeae4; }

.btn-danger { background: #fbf0ee; color: var(--danger); border-color: #f0d9d5; }
.btn-danger:hover { background: #f7e5e2; }

.btn-link { height: auto; padding: 0; color: var(--pine); font-size: 13px; }
.btn-link:hover { text-decoration: underline; }

.btn-sm { height: 34px; padding: 0 12px; font-size: 12.5px; border-radius: 10px; }
.btn-xs { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; gap: 4px; }
.btn-lg { height: 50px; padding: 0 26px; font-size: 15px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: 11px; }

.btn[disabled], .btn.is-disabled { opacity: .45; pointer-events: none; }

/* ---------------- 卡片 ---------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 22px; }
.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line-soft);
}
.card-head h3 { font-size: 15px; letter-spacing: .02em; }
.card-head .spacer { margin-left: auto; }
.card-body { padding: 22px; }
.card-foot { padding: 16px 22px; border-top: 1px solid var(--line-soft); background: #fcfbf8; border-radius: 0 0 var(--radius) var(--radius); }

.section-head {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  margin: 34px 0 16px;
}
.section-head h2 {
  font-family: var(--font-serif);
  font-size: 21px;
  letter-spacing: .06em;
}
.section-head .spacer { margin-left: auto; }
.section-head .sub { font-size: 12.5px; color: var(--muted); letter-spacing: .04em; }

/* ---------------- 徽标 / 状态 ---------------- */

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11.5px;
  letter-spacing: .04em;
  border: 1px solid transparent;
  white-space: nowrap;
}
.chip svg { width: 13px; height: 13px; }
.chip-ok { background: #eaf3ee; color: #24654f; border-color: #d5e7dd; }
.chip-warn { background: #fbf1e2; color: #96601f; border-color: #f2e2c8; }
.chip-info { background: #eaf1f6; color: #2f5f7e; border-color: #d8e6ef; }
.chip-brand { background: var(--pine-50); color: var(--pine); border-color: #d7e4dd; }
.chip-muted { background: #f2f1ed; color: #6f756e; border-color: #e6e4dc; }
.chip-danger { background: #fbeeec; color: #98382f; border-color: #f2d9d4; }
.chip-brass { background: var(--brass-soft); color: #7e5a1d; border-color: #ecd9b8; }

.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------------- Hero ---------------- */

.hero {
  position: relative;
  overflow: hidden;
  margin-top: 26px;
  border-radius: 26px;
  background:
    radial-gradient(620px 320px at 88% 8%, rgba(196, 155, 88, .28), transparent 68%),
    radial-gradient(520px 320px at 6% 96%, rgba(37, 104, 86, .5), transparent 70%),
    linear-gradient(140deg, #16473b 0%, #0d2f28 62%, #0a2621 100%);
  color: #f5efe2;
  box-shadow: var(--shadow-lg);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .045) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(120% 100% at 100% 0%, #000 10%, transparent 72%);
  -webkit-mask-image: radial-gradient(120% 100% at 100% 0%, #000 10%, transparent 72%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.35fr .9fr;
  gap: 28px;
  padding: 38px 40px 34px;
  align-items: center;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: .22em;
  color: rgba(245, 239, 226, .62);
  margin-bottom: 14px;
}
.hero-kicker::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--brass);
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: 34px;
  line-height: 1.25;
  letter-spacing: .06em;
  font-weight: 600;
}
.hero h1 em {
  font-style: normal;
  color: #e3c893;
}
.hero-sub {
  margin-top: 12px;
  font-size: 13.5px;
  color: rgba(245, 239, 226, .72);
  max-width: 42ch;
  line-height: 1.8;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 12.5px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .07);
  color: #f2ecdd;
  backdrop-filter: blur(6px);
}
.status-pill .dot { width: 7px; height: 7px; box-shadow: 0 0 0 4px rgba(126, 209, 174, .16); }
.status-pill.is-open .dot { background: #6fd3a6; animation: pulse 2.4s infinite; color: #6fd3a6; }
.status-pill.is-closed .dot { background: #d8a15f; color: #d8a15f; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(111, 211, 166, .22); }
  50% { box-shadow: 0 0 0 8px rgba(111, 211, 166, .04); }
}

.hero-stat {
  position: relative;
  padding: 22px 24px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .055);
  backdrop-filter: blur(8px);
}
.hero-stat .row { display: flex; justify-content: space-between; align-items: baseline; padding: 9px 0; border-bottom: 1px dashed rgba(255, 255, 255, .12); }
.hero-stat .row:last-child { border-bottom: 0; padding-bottom: 0; }
.hero-stat .k { font-size: 12px; letter-spacing: .1em; color: rgba(245, 239, 226, .6); }
.hero-stat .v { font-size: 17px; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.hero-stat .v.hl { color: #e6c994; font-size: 21px; }

/* ---------------- 分类 ---------------- */

.cat-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  scrollbar-width: none;
}
.cat-strip::-webkit-scrollbar { display: none; }

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: all .18s var(--ease);
}
.cat-pill:hover { border-color: #d6cbb6; transform: translateY(-1px); }
.cat-pill.is-active {
  background: var(--pine);
  border-color: var(--pine);
  color: #f7f2e7;
  box-shadow: 0 10px 22px -16px rgba(17, 69, 58, .9);
}
.cat-pill.is-active svg { stroke: #e9d3a9; }

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  min-width: 200px;
  box-shadow: var(--shadow-sm);
}
.search-box input {
  border: 0;
  background: transparent;
  outline: none;
  width: 100%;
  font-size: 13px;
  color: var(--ink);
}
.search-box input::placeholder { color: var(--faint); }

/* ---------------- 商品 ---------------- */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(222px, 1fr));
  gap: 16px;
}

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
}
.product-card:hover {
  transform: translateY(-3px);
  border-color: #dcd2bd;
  box-shadow: 0 22px 40px -28px rgba(17, 45, 38, .5);
}
.product-card.is-out { opacity: .62; }

.p-link { display: flex; flex-direction: column; flex: 1; }

.p-media {
  position: relative;
  height: 118px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(120% 100% at 20% 0%, rgba(255, 255, 255, .9), transparent 60%),
    linear-gradient(150deg, var(--tint-a, #f0ece1), var(--tint-b, #e6ddcb));
  border-bottom: 1px solid var(--line-soft);
}
.p-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(23, 27, 24, .07) 1px, transparent 1px);
  background-size: 12px 12px;
  opacity: .35;
  mask-image: radial-gradient(80% 80% at 80% 90%, #000, transparent 75%);
  -webkit-mask-image: radial-gradient(80% 80% at 80% 90%, #000, transparent 75%);
}
.p-icon {
  position: relative;
  z-index: 1;
  width: 62px; height: 62px;
  display: grid; place-items: center;
  border-radius: 18px;
  background: rgba(255, 255, 255, .82);
  border: 1px solid rgba(255, 255, 255, .9);
  color: var(--pine);
  box-shadow: 0 12px 24px -16px rgba(30, 50, 40, .55);
}
.p-badge {
  position: absolute;
  top: 10px; left: 10px;
  z-index: 2;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 10.5px;
  letter-spacing: .08em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(17, 69, 58, .9);
  color: #f2e7d2;
}
.p-badge.out { background: rgba(60, 60, 56, .78); }

.p-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.p-name { font-size: 14.5px; font-weight: 600; line-height: 1.4; }
.p-meta { font-size: 11.5px; color: var(--faint); letter-spacing: .03em; display: flex; gap: 8px; }
.p-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.p-price { display: flex; align-items: baseline; gap: 2px; color: var(--pine); }
.p-price .cur { font-size: 11px; opacity: .8; }
.p-price .val { font-family: var(--font-serif); font-size: 21px; letter-spacing: .02em; }
.p-price .unit { font-size: 11px; color: var(--faint); margin-left: 3px; }

.p-add {
  width: 34px; height: 34px;
  border-radius: 11px;
  border: 0;
  display: grid; place-items: center;
  background: var(--pine);
  color: #f7f2e7;
  transition: transform .16s var(--ease), background .16s var(--ease);
  box-shadow: 0 8px 16px -12px rgba(17, 69, 58, .9);
}
.p-add:hover { background: var(--pine-600); transform: scale(1.06); }
.p-add[disabled] { background: #ddd8cc; box-shadow: none; cursor: not-allowed; }

.qty-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--pine-50);
  border-radius: 11px;
  padding: 3px;
}
.qty-inline button {
  width: 26px; height: 26px;
  border: 0; border-radius: 8px;
  background: transparent;
  color: var(--pine);
  display: grid; place-items: center;
}
.qty-inline button:hover { background: #dbe8e1; }
.qty-inline span { min-width: 20px; text-align: center; font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* ---------------- 表单 ---------------- */

.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field > label, .label {
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--muted);
}
.input, .select, .textarea {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #fdfcf9;
  color: var(--ink);
  font-size: 14px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
.textarea { height: auto; min-height: 88px; padding: 11px 14px; resize: vertical; line-height: 1.65; }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--pine-600);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26, 90, 74, .1);
}
.input::placeholder, .textarea::placeholder { color: #b3b8b0; }
.select { appearance: none; 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='%23737a73' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='m6 9.5 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px; }
.hint { font-size: 11.5px; color: var(--faint); line-height: 1.6; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.cart-layout { display: grid; grid-template-columns: 1.6fr .9fr; gap: 16px; align-items: start; }
.split { grid-template-columns: 1.5fr 1fr; align-items: start; }
@media (max-width: 880px) { .cart-layout { grid-template-columns: 1fr; } }
@media (max-width: 1020px) { .split { grid-template-columns: 1fr; } }

.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }

.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }

/* ---------------- 列表 / 表格 ---------------- */

.list-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}
.list-row:last-child { border-bottom: 0; }

.thumb {
  width: 46px; height: 46px;
  border-radius: 13px;
  display: grid; place-items: center;
  background: var(--paper-2);
  color: var(--pine);
  border: 1px solid var(--line);
  flex: none;
}

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left;
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: .1em;
  color: var(--faint);
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: #fbfaf6;
}
.table td { padding: 13px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .16s var(--ease); }
.table tbody tr:hover { background: #fcfbf7; }
.table .num { font-variant-numeric: tabular-nums; }

.empty {
  padding: 56px 20px;
  text-align: center;
  color: var(--muted);
}
.empty .icon-wrap {
  width: 62px; height: 62px;
  margin: 0 auto 14px;
  border-radius: 20px;
  display: grid; place-items: center;
  background: var(--paper-2);
  color: var(--faint);
  border: 1px solid var(--line);
}
.empty h4 { font-size: 14.5px; color: var(--ink-2); margin-bottom: 4px; }

/* ---------------- 页脚 / 移动底栏 ---------------- */

.footer {
  margin: 64px 0 40px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: center;
  font-size: 11.5px;
  color: var(--faint);
  letter-spacing: .04em;
}
.footer .spacer { margin-left: auto; }

.tabbar { display: none; }

/* ---------------- 购物车悬浮条 ---------------- */

.cart-bar {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 60;
  width: min(560px, calc(100% - 32px));
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px 10px 18px;
  border-radius: 18px;
  background: rgba(16, 42, 35, .94);
  color: #f4eee1;
  box-shadow: 0 24px 50px -24px rgba(12, 32, 27, .85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .1);
}
.cart-bar .cart-info { display: flex; align-items: center; gap: 12px; font-size: 12.5px; }
.cart-bar .cart-total { font-family: var(--font-serif); font-size: 19px; color: #e8ce9f; }

/* ---------------- 提示 ---------------- */

.toast-stack {
  position: fixed;
  top: 84px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  border-radius: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px -24px rgba(20, 30, 25, .5);
  font-size: 13px;
  animation: toast-in .3s var(--ease);
}
.toast svg { flex: none; margin-top: 1px; }
.toast.is-success { border-left: 3px solid var(--ok); }
.toast.is-success svg { color: var(--ok); }
.toast.is-error { border-left: 3px solid var(--danger); }
.toast.is-error svg { color: var(--danger); }
.toast.is-info { border-left: 3px solid var(--info); }
.toast.is-info svg { color: var(--info); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px) scale(.98); }
  to { opacity: 1; transform: none; }
}

/* ---------------- 时间线 ---------------- */

.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: flex; gap: 14px; padding-bottom: 20px; position: relative; }
.tl-item::before {
  content: "";
  position: absolute;
  left: 13px; top: 28px; bottom: 0;
  width: 1px;
  background: var(--line);
}
.tl-item:last-child { padding-bottom: 0; }
.tl-item:last-child::before { display: none; }
.tl-dot {
  width: 27px; height: 27px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--paper-2);
  border: 1px solid var(--line);
  color: var(--faint);
  flex: none;
  z-index: 1;
}
.tl-item.is-done .tl-dot { background: var(--pine); border-color: var(--pine); color: #f2e9d8; }
.tl-item.is-current .tl-dot { background: var(--brass-soft); border-color: #e3cba0; color: #8a6224; box-shadow: 0 0 0 4px rgba(184, 146, 79, .12); }
.tl-title { font-size: 13.5px; font-weight: 550; }
.tl-time { font-size: 11.5px; color: var(--faint); margin-top: 2px; }

/* ---------------- 认证页 ---------------- */

.auth-wrap {
  min-height: calc(100vh - 200px);
  display: grid;
  place-items: center;
  padding: 48px 0;
}
.auth-card {
  width: min(430px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 34px;
  box-shadow: 0 30px 70px -48px rgba(17, 45, 38, .55);
}
.auth-head { text-align: center; margin-bottom: 26px; }
.auth-head .mark { margin: 0 auto 14px; width: 46px; }
.auth-head h1 { font-family: var(--font-serif); font-size: 23px; letter-spacing: .08em; }
.auth-head p { font-size: 12.5px; color: var(--muted); margin-top: 7px; letter-spacing: .04em; }
.auth-foot { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 18px; }
.auth-foot a { color: var(--pine); border-bottom: 1px solid rgba(17, 69, 58, .25); }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--faint);
  font-size: 11px;
  letter-spacing: .1em;
  margin: 18px 0;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------------- 后台骨架 ---------------- */

.admin-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 236px;
  flex: none;
  background: #0f3129;
  color: rgba(243, 236, 222, .78);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  position: sticky;
  top: 0;
  height: 100vh;
  background-image:
    radial-gradient(420px 260px at 100% 0%, rgba(184, 146, 79, .16), transparent 70%),
    linear-gradient(180deg, #11362d, #0b2620);
}
.sidebar .brand { padding: 0 8px; }
.sidebar .brand-name { color: #f7f1e4; font-size: 16px; }
.sidebar .brand-sub { color: rgba(243, 236, 222, .4); }

.side-group { display: flex; flex-direction: column; gap: 3px; }
.side-label {
  font-size: 10px;
  letter-spacing: .2em;
  color: rgba(243, 236, 222, .35);
  padding: 0 10px;
  margin-bottom: 6px;
}
.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  font-size: 13px;
  color: rgba(243, 236, 222, .74);
  transition: background .16s var(--ease), color .16s var(--ease);
}
.side-link:hover { background: rgba(255, 255, 255, .06); color: #f7f1e4; }
.side-link.is-active {
  background: rgba(255, 255, 255, .1);
  color: #f7f1e4;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}
.side-link.is-active svg { stroke: #d9b97f; }
.side-link .count {
  margin-left: auto;
  font-size: 10.5px;
  background: rgba(216, 160, 95, .22);
  color: #e8c793;
  padding: 1px 7px;
  border-radius: 999px;
}

.sidebar-foot { margin-top: auto; padding: 0 8px; font-size: 11px; color: rgba(243, 236, 222, .35); }

.admin-main { flex: 1; min-width: 0; padding: 26px 30px 60px; }
.page-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.page-head h1 { font-family: var(--font-serif); font-size: 24px; letter-spacing: .06em; }
.page-head .sub { font-size: 12.5px; color: var(--muted); }
.page-head .spacer { margin-left: auto; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.stat-card .k { font-size: 11.5px; letter-spacing: .1em; color: var(--faint); display: flex; align-items: center; gap: 6px; }
.stat-card .v { font-family: var(--font-serif); font-size: 27px; letter-spacing: .02em; margin-top: 10px; color: var(--ink); }
.stat-card .v small { font-size: 13px; font-family: var(--font-sans); color: var(--faint); margin-left: 3px; }
.stat-card .meta { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.stat-card.is-accent { background: linear-gradient(155deg, #17493d, #0e3028); border-color: transparent; color: #f5efe2; }
.stat-card.is-accent .k { color: rgba(245, 239, 226, .55); }
.stat-card.is-accent .v { color: #f0dcb4; }
.stat-card.is-accent .meta { color: rgba(245, 239, 226, .5); }
.stat-card .corner { position: absolute; right: -16px; bottom: -18px; opacity: .07; }
.stat-card.is-accent .corner { opacity: .12; }

.chart-box { padding: 8px 4px 0; }
.chart-legend { display: flex; gap: 16px; font-size: 11.5px; color: var(--muted); }
.chart-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 5px; }

.bar-row { display: flex; align-items: flex-end; gap: 12px; height: 170px; padding: 10px 0 0; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.bar-col .bar-track { width: 100%; max-width: 42px; height: 100%; display: flex; align-items: flex-end; }
.bar-col .bar {
  width: 100%;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, #2a6d59, #17493d);
  min-height: 3px;
  transition: height .5s var(--ease);
  position: relative;
}
.bar-col.is-today .bar { background: linear-gradient(180deg, #d3ac6b, #b8924f); }
.bar-col .lb { font-size: 10.5px; color: var(--faint); letter-spacing: .03em; }
.bar-col .cn { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* 后台表格里的紧凑商品单元 */
.cell-item { display: flex; align-items: center; gap: 10px; }
.cell-item .thumb { width: 34px; height: 34px; border-radius: 10px; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.filter-bar .input, .filter-bar .select { height: 38px; width: auto; min-width: 150px; }

.pager { display: flex; align-items: center; gap: 6px; justify-content: center; padding: 18px 0 4px; }
.pager a, .pager span {
  min-width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 12.5px;
  color: var(--muted);
}
.pager .is-current { background: var(--pine); border-color: var(--pine); color: #f6f0e3; }
.pager .disabled { opacity: .4; pointer-events: none; }

/* ---------------- 营业时间编辑器 ---------------- */
.day-row {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}
.day-row:last-child { border-bottom: 0; }
.day-name { font-size: 13.5px; font-weight: 550; }
.day-name span { display: block; font-size: 10.5px; color: var(--faint); font-weight: 400; letter-spacing: .08em; }
.slot-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.slot-line .input { width: 116px; height: 38px; font-variant-numeric: tabular-nums; }
.slot-sep { color: var(--faint); font-size: 12px; }

/* ---------------- 响应式 ---------------- */

@media (max-width: 1020px) {
  .nav { display: none; }
  .hero-inner { grid-template-columns: 1fr; padding: 30px 26px; }
  .hero h1 { font-size: 28px; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    flex-direction: row;
    align-items: center;
    padding: 12px 16px;
    gap: 14px;
    overflow-x: auto;
  }
  .sidebar .brand { padding: 0; }
  .sidebar .side-group { flex-direction: row; gap: 4px; }
  .side-label, .sidebar-foot { display: none; }
  .side-link { white-space: nowrap; padding: 7px 11px; }
  .admin-main { padding: 20px 16px 48px; }
}

@media (max-width: 720px) {
  .container { width: calc(100% - 28px); }
  .topbar-inner { height: 62px; gap: 12px; }
  .brand-sub { display: none; }
  .brand-name { font-size: 16px; }
  .topbar-actions .btn-label { display: none; }
  body { padding-bottom: 74px; }
  .tabbar {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 70;
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 0;
    font-size: 10.5px;
    color: var(--faint);
    position: relative;
  }
  .tabbar a.is-active { color: var(--pine); }
  .tabbar .badge {
    position: absolute;
    top: 2px;
    right: calc(50% - 18px);
    min-width: 15px; height: 15px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font-size: 9.5px;
    display: grid; place-items: center;
    padding: 0 3px;
  }
  .hero { border-radius: 20px; }
  .hero h1 { font-size: 25px; letter-spacing: .04em; }
  .hero-sub { font-size: 12.5px; }
  .hero-inner { padding: 26px 22px; gap: 20px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .p-media { height: 96px; }
  .p-icon { width: 50px; height: 50px; border-radius: 15px; }
  .p-body { padding: 12px 12px 14px; }
  .p-name { font-size: 13px; }
  .p-price .val { font-size: 18px; }
  .section-head { margin: 26px 0 12px; }
  .section-head h2 { font-size: 18px; }
  .cart-bar { bottom: 76px; width: calc(100% - 24px); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-3, .grid-4, .form-row { grid-template-columns: 1fr; }
  .toast-stack { left: 14px; right: 14px; top: 70px; max-width: none; }
  .auth-card { padding: 26px 22px; }
  .day-row { grid-template-columns: 1fr; gap: 8px; }
  .admin-main { padding: 16px 14px 48px; }
  .page-head h1 { font-size: 20px; }
  .card-pad { padding: 16px; }
  .card-head, .card-body { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------------- 开关 / 折叠 ---------------- */

.switch { position: relative; display: inline-block; width: 48px; height: 27px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute; inset: 0;
  background: #dcd7c9;
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s var(--ease);
}
.switch span::after {
  content: "";
  position: absolute; top: 3px; left: 3px;
  width: 21px; height: 21px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(20, 30, 25, .25);
  transition: transform .2s var(--ease);
}
.switch input:checked + span { background: var(--pine); }
.switch input:checked + span::after { transform: translateX(21px); }
.switch input:focus-visible + span { outline: 2px solid var(--pine-600); outline-offset: 2px; }

.user-card { overflow: hidden; }
.user-card > summary { list-style: none; cursor: pointer; }
.user-card > summary::-webkit-details-marker { display: none; }
.user-card[open] > summary { background: #fcfbf7; }
.user-card[open] .btn-ghost { background: var(--pine); color: #f6f0e3; border-color: var(--pine); }

details > summary.btn { display: inline-flex; }

.btn-block.btn-sm { height: 36px; }

/* ---------------- 复选框行 ---------------- */
.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 13.5px;
  color: var(--ink);
  cursor: pointer;
}
.checkbox {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 1.6px solid #c9c2b0;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  flex: none;
  display: grid;
  place-items: center;
  transition: all .15s var(--ease);
}
.checkbox:checked {
  background: var(--pine);
  border-color: var(--pine);
}
.checkbox:checked::after {
  content: "";
  width: 9px;
  height: 5px;
  border-left: 2px solid #f6f0e3;
  border-bottom: 2px solid #f6f0e3;
  transform: rotate(-45deg) translate(0.5px, -0.5px);
}
