/* ===================== 设计令牌 ===================== */
:root {
  --bg: #fdfbf7;
  --surface: #ffffff;
  --surface-2: #f8f3ee;
  --ink: #2b2320;
  --ink-2: #5c5049;
  --muted: #948a82;
  --line: #ece4dc;
  --rose: #c4526e;
  --rose-dark: #a8405a;
  --rose-soft: #fbeef2;
  --leaf: #5b7a57;
  --leaf-soft: #eef4ec;
  --amber: #c98a3c;
  --amber-soft: #fbf1e2;
  --danger: #b4472f;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(43, 35, 32, 0.05);
  --shadow: 0 6px 20px rgba(43, 35, 32, 0.07);
  --shadow-lg: 0 16px 40px rgba(43, 35, 32, 0.12);
  --tab-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: #f3ede7;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; font-size: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul { margin: 0; padding: 0; list-style: none; }

/* ===================== 外壳 ===================== */
.app-root { min-height: 100vh; }

.shell {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  padding-bottom: calc(var(--tab-h) + var(--safe-b) + 8px);
  box-shadow: 0 0 60px rgba(43, 35, 32, 0.08);
}

.shell--wide { max-width: 1180px; }

@media (min-width: 900px) {
  .shell { box-shadow: 0 0 80px rgba(43, 35, 32, 0.14); }
}

/* ===================== 顶部栏 ===================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(253, 251, 247, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar__title { font-size: 16px; font-weight: 650; letter-spacing: 0.2px; }
.topbar__sub { font-size: 12px; color: var(--muted); }
.topbar__spacer { flex: 1; }
.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  font-size: 16px;
  transition: background 0.15s;
}
.icon-btn:active { background: var(--line); }

/* ===================== 底部导航 ===================== */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(480px, 100%);
  height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  z-index: 50;
}
.tabbar__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  color: var(--muted);
  position: relative;
}
.tabbar__item span.emoji { font-size: 19px; line-height: 1; filter: grayscale(0.55); transition: filter 0.15s; }
.tabbar__item.is-active { color: var(--rose); font-weight: 600; }
.tabbar__item.is-active span.emoji { filter: none; }
.tabbar__badge {
  position: absolute;
  top: 6px; right: 50%;
  transform: translateX(14px);
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--rose);
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
  font-weight: 600;
}

/* ===================== 通用 ===================== */
.page { padding: 14px 16px 20px; }
.section-title {
  display: flex; align-items: baseline; gap: 8px;
  margin: 20px 0 12px;
  font-size: 17px; font-weight: 700; letter-spacing: 0.2px;
}
.section-title small { font-size: 12px; font-weight: 400; color: var(--muted); }
.section-more { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--rose); }

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
}
.muted { color: var(--muted); }
.small { font-size: 12px; }
.strong { font-weight: 650; }
.row { display: flex; align-items: center; gap: 10px; }
.row--between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.empty .emoji { font-size: 34px; display: block; margin-bottom: 10px; opacity: 0.7; }

/* ===================== 按钮 ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 20px;
  border-radius: 22px;
  font-size: 15px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--ink);
  transition: transform 0.08s, opacity 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn--primary { background: linear-gradient(135deg, #d06680, var(--rose)); color: #fff; box-shadow: 0 6px 16px rgba(196, 82, 110, 0.28); }
.btn--leaf { background: var(--leaf); color: #fff; }
.btn--ghost { background: transparent; border: 1px solid var(--line); }
.btn--block { width: 100%; }
.btn--sm { height: 34px; padding: 0 14px; font-size: 13px; border-radius: 17px; }
.btn--xs { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 14px; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  height: 26px; padding: 0 10px;
  border-radius: 13px;
  background: var(--surface-2);
  font-size: 12px;
  color: var(--ink-2);
  border: 1px solid transparent;
}
.chip.is-active { background: var(--rose-soft); color: var(--rose-dark); border-color: #f2cfd9; font-weight: 600; }
.chip--leaf { background: var(--leaf-soft); color: var(--leaf); }
.chip--amber { background: var(--amber-soft); color: var(--amber); }

.tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 600;
  background: var(--rose-soft);
  color: var(--rose-dark);
}
.tag--leaf { background: var(--leaf-soft); color: var(--leaf); }
.tag--amber { background: var(--amber-soft); color: var(--amber); }
.tag--muted { background: var(--surface-2); color: var(--muted); }

/* ===================== 商品卡 ===================== */
.goods-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.goods {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.12s;
}
.goods:active { transform: scale(0.985); }
.goods__thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  font-size: 44px;
}
.goods__thumb::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 25%, rgba(255,255,255,0.55), transparent 60%);
}
.goods__badge {
  position: absolute; top: 8px; left: 8px;
  z-index: 2;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.9);
  font-size: 10px;
  font-weight: 700;
  color: var(--rose-dark);
}
.goods__body { padding: 9px 10px 11px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.goods__title { font-size: 13.5px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.goods__sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.goods__foot { display: flex; align-items: flex-end; justify-content: space-between; margin-top: auto; padding-top: 4px; }
.price { color: var(--rose); font-weight: 700; font-size: 17px; letter-spacing: -0.3px; }
.price small { font-size: 11px; font-weight: 600; margin-right: 1px; }
.price--muted { color: var(--muted); font-size: 12px; font-weight: 400; text-decoration: line-through; }

/* 列表型商品行（购物车 / 后台） */
.goods-row { display: flex; gap: 12px; padding: 12px; align-items: center; }
.goods-row__thumb {
  width: 62px; height: 62px; flex: none;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: 26px;
}
.goods-row__main { flex: 1; min-width: 0; }
.goods-row__title { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===================== 首页 ===================== */
.hero {
  margin: 0 0 4px;
  padding: 20px 18px 22px;
  border-radius: var(--radius-lg);
  background: linear-gradient(140deg, #fbe6ec 0%, #f7f0e6 55%, #e8f0e6 100%);
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  right: -30px; top: -40px;
  width: 170px; height: 170px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
}
.hero__eyebrow { font-size: 11.5px; letter-spacing: 2px; color: var(--rose-dark); font-weight: 700; }
.hero__title { font-size: 24px; font-weight: 800; letter-spacing: -0.4px; margin: 6px 0 4px; }
.hero__sub { font-size: 12.5px; color: var(--ink-2); max-width: 78%; line-height: 1.5; }
.hero__stats { display: flex; gap: 22px; margin-top: 16px; position: relative; z-index: 1; }
.hero__stat b { display: block; font-size: 18px; letter-spacing: -0.3px; }
.hero__stat span { font-size: 11px; color: var(--ink-2); }

.notice-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px;
  margin-top: 12px;
  border-radius: 12px;
  background: var(--amber-soft);
  color: #8a5f27;
  font-size: 12px;
  line-height: 1.4;
}

.cat-scroll {
  display: flex; gap: 8px;
  overflow-x: auto;
  padding: 4px 16px 6px;
  margin: 0 -16px;
  scrollbar-width: none;
}
.cat-scroll::-webkit-scrollbar { display: none; }
.cat-pill {
  flex: none;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 13px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 11.5px;
  min-width: 66px;
}
.cat-pill .emoji { font-size: 20px; }
.cat-pill.is-active { border-color: #f0cdd7; background: var(--rose-soft); color: var(--rose-dark); font-weight: 600; }

/* 团购横幅 */
.gb-banner {
  display: block;
  border-radius: var(--radius-lg);
  padding: 16px;
  background: linear-gradient(135deg, #2f4a3a, #4d6b52);
  color: #f4f7f2;
  position: relative;
  overflow: hidden;
}
.gb-banner::after {
  content: "";
  position: absolute; right: -24px; bottom: -40px;
  width: 140px; height: 140px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
}
.gb-banner__title { font-size: 16px; font-weight: 750; letter-spacing: 0.2px; }
.gb-banner__sub { font-size: 12px; opacity: 0.82; margin-top: 2px; }
.gb-progress {
  margin-top: 12px;
  height: 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
  position: relative;
  z-index: 1;
}
.gb-progress__bar { height: 100%; border-radius: 4px; background: linear-gradient(90deg, #ffd9a0, #ffb267); transition: width 0.5s; }
.gb-banner__meta { display: flex; justify-content: space-between; font-size: 11px; margin-top: 6px; opacity: 0.9; position: relative; z-index: 1; }

/* ===================== 商品详情 ===================== */
.pdp-hero {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  font-size: 110px;
  position: relative;
}
.pdp-hero::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 32% 26%, rgba(255,255,255,0.6), transparent 62%);
}
.pdp-price-row { display: flex; align-items: baseline; gap: 10px; }
.pdp-title { font-size: 20px; font-weight: 750; letter-spacing: -0.3px; line-height: 1.3; }
.pdp-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.pdp-fact { background: var(--surface-2); border-radius: 11px; padding: 9px 10px; }
.pdp-fact b { display: block; font-size: 14px; }
.pdp-fact span { font-size: 11px; color: var(--muted); }

.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; height: 34px; }
.qty button { width: 34px; height: 34px; font-size: 17px; color: var(--ink-2); }
.qty span { min-width: 34px; text-align: center; font-weight: 650; font-size: 14px; }

.pdp-actions {
  position: fixed;
  bottom: 0; left: 50%; transform: translateX(-50%);
  width: min(480px, 100%);
  padding: 10px 16px calc(10px + var(--safe-b));
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  display: flex; gap: 10px;
  z-index: 60;
}

/* ===================== 购物车 / 结算 ===================== */
.cart-bar {
  position: fixed;
  bottom: calc(var(--tab-h) + var(--safe-b));
  left: 50%; transform: translateX(-50%);
  width: min(480px, 100%);
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px;
  z-index: 45;
}
.cart-total { flex: 1; }
.cart-total b { font-size: 20px; color: var(--rose); letter-spacing: -0.4px; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.input {
  height: 44px;
  padding: 0 13px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}
.input:focus { border-color: #e3b3c1; box-shadow: 0 0 0 3px var(--rose-soft); }
textarea.input { height: auto; padding: 11px 13px; resize: vertical; min-height: 70px; }
.input--sm { height: 36px; font-size: 13px; }
select.input { appearance: none; background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23948a82' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; padding-right: 32px; }

/* ===================== 订单 ===================== */
.order-card { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.order-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.order-no { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.order-items { display: flex; gap: 8px; }
.order-thumb {
  width: 46px; height: 46px; border-radius: 10px;
  display: grid; place-items: center; font-size: 20px; flex: none;
}

.pickup-code {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #fdf3e6, #fbe9ec);
  border: 1px dashed #edc9c1;
}
.pickup-code b { font-size: 26px; letter-spacing: 5px; font-variant-numeric: tabular-nums; color: var(--rose-dark); }

/* ===================== 登录 ===================== */
.auth-wrap { padding: 40px 24px; min-height: 100vh; display: flex; flex-direction: column; }
.auth-logo { font-size: 46px; text-align: center; }
.auth-title { font-size: 22px; font-weight: 800; text-align: center; margin: 10px 0 4px; letter-spacing: -0.4px; }
.auth-sub { text-align: center; color: var(--muted); font-size: 12.5px; margin-bottom: 26px; }
.auth-switch { text-align: center; font-size: 13px; color: var(--muted); margin-top: 18px; }
.auth-switch b { color: var(--rose); cursor: pointer; }
.demo-hint {
  margin-top: 22px; padding: 12px 14px;
  border-radius: 12px; background: var(--leaf-soft);
  font-size: 12px; color: #3f5c3c; line-height: 1.6;
}

/* ===================== 我的 ===================== */
.me-head {
  padding: 22px 18px 18px;
  background: linear-gradient(150deg, #fbe9ee 0%, #f7f2e9 100%);
  border-radius: 0 0 22px 22px;
  display: flex; align-items: center; gap: 14px;
}
.avatar {
  width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 24px; color: #fff; font-weight: 700;
  flex: none;
}
.menu-list { background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.menu-item:last-child { border-bottom: 0; }
.menu-item .emoji { font-size: 18px; width: 22px; text-align: center; }
.menu-item .arrow { margin-left: auto; color: #cbc2b9; font-size: 15px; }

/* ===================== 后台 ===================== */
.admin-layout { display: grid; grid-template-columns: 210px 1fr; min-height: 100vh; background: var(--bg); }
.admin-nav {
  background: #2f2a27;
  color: #e8e1da;
  padding: 18px 0;
  display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 0; height: 100vh;
}
.admin-nav__brand { padding: 0 18px 16px; font-size: 13px; font-weight: 700; letter-spacing: 1px; color: #fff; }
.admin-nav__brand small { display: block; font-weight: 400; font-size: 10.5px; color: #a99f97; letter-spacing: 0.6px; margin-top: 2px; }
.admin-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 18px;
  font-size: 13.5px;
  color: #bdb3ab;
  border-left: 3px solid transparent;
}
.admin-nav a.is-active { background: rgba(255, 255, 255, 0.07); color: #fff; border-left-color: var(--rose); font-weight: 600; }
.admin-nav a:hover { color: #fff; }
.admin-main { padding: 22px 26px 60px; min-width: 0; }
.admin-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.admin-head h1 { font-size: 20px; margin: 0; letter-spacing: -0.3px; }
.admin-head .spacer { flex: 1; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.kpi__label { font-size: 11.5px; color: var(--muted); }
.kpi__value { font-size: 24px; font-weight: 750; letter-spacing: -0.6px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi__value small { font-size: 13px; font-weight: 600; margin-left: 2px; color: var(--muted); }
.kpi__hint { font-size: 11px; color: var(--muted); margin-top: 2px; }
.kpi--rose { background: linear-gradient(140deg, #fdf1f4, #fff); }
.kpi--leaf { background: linear-gradient(140deg, #eff5ed, #fff); }

.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left; padding: 11px 12px;
  background: var(--surface-2);
  font-size: 11.5px; font-weight: 650; color: var(--ink-2);
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 2;
}
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr.is-selected td { background: #fdf7f9; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .spacer { flex: 1; }

.bulk-bar {
  position: sticky; bottom: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: #2f2a27;
  color: #fff;
  border-radius: var(--radius);
  margin-top: 12px;
  box-shadow: var(--shadow-lg);
  flex-wrap: wrap;
}
.bulk-bar b { color: #ffd9a0; }

.bar-chart { display: flex; align-items: flex-end; gap: 6px; height: 130px; padding: 8px 0; }
.bar-chart__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.bar-chart__bar {
  width: 100%;
  max-width: 30px;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(180deg, #e08ba1, var(--rose));
  min-height: 3px;
  transition: height 0.4s;
}
.bar-chart__label { font-size: 9.5px; color: var(--muted); white-space: nowrap; }

/* ===================== 弹层 / 提示 ===================== */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(43, 35, 32, 0.42);
  backdrop-filter: blur(2px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 100;
  animation: fade 0.16s ease;
}
.modal {
  width: min(420px, 100%);
  max-height: 82vh;
  overflow: auto;
  background: var(--surface);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow-lg);
  animation: pop 0.18s ease;
}
.modal h3 { margin: 0 0 4px; font-size: 17px; }
.modal__sub { font-size: 12.5px; color: var(--muted); margin-bottom: 16px; }
.modal__foot { display: flex; gap: 10px; margin-top: 18px; }
.modal__foot .btn { flex: 1; }

.copy-box {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  font-size: 13px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 46vh;
  overflow: auto;
  font-family: inherit;
}

.toast {
  position: fixed;
  left: 50%; bottom: calc(90px + var(--safe-b));
  transform: translate(-50%, 12px);
  padding: 10px 18px;
  border-radius: 22px;
  background: rgba(43, 35, 32, 0.92);
  color: #fff;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 200;
  max-width: 80vw;
  text-align: center;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

.skeleton {
  background: linear-gradient(90deg, #f1ebe4 25%, #f8f4ee 50%, #f1ebe4 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: 10px;
}
.loading-block { height: 100px; }
.loading-row { height: 62px; margin-bottom: 10px; }

@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }

/* ===================== 响应式 ===================== */
@media (max-width: 860px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-nav {
    position: static; height: auto;
    flex-direction: row; overflow-x: auto;
    padding: 10px;
    gap: 4px;
  }
  .admin-nav__brand { display: none; }
  .admin-nav a { border-left: 0; border-bottom: 2px solid transparent; white-space: nowrap; padding: 8px 12px; border-radius: 8px; }
  .admin-nav a.is-active { border-left: 0; border-bottom-color: var(--rose); background: rgba(255,255,255,0.09); }
  .admin-main { padding: 16px 14px 60px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ===================== 场景横条（送爱人 / 送长辈 …） ===================== */
.scene-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 16px 10px;
  margin: 0 -16px;
  scrollbar-width: none;
}
.scene-bar::-webkit-scrollbar { display: none; }
.scene-chip {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 13px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--ink-2);
  white-space: nowrap;
  transition: all 0.15s;
}
.scene-chip.is-active {
  background: var(--rose);
  border-color: var(--rose);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(196, 82, 110, 0.25);
}

/* ===================== 左侧类目 + 右侧列表 ===================== */
.category-layout {
  display: grid;
  grid-template-columns: 94px 1fr;
  align-items: start;
  border-top: 1px solid var(--line);
}
.cat-rail {
  position: sticky;
  top: 58px;
  max-height: calc(100vh - 58px - var(--tab-h));
  overflow-y: auto;
  background: var(--surface-2);
  scrollbar-width: none;
  padding: 4px 0;
}
.cat-rail::-webkit-scrollbar { display: none; }
.cat-rail__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 13px 6px;
  font-size: 12px;
  line-height: 1.3;
  color: var(--ink-2);
  text-align: center;
  border-left: 3px solid transparent;
  position: relative;
}
.cat-rail__item .emoji { font-size: 17px; }
.cat-rail__item.is-active {
  background: var(--surface);
  color: var(--rose-dark);
  font-weight: 650;
  border-left-color: var(--rose);
}
.cat-rail__count { font-size: 10px; color: var(--muted); font-weight: 400; }
.cat-rail__item.is-active .cat-rail__count { color: var(--rose); }

.cat-content { padding: 12px 14px 20px; min-width: 0; }
.sort-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 4px;
}
.sort-bar__item {
  font-size: 13px;
  color: var(--muted);
  position: relative;
  padding-bottom: 2px;
}
.sort-bar__item.is-active { color: var(--ink); font-weight: 650; }
.sort-bar__item.is-active::after {
  content: "";
  position: absolute;
  left: 50%; bottom: -2px;
  transform: translateX(-50%);
  width: 16px; height: 2.5px;
  border-radius: 2px;
  background: var(--rose);
}

/* ===================== 横向商品行（分类页右栏） ===================== */
.goods-line {
  display: flex;
  gap: 11px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  align-items: flex-start;
}
.goods-line:last-child { border-bottom: 0; }
.goods-line__thumb {
  width: 86px; height: 86px;
  flex: none;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-size: 34px;
  position: relative;
  overflow: hidden;
}
.goods-line__thumb::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 32% 26%, rgba(255,255,255,0.5), transparent 62%);
}
.goods-line__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.goods-line__title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.goods-line__price { color: var(--rose); font-weight: 750; font-size: 16.5px; letter-spacing: -0.3px; margin-top: 2px; }
.goods-line__price small { font-size: 11px; }
.goods-line__meta { font-size: 11px; color: var(--muted); }
.goods-line__member {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  align-self: flex-start;
  margin-top: 2px;
  padding: 1px 6px;
  border-radius: 4px;
  background: linear-gradient(120deg, #fdf0dc, #f9e3c4);
  color: #a5701f;
  font-size: 10.5px;
  font-weight: 650;
}
.goods-line__pin {
  position: absolute;
  top: 4px; left: 4px;
  z-index: 2;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(43, 35, 32, 0.72);
  color: #fff;
  font-size: 9.5px;
  font-weight: 600;
}

/* ===================== 会员卡 ===================== */
.member-card {
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  background: linear-gradient(135deg, #2f2a27 0%, #4a3d36 55%, #6b5145 100%);
  color: #f6ece2;
  position: relative;
  overflow: hidden;
}
.member-card::after {
  content: "";
  position: absolute;
  right: -30px; top: -50px;
  width: 150px; height: 150px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 214, 160, 0.28), transparent 70%);
}
.member-card__label { font-size: 11px; letter-spacing: 2.5px; color: #d9b98f; font-weight: 700; }
.member-card__title { font-size: 19px; font-weight: 800; margin-top: 5px; letter-spacing: -0.3px; }
.member-card__sub { font-size: 11.5px; opacity: 0.76; margin-top: 3px; }
.member-card__plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; position: relative; z-index: 1; }
.member-plan {
  border-radius: 11px;
  padding: 9px 6px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}
.member-plan:hover { background: rgba(255, 255, 255, 0.18); }
.member-plan.is-picked { background: rgba(255, 214, 160, 0.2); border-color: #ffd6a0; }
.member-plan b { display: block; font-size: 17px; letter-spacing: -0.3px; }
.member-plan span { font-size: 10.5px; opacity: 0.8; }
.member-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 10px;
  background: linear-gradient(120deg, #f7d9a8, #e8b877);
  color: #5d4113;
  font-size: 11px;
  font-weight: 700;
}

/* ===================== 后台：上架/下架 Tab ===================== */
.tab-switch {
  display: inline-flex;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.tab-switch__item {
  padding: 7px 18px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 550;
}
.tab-switch__item.is-active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

/* 行内操作菜单 */
.row-menu {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 30;
  min-width: 132px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 5px 0;
  overflow: hidden;
}
.row-menu__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--ink-2);
}
.row-menu__item:hover { background: var(--surface-2); color: var(--ink); }
.row-menu__item.is-danger { color: var(--danger); }

.menu-anchor { position: relative; display: inline-block; }


/* ===================== 真实商品图 ===================== */
.goods__thumb img,
.goods-line__thumb img,
.goods-row__thumb img,
.order-thumb img,
.pdp-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
  position: relative;
  z-index: 1;
}
.pdp-hero img { border-radius: 0; }


/* ===================== 朋友圈素材库 ===================== */
.materials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
}
.material-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
}
.material-card:hover { border-color: #f2cfd9; }

/* 批量传图 */
.upload-list { max-height: 320px; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
.upload-row { display: flex; align-items: center; gap: 10px; }
.upload-row__thumb {
  width: 44px; height: 44px; border-radius: 8px; overflow: hidden;
  flex: none; background: var(--surface-2);
}
.upload-row__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upload-row__name {
  min-width: 0; flex: 1; font-size: 12.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
