:root {
  --brand: #ff5a1f;
  --brand-dark: #e84910;
  --brand-soft: #fff1ea;
  --ink: #101828;
  --text: #344054;
  --muted: #667085;
  --light: #98a2b3;
  --line: #e7eaf0;
  --bg: #f6f7f9;
  --card: #ffffff;
  --price: #f0441c;
  --green: #12b76a;
  --green-soft: #e8f8f0;
  --red: #e5484d;
  --red-soft: #fdecec;
  --blue: #2f64e8;
  --blue-soft: #eaf0ff;
  --amber: #b54708;
  --amber-soft: #fdf3e6;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 18px rgba(16, 24, 40, .05);
  --shadow-lg: 0 8px 24px rgba(16, 24, 40, .08), 0 28px 60px rgba(16, 24, 40, .12);
  --max: 1200px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, p { margin: 0; }

.container { width: min(100% - 48px, var(--max)); margin: 0 auto; }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 12.5px; }
.muted { color: var(--muted); }
.money { color: var(--price); font-weight: 700; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-weight: 500;
  cursor: pointer;
  transition: .16s ease;
  white-space: nowrap;
}
.btn:hover { border-color: #cbd3e1; color: var(--brand); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.dark:hover { background: #1d2939; border-color: #1d2939; color: #fff; }
.btn.ghost { background: transparent; }
.btn.sm { height: 34px; padding: 0 14px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; height: 46px; font-size: 15px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.link-btn {
  border: 0;
  background: transparent;
  color: var(--blue);
  padding: 0;
  cursor: pointer;
  font-size: 13px;
}
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--red); }

/* ---------- shared states ---------- */
.empty-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 70px 24px;
  text-align: center;
  box-shadow: var(--shadow);
}
.empty-icon {
  width: 58px; height: 58px;
  margin: 0 auto 16px;
  border-radius: 18px;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid; place-items: center;
  font-size: 22px; font-weight: 700;
}
.empty-panel h3 { font-size: 17px; margin-bottom: 6px; }
.empty-panel p { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.empty-panel.error .empty-icon { background: var(--red-soft); color: var(--red); }
.empty-actions { display: flex; gap: 10px; justify-content: center; }
.muted-text { color: var(--muted); font-size: 13px; }

/* ---------- mall header ---------- */
.mall-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.mall-header-inner { display: flex; align-items: center; gap: 28px; height: 72px; }
.mall-brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-logo {
  width: 38px; height: 38px;
  border-radius: 11px;
  box-shadow: 0 6px 16px rgba(16, 24, 40, .16);
  flex-shrink: 0;
}
.brand-name { font-size: 18px; font-weight: 700; letter-spacing: .2px; }
.mall-nav { display: flex; gap: 4px; }
.mall-nav a { padding: 8px 14px; border-radius: 999px; color: var(--text); font-weight: 500; }
.mall-nav a:hover, .mall-nav a.router-link-exact-active { color: var(--brand); background: var(--brand-soft); }
.mall-search { position: relative; margin-left: auto; width: min(320px, 30vw); }
.mall-search input {
  width: 100%; height: 40px;
  padding: 0 44px 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8f9fb;
  outline: none;
  transition: .16s ease;
}
.mall-search input:focus { background: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255, 90, 31, .1); }
.mall-search button {
  position: absolute; right: 4px; top: 4px;
  width: 32px; height: 32px;
  border: 0; border-radius: 50%;
  background: var(--ink); color: #fff;
  display: grid; place-items: center;
  cursor: pointer;
}
.mall-search button:hover { background: var(--brand); }
.mall-user { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-size: 13px; max-width: 150px; overflow: hidden; }
.avatar {
  width: 34px; height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffe0d2, #ffb99b);
  color: #b13a0f;
  display: grid; place-items: center;
  font-weight: 700;
  font-size: 14px;
}
.avatar.sm { width: 26px; height: 26px; font-size: 12px; }

/* ---------- mall hero ---------- */
.mall-main { padding: 24px 0 64px; min-height: 60vh; }
.hero {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  background:
    radial-gradient(700px 420px at 88% 12%, rgba(255, 122, 69, .38), transparent 62%),
    radial-gradient(620px 420px at 66% 118%, rgba(47, 100, 232, .34), transparent 60%),
    linear-gradient(120deg, #0c1729 0%, #16253f 55%, #1c2f4a 100%);
  color: #fff;
}
.hero-inner { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 30px; padding: 58px 48px; min-height: 360px; }
.hero-copy { position: relative; z-index: 2; }
.hero-eyebrow { display: inline-block; padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); font-size: 11px; letter-spacing: 1.6px; color: #ffd9c9; }
.hero h1 { margin: 16px 0 10px; font-size: 36px; line-height: 1.28; letter-spacing: 1px; font-weight: 700; }
.hero p { color: rgba(255, 255, 255, .72); font-size: 14px; }
.hero-search { display: flex; max-width: 520px; margin-top: 24px; padding: 5px; border-radius: 999px; background: #fff; box-shadow: 0 14px 34px rgba(3, 10, 24, .3); }
.hero-search input { flex: 1; min-width: 0; height: 42px; padding: 0 18px; border: 0; outline: none; background: transparent; color: var(--ink); border-radius: 999px; }
.hero-search button { flex-shrink: 0; height: 42px; padding: 0 28px; border: 0; border-radius: 999px; background: var(--brand); color: #fff; font-weight: 600; cursor: pointer; }
.hero-search button:hover { background: var(--brand-dark); }
.hero-metrics { display: flex; gap: 36px; margin-top: 26px; }
.hero-metrics b { display: block; font-size: 20px; line-height: 1.2; }
.hero-metrics span { font-size: 12px; color: rgba(255, 255, 255, .6); }
.hero-art { position: relative; height: 260px; }
.art-card {
  position: absolute;
  width: 172px; height: 216px;
  border-radius: 18px;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, .22);
  background: linear-gradient(150deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, .04));
  backdrop-filter: blur(6px);
  box-shadow: 0 24px 50px rgba(2, 8, 20, .35);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 1px;
}
.art-card small { font-size: 12px; font-weight: 500; color: rgba(255, 255, 255, .66); letter-spacing: .5px; }
.art-1 { right: 118px; top: 12px; transform: rotate(-8deg); }
.art-2 { right: 16px; top: 52px; transform: rotate(7deg); background: linear-gradient(150deg, rgba(255, 122, 69, .4), rgba(255, 90, 31, .08)); }
.art-ring {
  position: absolute; left: 8px; bottom: -60px;
  width: 190px; height: 190px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: inset 0 0 80px rgba(255, 122, 69, .12);
}

/* ---------- categories & filters ---------- */
.cat-bar { display: flex; gap: 10px; flex-wrap: wrap; margin: 26px 0 16px; }
.cat-pill {
  display: inline-flex; align-items: center; gap: 7px;
  height: 38px; padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: .16s ease;
  font-weight: 500;
}
.cat-pill em { font-style: normal; font-size: 11px; color: var(--light); background: var(--bg); padding: 1px 6px; border-radius: 999px; }
.cat-pill:hover { border-color: #f3b59c; color: var(--brand); }
.cat-pill.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.cat-pill.active em { background: rgba(255, 255, 255, .16); color: #fff; }

.filter-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 20px;
}
.filter-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-left label { color: var(--muted); font-size: 13px; }
.filter-left label.price-label { margin-left: 10px; }
.filter-left select, .filter-left input {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  outline: none;
}
.filter-left select:focus, .filter-left input:focus { border-color: var(--brand); }
.filter-left input { width: 88px; }
.filter-left .dash { color: var(--light); }
.filter-right { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-right b { color: var(--ink); }
.filter-right .link-btn { margin-left: 4px; }

/* ---------- product grid ---------- */
.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.product-card {
  display: flex; flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.product-card:hover { transform: translateY(-4px); border-color: #f6d3c4; box-shadow: var(--shadow-lg); }
.product-img { position: relative; aspect-ratio: 1/1; background: linear-gradient(135deg, #fff4ee, #f7f9fc); overflow: hidden; }
.product-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.product-card:hover .product-img img { transform: scale(1.05); }
.img-fallback {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #ffe9dd, #fff6f1 55%, #ffe1d2);
  color: #d1602c;
  font-size: 46px;
  font-weight: 800;
}
.tag-cat {
  position: absolute; top: 12px; left: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(16, 24, 40, .1);
}
.product-body { display: flex; flex-direction: column; flex: 1; padding: 14px 16px 16px; }
.product-name {
  font-size: 14px; font-weight: 600; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 44px;
  margin-bottom: 8px;
}
.product-card:hover .product-name { color: var(--brand); }
.product-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.product-chips span { font-size: 11.5px; color: var(--muted); background: var(--bg); padding: 2px 8px; border-radius: 6px; }
.product-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.product-price { color: var(--price); font-weight: 800; font-size: 22px; line-height: 1.1; letter-spacing: -.3px; }
.product-price small { font-size: 13px; font-weight: 700; margin-right: 1px; }
.product-sales { color: var(--light); font-size: 11.5px; text-align: right; line-height: 1.5; }
.product-sales span { color: var(--muted); }

/* skeletons */
.product-skeleton { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; padding-bottom: 16px; }
.sk-img { aspect-ratio: 1/1; background: linear-gradient(90deg, #f0f2f6 25%, #f8f9fb 37%, #f0f2f6 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
.sk-line { height: 12px; margin: 12px 16px 0; border-radius: 6px; background: linear-gradient(90deg, #f0f2f6 25%, #f8f9fb 37%, #f0f2f6 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
.sk-line.short { width: 45%; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* pager */
.pager { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 34px; flex-wrap: wrap; }
.pager-btn {
  min-width: 36px; height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: .15s ease;
}
.pager-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.pager-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.pager-btn:disabled { opacity: .45; cursor: not-allowed; }
.pager-info { color: var(--muted); font-size: 12.5px; margin-left: 6px; }

/* ---------- breadcrumb & detail ---------- */
.crumb { display: flex; align-items: center; gap: 8px; color: var(--light); font-size: 13px; margin-bottom: 18px; flex-wrap: wrap; }
.crumb a:hover { color: var(--brand); }
.crumb-current { color: var(--text); max-width: 50vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-card {
  display: grid; grid-template-columns: 430px minmax(0, 1fr); gap: 36px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 30px;
  box-shadow: var(--shadow);
}
.detail-img { position: relative; aspect-ratio: 1/1; border-radius: 16px; overflow: hidden; background: linear-gradient(135deg, #fff4ee, #f7f9fc); }
.detail-img img { width: 100%; height: 100%; object-fit: cover; }
.detail-img .img-fallback { font-size: 76px; }
.detail-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.tag { padding: 3px 10px; border-radius: 6px; background: var(--bg); color: var(--muted); font-size: 12px; }
.tag.hot { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.detail-name { font-size: 24px; line-height: 1.45; font-weight: 700; margin-bottom: 16px; }
.detail-price-box {
  background: linear-gradient(120deg, #fff5ef, #fff0e8);
  border: 1px solid #ffe0d0;
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 18px;
}
.detail-price-box .label { font-size: 12px; color: #a85430; }
.detail-price { color: var(--price); font-size: 36px; font-weight: 800; line-height: 1.2; letter-spacing: -.5px; }
.detail-price small { font-size: 18px; font-weight: 700; margin-right: 2px; }
.price-tip { display: block; color: #b06a4b; font-size: 12px; margin-top: 2px; }
.detail-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 18px; }
.detail-stats div { background: #fff; padding: 12px 16px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.detail-stats span { color: var(--muted); font-size: 12.5px; }
.detail-stats b { font-weight: 600; }
.detail-notice { display: flex; gap: 10px; align-items: flex-start; background: var(--blue-soft); color: #2b4f9e; border-radius: 10px; padding: 12px 14px; font-size: 12.5px; line-height: 1.65; }
.detail-notice b { flex-shrink: 0; }
.desc-card { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 26px 30px; margin-top: 22px; box-shadow: var(--shadow); }
.desc-card h2 { display: flex; align-items: center; gap: 10px; font-size: 17px; margin-bottom: 16px; }
.desc-card h2 i { width: 4px; height: 17px; border-radius: 2px; background: var(--brand); }
.rich-text { color: var(--text); font-size: 14px; line-height: 1.9; word-break: break-word; }
.rich-text img { max-width: 100%; height: auto; border-radius: 10px; margin: 10px 0; }
.rich-text p { margin: 8px 0; }
.rich-text h1, .rich-text h2, .rich-text h3 { color: var(--ink); line-height: 1.5; margin: 16px 0 8px; }
.rich-text a { color: var(--blue); text-decoration: underline; }
.rich-text ul, .rich-text ol { padding-left: 22px; }
.rich-text table { width: 100%; border-collapse: collapse; margin: 10px 0; }
.rich-text th, .rich-text td { border: 1px solid var(--line); padding: 7px 10px; }
.rich-text pre { background: #f8f9fb; border-radius: 8px; padding: 12px; overflow: auto; }
.rich-text blockquote { margin: 10px 0; padding-left: 12px; border-left: 3px solid var(--line); color: var(--muted); }

/* ---------- auth ---------- */
.auth-page {
  min-height: calc(100vh - 72px);
  display: grid; place-items: center;
  padding: 44px 20px 70px;
  background:
    radial-gradient(600px 340px at 12% 0%, rgba(255, 122, 69, .12), transparent 60%),
    radial-gradient(600px 340px at 92% 10%, rgba(47, 100, 232, .1), transparent 60%),
    var(--bg);
}
.auth-card { width: min(100%, 420px); background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 36px 34px 26px; box-shadow: var(--shadow-lg); }
.auth-head { text-align: center; margin-bottom: 24px; }
.auth-logo { width: 54px; height: 54px; border-radius: 16px; margin-bottom: 14px; box-shadow: 0 8px 20px rgba(16, 24, 40, .18); }
.auth-head h1 { font-size: 22px; margin-bottom: 6px; }
.auth-head p { color: var(--muted); font-size: 13px; }
.form-item { margin-bottom: 15px; }
.form-item label { display: block; font-size: 12.5px; color: var(--text); margin-bottom: 6px; font-weight: 500; }
.form-item label em { color: var(--red); font-style: normal; }
.form-item input, .form-item select {
  width: 100%; height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfd;
  outline: none;
  transition: .15s ease;
}
.form-item input:focus, .form-item select:focus { background: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255, 90, 31, .1); }
.form-error { color: var(--red); font-size: 12.5px; margin: -4px 0 12px; }
.auth-foot { text-align: center; color: var(--muted); font-size: 13px; margin-top: 18px; }
.auth-foot a { color: var(--brand); font-weight: 600; }
.auth-back { text-align: center; margin-top: 14px; font-size: 12.5px; color: var(--light); }
.auth-back a:hover { color: var(--brand); }

/* ---------- footer ---------- */
.mall-footer { border-top: 1px solid var(--line); background: #fff; padding: 28px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-inner b { font-size: 14px; }
.footer-inner p { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.footer-meta { color: var(--light); font-size: 12px; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  top: 22px; left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  background: #101828;
  color: #fff;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 13px;
  box-shadow: 0 12px 32px rgba(16, 24, 40, .24);
  animation: toast-in .2s ease;
  max-width: min(90vw, 460px);
}
.toast.error { background: #b42318; }
.toast.warn { background: #b54708; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- admin layout ---------- */
.admin-shell { display: flex; min-height: 100vh; background: #f4f6fa; }
.admin-sidebar {
  width: 232px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #0d1526, #111c31);
  color: #c3cbdb;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.admin-brand { display: flex; align-items: center; gap: 11px; padding: 0 6px 22px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.admin-brand .logo { width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0; box-shadow: 0 6px 16px rgba(0, 0, 0, .28); }
.admin-brand b { display: block; color: #fff; font-size: 14.5px; line-height: 1.3; }
.admin-brand small { display: block; font-size: 9.5px; letter-spacing: 1.3px; color: #6b7891; }
.admin-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 18px; }
.admin-nav-item {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  border-radius: 9px;
  color: #aab4c8;
  font-size: 13.5px;
  transition: .15s ease;
}
.admin-nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.admin-nav-item.router-link-exact-active { background: rgba(255, 90, 31, .14); color: #ffb494; font-weight: 600; }
.admin-nav-item.router-link-exact-active::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .55; }
.admin-sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .08); }
.admin-side-link { display: block; padding: 9px 14px; border: 0; border-radius: 8px; background: transparent; color: #8b96ac; text-align: left; font-size: 13px; cursor: pointer; }
.admin-side-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
  height: 66px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.admin-topbar h1 { font-size: 18px; font-weight: 700; }
.admin-user { display: flex; align-items: center; gap: 9px; color: var(--text); font-size: 13px; }
.admin-content { padding: 24px 28px 50px; }

/* admin toolbar */
.admin-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.search-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search-group input, .search-group select {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  outline: none;
}
.search-group input { width: 240px; }
.search-group input:focus, .search-group select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255, 90, 31, .08); }
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar-meta { color: var(--muted); font-size: 13px; }
.admin-error { background: var(--red-soft); color: #b42318; border-radius: 9px; padding: 10px 14px; font-size: 13px; margin-bottom: 14px; }
.detail-back { margin-bottom: 14px; font-size: 13px; }
.detail-back a { color: var(--blue); }
.detail-back a:hover { text-decoration: underline; }

/* admin table */
.table-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.table-card-head { padding: 15px 20px; border-bottom: 1px solid var(--line); font-weight: 600; }
.table-scroll { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.admin-table th {
  text-align: left;
  padding: 11px 16px;
  background: #fafbfd;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.admin-table td { padding: 13px 16px; border-bottom: 1px solid #f1f3f8; vertical-align: middle; font-size: 13px; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover td { background: #fbfcfe; }
.table-empty { text-align: center; color: var(--light); padding: 46px 16px !important; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell b { display: block; font-size: 13px; line-height: 1.4; }
.user-cell small { display: block; color: var(--light); font-size: 11.5px; }
.user-cell.compact .avatar { width: 28px; height: 28px; font-size: 12px; }
.role-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; background: #eef1f6; color: var(--muted); font-size: 12px; }
.role-badge.admin { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }
.products-table { min-width: 980px; }
.product-cell { display: flex; align-items: center; gap: 11px; min-width: 260px; }
.product-cell b { display: block; font-weight: 600; line-height: 1.45; max-width: 330px; }
.product-cell small { display: block; color: var(--light); margin-top: 2px; }
.thumb { width: 44px; height: 44px; flex-shrink: 0; border-radius: 8px; overflow: hidden; background: #f4f6fa; display: grid; place-items: center; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb i { font-style: normal; font-size: 16px; font-weight: 700; color: #d1602c; }
.thumb.small { width: 38px; height: 38px; }
.onoff { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.onoff.on { background: var(--green-soft); color: #087443; }
.onoff.off { background: #f1f3f7; color: var(--muted); }
.row-actions { display: flex; gap: 12px; white-space: nowrap; }
.order-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.order-badge.lg { padding: 5px 14px; font-size: 13px; }
.st-pending { background: var(--amber-soft); color: var(--amber); }
.st-shipped { background: var(--blue-soft); color: #1f4fc4; }
.st-completed { background: var(--green-soft); color: #087443; }
.st-cancelled { background: #f1f3f7; color: var(--muted); }
.st-unknown { background: #f1f3f7; color: var(--muted); }

/* admin order detail */
.order-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; margin-bottom: 14px; box-shadow: var(--shadow); }
.order-summary h2 { font-size: 18px; }
.order-summary p { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.info-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 12px; margin-bottom: 14px; }
.info-card { background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 14px 16px; }
.info-card span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 3px; }
.info-card b { font-size: 14px; }
.order-remark { color: var(--muted); font-size: 13px; margin-top: 12px; }

/* admin modals & forms */
.modal-mask {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(10, 18, 32, .5);
  backdrop-filter: blur(3px);
  display: grid; place-items: center;
  padding: 24px;
}
.modal-card { width: min(100%, 580px); max-height: 88vh; display: flex; flex-direction: column; background: #fff; border-radius: 16px; box-shadow: 0 30px 80px rgba(3, 10, 24, .35); animation: modal-in .18s ease; }
.modal-card.wide { width: min(100%, 900px); }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16px; font-weight: 700; line-height: 1.4; }
.modal-close { border: 0; background: transparent; font-size: 22px; line-height: 1; color: var(--light); cursor: pointer; padding: 0 2px; }
.modal-close:hover { color: var(--ink); }
.modal-body { padding: 20px 22px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line); background: #fbfcfd; border-radius: 0 0 16px 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.inline-add { display: flex; gap: 8px; margin-bottom: 14px; }
.inline-add input { flex: 1; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; outline: none; }
.inline-add input:focus { border-color: var(--brand); }
.cat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.cat-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; }
.cat-list li:hover { background: #f8f9fb; }
.cat-list li span { font-weight: 500; }
.cat-list li small { color: var(--light); margin-right: auto; }

/* import */
.import-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.import-list { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; max-height: 46vh; overflow-y: auto; }
.import-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid #f1f3f8; cursor: pointer; transition: .12s; }
.import-item:last-child { border-bottom: 0; }
.import-item:hover { background: #fbfcfe; }
.import-item.picked { background: #fff7f3; }
.import-item input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand); flex-shrink: 0; }
.import-name { flex: 1; min-width: 0; }
.import-name b { display: block; font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-name small { display: block; color: var(--light); font-size: 11.5px; margin-top: 1px; }
.import-price { color: var(--text); font-size: 12.5px; white-space: nowrap; }
.import-state { color: var(--green); font-size: 12px; width: 74px; text-align: right; flex-shrink: 0; }
.import-state.muted { color: var(--light); }

/* price page */
.price-tip { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--amber-soft); border: 1px solid #f5dfc2; color: #7a4a11; border-radius: 10px; padding: 12px 16px; font-size: 12.5px; margin-bottom: 16px; }
.price-tip b { flex-shrink: 0; }
.price-name b { display: block; font-weight: 500; line-height: 1.45; max-width: 430px; }
.price-name small { display: block; color: var(--light); margin-top: 2px; }
.price-input { display: flex; align-items: center; gap: 4px; }
.price-input span { color: var(--muted); font-size: 13px; }
.price-input input { width: 110px; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; outline: none; }
.price-input input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255, 90, 31, .08); }
.profit { color: var(--green); font-weight: 600; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .detail-card { grid-template-columns: 360px minmax(0, 1fr); gap: 26px; }
  .hero h1 { font-size: 30px; }
  .hero-art { transform: scale(.85); transform-origin: right center; }
  .info-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .admin-sidebar { width: 196px; }
  .admin-content { padding: 20px; }
  .hero-inner { grid-template-columns: 1fr; padding: 44px 34px; }
  .hero-art { display: none; }
  .detail-card { grid-template-columns: 1fr; padding: 22px; }
  .detail-img { max-width: 420px; width: 100%; margin: 0 auto; }
  .search-group input { width: 180px; }
}

@media (max-width: 760px) {
  .container { width: calc(100% - 28px); }
  .mall-header-inner { height: 62px; gap: 12px; }
  .brand-name { font-size: 16px; }
  .mall-nav { display: none; }
  .mall-search { width: auto; flex: 1; }
  .mall-user .user-chip { display: none; }
  .hero { border-radius: 18px; }
  .hero-inner { padding: 34px 22px; min-height: 0; }
  .hero h1 { font-size: 25px; }
  .hero-metrics { gap: 22px; }
  .cat-bar { margin-top: 18px; gap: 8px; }
  .cat-pill { height: 34px; padding: 0 13px; font-size: 13px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .product-body { padding: 11px 12px 13px; }
  .product-name { font-size: 13px; min-height: 40px; }
  .product-price { font-size: 18px; }
  .filter-left input { width: 74px; }
  .detail-card { padding: 16px; border-radius: 16px; }
  .detail-name { font-size: 19px; }
  .detail-price { font-size: 30px; }
  .detail-stats { grid-template-columns: 1fr; }
  .desc-card { padding: 20px 18px; }
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; height: auto; position: static; padding: 12px 14px; flex-direction: row; align-items: center; gap: 6px; overflow-x: auto; }
  .admin-brand { border: 0; padding: 0 10px 0 0; flex-shrink: 0; }
  .admin-brand small { display: none; }
  .admin-nav { flex-direction: row; margin: 0; gap: 2px; }
  .admin-nav-item { padding: 8px 10px; white-space: nowrap; font-size: 13px; }
  .admin-nav-item.router-link-exact-active::before { display: none; }
  .admin-sidebar-foot { margin: 0 0 0 auto; flex-direction: row; border: 0; padding: 0; }
  .admin-side-link { padding: 8px; white-space: nowrap; }
  .admin-topbar { padding: 0 16px; height: 58px; }
  .admin-content { padding: 16px 14px 40px; }
  .admin-toolbar { align-items: stretch; }
  .search-group { width: 100%; }
  .search-group input { flex: 1; width: auto; min-width: 120px; }
  .info-cards { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .modal-mask { padding: 12px; }
  .import-price { display: none; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 420px) {
  .hero h1 { font-size: 22px; }
  .hero-search button { padding: 0 18px; }
  .hero-metrics b { font-size: 17px; }
  .product-sales { display: none; }
  .detail-notice { flex-direction: column; gap: 4px; }
}

/* ---------- 商品详情下单 ---------- */
.buy-box { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: #fff; margin-bottom: 14px; }
.buy-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.buy-row label { width: 84px; flex-shrink: 0; color: var(--muted); font-size: 12.5px; }
.buy-row label em { color: var(--price); font-style: normal; }
.buy-row input { flex: 1; min-width: 0; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; outline: none; background: #f8fafc; }
.buy-row input[type="number"] { flex: 0 0 92px; }
.buy-row input:focus { background: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255, 90, 31, .08); }
.buy-hint { color: var(--light); font-size: 12px; }
.buy-tip { color: var(--muted); font-size: 12px; line-height: 1.6; margin-top: 10px; }
.buy-error { color: var(--price); font-size: 12.5px; margin-top: 8px; }
.order-success { border: 1px solid #bfe6cf; background: #f2fbf5; border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; }
.order-success b { display: block; color: #1c7c45; font-size: 14px; margin-bottom: 4px; }
.order-success span { color: #215c3a; font-size: 13px; }
.order-success p { color: #3d6b52; font-size: 12.5px; margin: 6px 0 10px; }

/* ---------- 后台订单来源 / CDK ---------- */
.source-badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #eef2f7; color: #475467; white-space: nowrap; }
.email-cell { word-break: break-all; white-space: normal; }
.source-badge.src-offline_proxy { background: #fff4e8; color: #a85a12; }
.source-badge.src-offline { background: #eef4ff; color: #2b4f9e; }
.avatar.alt { background: #fff1e6; color: #c2410c; }
.cdk { display: inline-block; padding: 3px 8px; border-radius: 6px; background: #f4f6fa; border: 1px solid var(--line); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; letter-spacing: .2px; word-break: break-all; }

@media (max-width: 520px) {
  .buy-row { flex-wrap: wrap; }
  .buy-row label { width: 100%; }
  .buy-row input[type="number"] { flex: 0 0 100px; }
}

/* ---------- 卡密兑换 ---------- */
.redeem-main {
  padding: 34px 0 70px;
  background:
    radial-gradient(620px 320px at 8% 0%, rgba(255, 122, 69, .1), transparent 62%),
    radial-gradient(620px 320px at 95% 6%, rgba(47, 100, 232, .08), transparent 62%);
}
.redeem-head { text-align: center; margin-bottom: 22px; }
.redeem-eyebrow { display: inline-block; font-size: 11px; letter-spacing: 2.4px; font-weight: 700; color: var(--brand-dark); background: var(--brand-soft); padding: 4px 12px; border-radius: 999px; }
.redeem-head h1 { font-size: 28px; margin: 10px 0 6px; letter-spacing: .2px; }
.redeem-head p { color: var(--muted); font-size: 13px; }

.redeem-card { width: min(100%, 780px); margin: 0 auto 18px; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 24px 26px 22px; box-shadow: var(--shadow-lg); }
.redeem-steps { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.redeem-steps span { flex: 1; min-width: 130px; text-align: center; padding: 8px 10px; border-radius: 10px; background: #f4f6fa; color: var(--light); font-size: 12.5px; font-weight: 600; }
.redeem-steps span.on { background: var(--brand-soft); color: var(--brand-dark); }
.redeem-steps span.done { background: var(--green-soft); color: #087443; }

.redeem-line { display: flex; gap: 10px; }
.redeem-line input { flex: 1; min-width: 0; }
.redeem-result { border-radius: 12px; padding: 14px 16px; margin: 4px 0 16px; border: 1px solid var(--line); background: #f8fafc; }
.redeem-result.ok { border-color: #bfe6cf; background: #f2fbf5; }
.redeem-result.bad { border-color: #f3c4c4; background: var(--red-soft); }
.redeem-result-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.redeem-result-head b { font-size: 14.5px; }
.redeem-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px 18px; }
.redeem-meta > div { min-width: 0; }
.redeem-meta span { display: block; color: var(--muted); font-size: 11.5px; margin-bottom: 1px; }
.redeem-meta b { font-size: 13px; font-weight: 600; word-break: break-all; }
.redeem-msg { margin-top: 10px; font-size: 12.5px; color: var(--text); }
.redeem-result.bad .redeem-msg { color: #a12929; }

.redeem-block { border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 14px; background: #fbfcfd; }
.redeem-block-head { display: flex; align-items: baseline; gap: 10px; justify-content: space-between; margin-bottom: 8px; flex-wrap: wrap; }
.redeem-block-head b { font-size: 13.5px; }
.redeem-block-head span { color: var(--light); font-size: 11.5px; }
.redeem-block textarea { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; outline: none; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.6; }
.redeem-block textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255, 90, 31, .08); }
.redeem-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.redeem-pass { color: #087443; font-size: 12.5px; }
.redeem-hint { color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.redeem-submit { margin-top: 4px; }

.redeem-task-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.redeem-task-head h2 { font-size: 18px; }
.redeem-task-head p { color: var(--muted); font-size: 12px; margin-top: 2px; word-break: break-all; }
.redeem-polling { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; margin: 12px 0; }
.redeem-polling .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); animation: redeem-pulse 1.1s ease-in-out infinite; }
@keyframes redeem-pulse { 0%, 100% { opacity: .35; transform: scale(.85); } 50% { opacity: 1; transform: scale(1); } }

.redeem-alert { border-radius: 12px; padding: 13px 16px; margin-top: 12px; border: 1px solid var(--line); background: #f8fafc; }
.redeem-alert b { display: block; font-size: 13.5px; margin-bottom: 4px; }
.redeem-alert p { font-size: 12.5px; color: var(--text); line-height: 1.7; word-break: break-all; }
.redeem-alert.warn { background: var(--amber-soft); border-color: #f5dfc2; color: #7a4a11; }
.redeem-alert.info { background: var(--blue-soft); border-color: #cddbfb; color: #1f3f8f; }
.redeem-alert.ok { background: #f2fbf5; border-color: #bfe6cf; color: #1c7c45; }
.redeem-alert.bad { background: var(--red-soft); border-color: #f3c4c4; color: #a12929; }
.redeem-alert .redeem-line { margin-top: 10px; }
.redeem-alert .redeem-line input { height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff; outline: none; }
.redeem-alert .redeem-line input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255, 90, 31, .08); }

.redeem-delivery { margin-top: 14px; border: 1px solid #bfe6cf; background: #f7fdf9; border-radius: 12px; padding: 14px 16px; }
.redeem-pre { margin: 8px 0 0; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; font-size: 12px; line-height: 1.6; overflow: auto; max-height: 260px; }

.st-queued { background: #eef1f6; color: #475467; }
.st-running { background: var(--blue-soft); color: #1f4fc4; }
.st-action_required { background: var(--amber-soft); color: var(--amber); }
.st-payment_unknown { background: #fdf0e6; color: #a85a12; }
.st-succeeded { background: var(--green-soft); color: #087443; }
.st-failed { background: var(--red-soft); color: #a12929; }

.redemption-table { min-width: 960px; }

@media (max-width: 760px) {
  .redeem-main { padding: 22px 0 48px; }
  .redeem-card { padding: 18px 16px 16px; border-radius: 16px; }
  .redeem-head h1 { font-size: 23px; }
  .redeem-line { flex-direction: column; }
  .redeem-line .btn { width: 100%; }
  .redeem-steps span { min-width: 0; font-size: 11.5px; padding: 7px 6px; }
}
