:root {
  --canvas: #f3f5f9;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --panel: #f3f6fb;
  --line: #e2e8f0;
  --line-strong: #cfd8e5;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --accent: #2f6bff;
  --accent-strong: #1f54d8;
  --accent-soft: #eef4ff;
  --ok: #0f9f6e;
  --ok-soft: #e9fbf2;
  --warn: #c47a0a;
  --warn-soft: #fff6e6;
  --danger: #dc3f4d;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.035);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
.icon { width: 18px; height: 18px; flex: none; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }

.portal-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 22px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
.brand-line {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: #1f2937;
  flex: none;
}
.brand-mark .icon { width: 17px; height: 17px; }
.brand-name { font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.brand-sub {
  color: var(--muted);
  font-size: 12px;
  padding-left: 10px;
  margin-left: 2px;
  border-left: 1px solid var(--line);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 220px;
  color: var(--ink-2);
  font-size: 13px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}
.user-chip i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px var(--ok-soft);
  flex: none;
}
.user-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.btn {
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color 150ms, background 150ms, color 150ms;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: var(--line-strong); background: var(--surface-soft); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover:not(:disabled) { background: #f1f4f8; border-color: transparent; color: var(--ink-2); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; }
.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.icon-btn:hover { background: #f1f4f8; color: var(--ink-2); }

.portal-main {
  width: min(1460px, 100%);
  margin: 0 auto;
  padding: 18px 22px 40px;
}
.query-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.search-box {
  position: relative;
  flex: 1 1 240px;
  max-width: 420px;
}
.search-box .icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--faint);
  pointer-events: none;
}
.search-box input {
  width: 100%;
  height: 34px;
  padding: 0 12px 0 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  outline: none;
}
.search-box input:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.08); }
.select-wrap { position: relative; }
.select-wrap select {
  height: 34px;
  min-width: 118px;
  appearance: none;
  padding: 0 30px 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink-2);
  outline: none;
  cursor: pointer;
}
.select-wrap select:focus { border-color: var(--accent); }
.select-wrap .icon {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--faint);
  pointer-events: none;
}
.toolbar-meta {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.toolbar-meta strong { color: var(--ink-2); font-size: 13px; }

.section-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px 2px 10px;
  color: var(--muted);
  font-size: 12px;
}
.section-line strong { color: var(--ink-2); font-size: 13px; font-weight: 600; }
.breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.breadcrumb .sep { color: var(--faint); }
.breadcrumb .name { color: var(--ink-2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 320px; }

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(228px, 1fr));
  gap: 10px;
}
.shop-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 86px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: border-color 160ms, transform 160ms, box-shadow 160ms;
}
.shop-card:hover {
  border-color: #a9c1ee;
  box-shadow: 0 6px 18px rgba(31, 84, 216, 0.08);
  transform: translateY(-1px);
}
.shop-logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  object-fit: cover;
  flex: none;
}
.shop-logo-fallback {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #eef3fb;
  color: #5b7fb8;
  font-weight: 700;
  flex: none;
}
.shop-copy { min-width: 0; flex: 1; }
.shop-name {
  display: block;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-bottom: 7px;
}
.shop-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tag {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 7px;
  border-radius: 5px;
  background: var(--panel);
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-off { background: #f1f5f9; color: var(--faint); }
.shop-arrow { color: #b8c4d6; flex: none; }
.shop-card:hover .shop-arrow { color: var(--accent); }

.goods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.goods-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 160ms, box-shadow 160ms, transform 160ms;
}
.goods-card:hover {
  border-color: #a9c1ee;
  box-shadow: 0 6px 18px rgba(31, 84, 216, 0.08);
  transform: translateY(-1px);
}
.goods-media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #eef1f5;
  overflow: hidden;
}
.goods-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 260ms ease, transform 220ms;
}
.goods-media.is-loaded img { opacity: 1; }

.goods-blur {
  position: absolute;
  inset: -10%;
  z-index: 0;
  display: block;
  background-color: #e9eff7;
  background-image:
    var(--blur-img, none),
    radial-gradient(30% 34% at 50% 42%, rgba(255, 249, 238, 0.93), transparent 72%),
    radial-gradient(44% 38% at 34% 36%, rgba(150, 172, 201, 0.56), transparent 72%),
    radial-gradient(40% 34% at 70% 62%, rgba(184, 199, 219, 0.6), transparent 72%),
    radial-gradient(34% 30% at 62% 72%, rgba(176, 190, 176, 0.46), transparent 74%),
    radial-gradient(28% 24% at 52% 50%, rgba(255, 255, 255, 0.92), transparent 66%);
  background-position: center;
  background-size: cover;
  filter: blur(14px) saturate(0.9);
  transform: scale(1.08);
  opacity: 0.92;
  pointer-events: none;
  transition: opacity 260ms ease;
}

.goods-blur.is-fallback {
  background-image:
    radial-gradient(30% 34% at 50% 42%, rgba(255, 249, 238, 0.93), transparent 72%),
    radial-gradient(44% 38% at 34% 36%, rgba(150, 172, 201, 0.56), transparent 72%),
    radial-gradient(40% 34% at 70% 62%, rgba(184, 199, 219, 0.6), transparent 72%),
    radial-gradient(28% 24% at 52% 50%, rgba(255, 255, 255, 0.92), transparent 66%);
  background-color: #e9eff7;
}

.goods-media.is-loaded .goods-blur { opacity: 0; }
.goods-media.is-broken .goods-blur { opacity: 0.9; }

.goods-media .card-fallback {
  display: none;
  z-index: 2;
  background: rgba(238, 241, 245, 0.42);
}
.goods-media.is-broken .card-fallback,
.goods-media:not(:has(> img)) .card-fallback { display: grid; }
.goods-media:has(> .goods-blur.is-fallback) .card-fallback { display: none; }
.goods-media .card-fallback .icon { color: rgba(71, 85, 105, 0.52); }

.skeleton.tall {
  position: relative;
  overflow: hidden;
}

.skeleton.tall::before {
  content: "";
  position: absolute;
  inset: -8%;
  background:
    radial-gradient(30% 34% at 50% 38%, rgba(255, 249, 238, 0.94), transparent 72%),
    radial-gradient(44% 38% at 34% 32%, rgba(150, 172, 201, 0.58), transparent 72%),
    radial-gradient(40% 34% at 70% 58%, rgba(184, 199, 219, 0.62), transparent 72%),
    radial-gradient(28% 24% at 52% 48%, rgba(255, 255, 255, 0.9), transparent 66%);
  filter: blur(12px);
  animation: goods-blur-drift 3.4s ease-in-out infinite alternate;
}

@keyframes goods-blur-drift {
  from { transform: translate3d(-1.5%, -1%, 0) scale(1.02); }
  to { transform: translate3d(1.5%, 1%, 0) scale(1.06); }
}

.skeleton.tall::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 42px;
  left: 12px;
  height: 13px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.66);
}
.goods-card:hover .goods-media img { transform: scale(1.025); }
.goods-media .ph {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #a7b3c5;
}
.status-pill {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 23px;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink-2);
  font-size: 11px;
  backdrop-filter: blur(6px);
}
.status-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.status-pill.off i { background: var(--faint); }
.goods-copy { padding: 11px 12px 13px; min-width: 0; }
.goods-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
  line-height: 20px;
  color: var(--ink);
  font-weight: 500;
}
.goods-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin-top: 9px;
}
.price { color: #d14343; font-weight: 700; font-variant-numeric: tabular-nums; }
.price small { font-size: 11px; font-weight: 500; }
.goods-meta { color: var(--faint); font-size: 11px; text-align: right; line-height: 1.55; }

.empty-state {
  display: grid;
  place-items: center;
  min-height: 320px;
  padding: 40px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.65);
  text-align: center;
  color: var(--muted);
}
.empty-state .empty-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eef3fb;
  color: #6a86b3;
  margin-bottom: 10px;
}
.empty-state strong { display: block; color: var(--ink-2); font-weight: 600; margin-bottom: 4px; }
.empty-state p { margin: 0; font-size: 13px; }

.skeleton-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 10px; }
.skeleton {
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(100deg, #f3f6fa 20%, #fafcff 38%, #f3f6fa 56%);
  background-size: 220% 100%;
  animation: shimmer 1.3s linear infinite;
}
.skeleton.tall { min-height: 310px; }
@keyframes shimmer { to { background-position: -220% 0; } }

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  min-width: 180px;
  max-width: 340px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--ink-2);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
  font-size: 13px;
}
.toast.warn { border-color: #f0d7a6; background: #fffaf0; color: #8a5a08; }
.toast.error { border-color: #f0c3c8; background: #fff7f8; color: #a52e3b; }

/* ---------- product detail drawer ---------- */
.drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(15, 23, 42, 0.32);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 180ms;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 71;
  width: min(620px, 96vw);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 50px rgba(15, 23, 42, 0.16);
  transform: translateX(24px);
  opacity: 0;
  transition: transform 200ms, opacity 200ms;
}
.drawer.is-open, .drawer-mask.is-open { transform: none; opacity: 1; }
.drawer[hidden], .drawer-mask[hidden] { display: none; }
.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}
.drawer-head-copy { min-width: 0; }
.drawer-eyebrow { color: var(--faint); font-size: 11px; margin-bottom: 5px; }
.drawer-title {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.45;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.drawer-body { flex: 1; overflow: auto; padding: 14px 18px 22px; }
.drawer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.drawer-foot .price { font-size: 19px; }
.drawer-foot .meta { color: var(--muted); font-size: 12px; }

.detail-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.detail-stat {
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}
.detail-stat span { display: block; color: var(--faint); font-size: 11px; }
.detail-stat strong { display: block; margin-top: 4px; color: var(--ink-2); font-size: 14px; font-variant-numeric: tabular-nums; }

.image-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: 8px;
  background: #f1f5f9;
  margin-bottom: 10px;
}
.image-tab {
  flex: 1;
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.image-tab.is-active { background: #fff; color: var(--ink-2); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08); }
.image-tab em { font-style: normal; color: var(--faint); margin-left: 3px; }
.image-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.image-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f1f4f8;
  overflow: hidden;
}
.image-tile img { width: 100%; height: 100%; object-fit: cover; }
.image-tile button {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.image-empty { color: var(--faint); font-size: 12px; padding: 24px 0; text-align: center; }

.sku-list { display: flex; flex-direction: column; gap: 6px; }
.sku-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  font-size: 12px;
}
.sku-row span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.sku-row strong { font-size: 12px; color: #d14343; font-variant-numeric: tabular-nums; }
.sku-row em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- goods page ---------- */
body.is-drawer-open, body.is-viewer-open { overflow: hidden; }
.goods-main { padding-bottom: 72px; }
.goods-search { max-width: 330px; }
.crumb-link { color: var(--accent-strong); font-weight: 600; white-space: nowrap; }
.crumb-link:hover { text-decoration: underline; }
.breadcrumb .name { max-width: 220px; }
.load-more-wrap { display: flex; justify-content: center; padding: 18px 0 4px; }
.load-more-note {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--faint);
  font-size: 11.5px;
}
.load-more-note .spinner { width: 12px; height: 12px; flex: none; }

.goods-media img { position: relative; z-index: 1; }
.card-fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  place-items: center;
  color: #a7b3c5;
  background: #eef1f5;
}
.card-fallback .icon { width: 30px; height: 30px; }

.drawer-block { margin-top: 16px; }
.drawer-block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.drawer-block-head strong { color: var(--ink-2); font-size: 13px; font-weight: 600; }
.drawer-block-head span { color: var(--faint); font-size: 11px; }
.drawer-image-loading {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 150px;
  color: var(--muted);
  font-size: 12px;
}

.image-tile { cursor: default; }
.image-tile img { position: absolute; inset: 0; z-index: 1; }
.tile-fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  place-items: center;
  color: #a7b3c5;
}
.tile-fallback .icon { width: 26px; height: 26px; }
.image-open {
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.image-open span {
  position: absolute;
  left: 6px;
  top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 23px;
  padding: 0 7px;
  border-radius: 5px;
  background: rgba(15, 23, 42, 0.7);
  color: #fff;
  font-size: 10px;
  opacity: 0;
  transition: opacity 150ms;
}
.image-open span .icon { width: 12px; height: 12px; }
.image-tile:hover .image-open span { opacity: 1; }
.image-tile .image-pick {
  position: absolute;
  top: auto;
  left: auto;
  right: 6px;
  bottom: 6px;
  z-index: 3;
  width: auto;
  height: 24px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 5px;
  background: rgba(15, 23, 42, 0.74);
  color: #fff;
  font-size: 10.5px;
  cursor: pointer;
  backdrop-filter: blur(5px);
}
.image-pick:hover { background: rgba(15, 23, 42, 0.9); }
.image-check {
  position: absolute;
  right: 6px;
  top: 6px;
  z-index: 3;
  width: 20px;
  height: 20px;
  display: none;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
}
.image-check .icon { width: 12px; height: 12px; }
.image-tile.is-selected { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(47, 107, 255, 0.16); }
.image-tile.is-selected .image-check { display: grid; }
.image-tile.is-selected .image-pick { background: var(--accent-strong); border-color: var(--accent-strong); }

.drawer-selection { display: flex; align-items: center; gap: 9px; min-width: 0; }
.selection-thumb {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--faint);
  overflow: hidden;
  flex: none;
}
.selection-thumb img { width: 100%; height: 100%; object-fit: cover; }
.selection-copy { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.selection-copy strong {
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.selection-copy small {
  color: var(--faint);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.drawer-foot .btn-primary { flex: none; }

.goods-viewer {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: grid;
  place-items: center;
  padding: 24px;
}
.goods-viewer[hidden] { display: none; }
.goods-viewer-mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.66);
  backdrop-filter: blur(6px);
}
.goods-viewer-card {
  position: relative;
  z-index: 1;
  width: min(900px, 100%);
  max-height: min(88vh, 900px);
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.82);
  box-shadow: 0 24px 70px rgba(2, 6, 23, 0.4);
}
.viewer-media {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: min(68vh, 680px);
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 9px;
  background: #0f172a;
}
.viewer-blur {
  position: absolute;
  inset: -24px;
  z-index: -1;
  background-position: center;
  background-size: cover;
  filter: blur(30px) brightness(0.55) saturate(0.9);
  opacity: 0.9;
}
.viewer-media img {
  position: relative;
  z-index: 1;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.viewer-close {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 3;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
}
.viewer-close:hover { background: rgba(255, 255, 255, 0.2); }
.viewer-nav {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
}
.viewer-nav:hover:not(:disabled) { background: rgba(255, 255, 255, 0.18); }
.viewer-nav:disabled { opacity: 0.3; cursor: default; }
.viewer-foot {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 2px;
}
.viewer-foot > span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- auth ---------- */
.auth-body {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(900px 440px at 8% -8%, #e9f0ff 0%, rgba(233, 240, 255, 0) 60%),
    radial-gradient(700px 420px at 100% 110%, #e9f7f2 0%, rgba(233, 247, 242, 0) 55%),
    var(--canvas);
}
.auth-topbar { background: rgba(255, 255, 255, 0.7); border-bottom-color: rgba(226, 232, 240, 0.8); }
.auth-boot {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 32px 20px;
}
.auth-boot[hidden],
.auth-main[hidden] { display: none !important; }
.auth-boot-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(30, 55, 97, 0.08);
  color: var(--ink-2);
  font-size: 15px;
  font-weight: 600;
}
.auth-boot-card .spinner { width: 18px; height: 18px; flex: none; }
.auth-boot.is-error .auth-boot-card {
  border-color: #f0c3c8;
  background: #fff7f8;
  color: #a52e3b;
}
.auth-boot.is-error .spinner { display: none; }
.auth-main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  align-items: center;
  gap: 64px;
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 48px 28px;
}
.auth-intro { max-width: 560px; }
.auth-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid #d7e2f5;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #46628d;
  font-size: 12px;
}
.auth-kicker i { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.auth-statement {
  margin: 18px 0 12px;
  color: #1e293b;
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -0.035em;
}
.auth-copy { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.8; max-width: 460px; }
.auth-points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 28px; }
.auth-point {
  padding: 13px;
  border: 1px solid rgba(207, 216, 229, 0.9);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.64);
}
.auth-point strong { display: block; color: var(--ink-2); font-size: 13px; margin-bottom: 4px; }
.auth-point span { color: var(--muted); font-size: 12px; line-height: 1.55; }
.auth-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(30, 55, 97, 0.09);
  overflow: hidden;
}
.auth-card-head { padding: 22px 24px 0; }
.auth-card-title { margin: 0 0 5px; color: var(--ink); font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.auth-card-sub { margin: 0; color: var(--muted); font-size: 13px; }
.auth-form { padding: 18px 24px 24px; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; color: var(--ink-2); font-size: 13px; margin-bottom: 7px; }
.input-wrap { position: relative; }
.input-wrap .icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--faint);
}
.input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: #fff;
  color: var(--ink);
}
.input.has-icon { padding-left: 34px; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.09); }
.field-hint { color: var(--faint); font-size: 11px; margin-top: 5px; }
.form-error {
  display: none;
  margin: 0 0 12px;
  padding: 9px 11px;
  border: 1px solid #f0c3c8;
  border-radius: 7px;
  background: #fff7f8;
  color: #a52e3b;
  font-size: 12px;
  line-height: 1.5;
}
.form-error.is-show { display: block; }
.auth-submit { height: 40px; font-weight: 600; }
.auth-foot {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}
.auth-link { color: var(--accent-strong); font-weight: 600; }
.auth-link:hover { text-decoration: underline; }
.auth-legal { margin: 20px 2px 0; color: var(--faint); font-size: 11px; text-align: center; line-height: 1.6; }

.spinner {
  width: 13px;
  height: 13px;
  border: 2px solid #dbe4f1;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .auth-main { grid-template-columns: 1fr; gap: 26px; padding: 28px 18px; }
  .auth-intro { max-width: none; }
  .auth-points { grid-template-columns: repeat(3, 1fr); }
  .auth-statement { font-size: 30px; }
  .auth-card { max-width: 460px; margin: 0 auto; }
}

@media (max-width: 720px) {
  .portal-topbar { height: auto; min-height: 56px; padding: 9px 14px; flex-wrap: wrap; }
  .brand-sub { display: none; }
  .portal-main { padding: 12px 14px 28px; }
  .shop-grid, .goods-grid, .skeleton-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shop-card { min-height: 76px; padding: 11px; gap: 9px; }
  .shop-logo, .shop-logo-fallback { width: 40px; height: 40px; }
  .toolbar-meta { margin-left: 0; width: 100%; }
  .goods-copy { padding: 9px 10px 11px; }
  .goods-name { font-size: 13px; min-height: 38px; line-height: 19px; }
  .drawer { width: 100%; }
  .image-grid { grid-template-columns: repeat(2, 1fr); }
  .drawer-foot { align-items: stretch; flex-direction: column; }
  .drawer-foot .btn-primary { width: 100%; }
  .goods-viewer { padding: 10px; }
  .goods-viewer-card { grid-template-columns: 1fr; gap: 8px; padding: 12px; }
  .viewer-media { height: 58vh; }
  .viewer-nav { display: none; }
  .viewer-foot { grid-column: 1; }
  .auth-points { grid-template-columns: 1fr; }
  .auth-statement { font-size: 26px; }
  .user-chip { max-width: 130px; }
}

@media (max-width: 440px) {
  .shop-grid, .goods-grid, .skeleton-grid { grid-template-columns: 1fr; }
  .auth-card-head { padding: 18px 18px 0; }
  .auth-form { padding-left: 18px; padding-right: 18px; }
}

/* ---------- shops + goods split workspace ---------- */
body[data-page="shops"] { height: 100vh; overflow: hidden; }
.portal-shell {
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  height: calc(100vh - 56px);
  min-height: 0;
}
.shops-sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
}
.shops-sidebar-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 12px 11px;
  border-bottom: 1px solid var(--line);
}
.shop-search { flex: none; max-width: none; }
.shops-controls { display: flex; align-items: center; gap: 6px; }
.shops-controls .select-wrap { flex: 1; min-width: 0; }
.shops-controls .select-wrap select { width: 100%; min-width: 0; height: 32px; font-size: 13px; }
.shops-controls .icon-btn { flex: none; width: 32px; height: 32px; border: 1px solid var(--line); background: #fff; }
.shops-controls .icon-btn:hover:not(:disabled) { background: var(--surface-soft); }
.shops-controls .icon-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.shops-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--faint);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.shops-meta strong { color: var(--ink-2); font-size: 12px; }
.shops-skeleton {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
}
.shops-skeleton .skeleton { min-height: 58px; }
.shop-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.shop-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 150ms, border-color 150ms, box-shadow 150ms;
}
.shop-item:hover { background: var(--surface-soft); border-color: var(--line); }
.shop-item.is-active {
  background: var(--accent-soft);
  border-color: #bcd0f5;
  box-shadow: inset 2px 0 0 var(--accent);
}
.shop-item .shop-logo,
.shop-item .shop-logo-fallback { width: 36px; height: 36px; border-radius: 8px; font-size: 13px; }
.shop-item .shop-copy { min-width: 0; flex: 1; }
.shop-item .shop-name { margin-bottom: 4px; font-size: 13px; }
.shop-item .shop-tags { gap: 4px; }
.shop-item .tag { height: 19px; padding: 0 6px; font-size: 10px; }
.shop-item-check {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  opacity: 0;
  transform: scale(0.82);
  transition: opacity 150ms, transform 150ms;
}
.shop-item-check .icon { width: 11px; height: 11px; }
.shop-item.is-active .shop-item-check { opacity: 1; transform: none; }
.shops-empty {
  margin: auto;
  padding: 28px 18px;
  text-align: center;
  color: var(--muted);
}
.shops-empty .empty-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin: 0 auto 9px;
  border-radius: 50%;
  background: #eef3fb;
  color: #6a86b3;
}
.shops-empty strong { display: block; color: var(--ink-2); font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.shops-empty p { margin: 0; font-size: 12px; line-height: 1.6; }

.goods-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--canvas);
}
.goods-pane-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.goods-pane-title { min-width: 0; margin-right: 2px; }
.pane-title {
  display: block;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.goods-pane-head .goods-search { flex: 1 1 220px; max-width: 300px; }
.goods-pane-head .toolbar-meta { margin-left: auto; }
.goods-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 16px 28px; }
.goods-empty-state { min-height: 440px; }

@media (max-width: 980px) {
  body[data-page="shops"] { height: auto; overflow: auto; }
  .portal-shell { grid-template-columns: 1fr; height: auto; }
  .shops-sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .shop-list { flex-direction: row; overflow-x: auto; overflow-y: hidden; padding-bottom: 10px; }
  .shop-item { min-width: 236px; }
  .goods-pane { min-height: 70vh; }
  .goods-scroll { overflow: visible; }
  .goods-empty-state { min-height: 260px; }
  .batch-bar {
    position: sticky;
    bottom: 0;
    z-index: 20;
    background: #f4f8ff;
    box-shadow: 0 -5px 16px rgba(15, 23, 42, 0.08);
  }
}

@media (max-width: 560px) {
  .goods-pane-head .search-box { flex: 1 1 100%; max-width: none; }
  .goods-pane-head .toolbar-meta { margin-left: 0; }
  .pane-title { max-width: 180px; }
}

/* ---------- multi-select + batch publish ---------- */
.goods-card.is-picked {
  border-color: #8fb2ff;
  box-shadow: 0 0 0 2px rgba(47, 107, 255, 0.12);
}
.card-select {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.9);
  color: #8fa0b8;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background 150ms, border-color 150ms, color 150ms;
}
.card-select .icon { width: 15px; height: 15px; opacity: 0.55; }
.card-select:hover { border-color: #a9c1ee; color: var(--accent); }
.card-select.is-on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.card-select.is-on .icon { opacity: 1; }
.card-picked {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 2;
  height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(47, 107, 255, 0.92);
  color: #fff;
  font-size: 11px;
}
.shop-picked {
  flex: none;
  height: 19px;
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.shop-item.is-picked .shop-item-check { opacity: 0; }

.batch-bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 16px;
  background: linear-gradient(90deg, #f2f7ff, #f8fbff);
  border-top: 1px solid #cfe0ff;
}
.batch-bar-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.batch-badge {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
}
.batch-badge .icon { width: 15px; height: 15px; }
.batch-bar-copy { min-width: 0; }
.batch-bar-copy strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.batch-bar-copy strong em {
  color: var(--accent-strong);
  font-style: normal;
  font-variant-numeric: tabular-nums;
}
.batch-bar-copy > span {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.batch-chips {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
}
.batch-shop-chip {
  max-width: 150px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  border: 1px solid #cfe0ff;
  border-radius: 999px;
  background: #fff;
  color: #35507a;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.batch-shop-chip em {
  color: var(--accent-strong);
  font-style: normal;
  font-weight: 600;
}
.batch-shop-chip.is-more { color: var(--muted); }
.batch-bar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.batch-run-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eef2f8;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.batch-run-chip i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--faint);
}
.batch-run-chip.is-run { background: var(--accent-soft); color: var(--accent-strong); }
.batch-run-chip.is-run i { background: var(--accent); animation: batch-pulse 1.1s ease-in-out infinite; }
.batch-run-chip.is-ok { background: var(--ok-soft); color: var(--ok); }
.batch-run-chip.is-ok i { background: var(--ok); }
.batch-run-chip.is-warn { background: var(--warn-soft); color: var(--warn); }
.batch-run-chip.is-warn i { background: var(--warn); }
@keyframes batch-pulse { 50% { opacity: 0.35; } }

.batch-modal {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 20px;
}
.batch-modal[hidden] { display: none; }
.batch-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(3px);
}
.batch-modal-card {
  position: relative;
  z-index: 1;
  width: min(880px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.26);
  overflow: hidden;
}
.batch-modal-head {
  flex: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px 13px;
  border-bottom: 1px solid var(--line);
}
.batch-modal-title strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.batch-modal-title span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}
.batch-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 18px 18px;
}
.batch-config {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #f8fafc;
}
.batch-config-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.batch-label {
  flex: none;
  width: 64px;
  color: var(--muted);
  font-size: 12px;
}
.batch-groups { display: flex; flex-wrap: wrap; gap: 6px; }
.batch-group {
  height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink-2);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 150ms, background 150ms, color 150ms;
}
.batch-group em {
  color: var(--faint);
  font-style: normal;
  font-size: 11px;
}
.batch-group:hover { border-color: #b9c9e4; }
.batch-group.is-on {
  border-color: #9db8ea;
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.batch-group.is-on em { color: var(--accent); }
.batch-note { display: flex; align-items: center; gap: 12px; }
.batch-note input {
  flex: 1;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  outline: 0;
}
.batch-note input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.08); }

.batch-run-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 14px;
  border: 1px solid #cfe0ff;
  border-radius: 9px;
  background: #f5f9ff;
}
.batch-run-copy strong { display: block; color: var(--ink); font-size: 13px; font-weight: 600; }
.batch-run-copy span { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.batch-run-progress { display: flex; align-items: center; gap: 9px; min-width: 190px; }
.batch-progress-track {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: #dce7f8;
  overflow: hidden;
}
.batch-progress-track i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--accent);
  transition: width 300ms ease;
}
.batch-run-progress em {
  color: var(--muted);
  font-style: normal;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.batch-items-block { margin-top: 13px; }
.batch-items-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
}
.batch-items-head .batch-label { width: auto; color: var(--ink-2); font-weight: 600; }
.batch-items-head > span:last-child { color: var(--faint); font-size: 11px; }
.batch-items { display: flex; flex-direction: column; gap: 9px; }
.batch-shop-block {
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
}
.batch-shop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 11px;
  background: #f3f6fb;
  border-bottom: 1px solid var(--line);
}
.batch-shop-head strong { color: var(--ink-2); font-size: 12px; font-weight: 600; }
.batch-shop-head span { color: var(--faint); font-size: 11px; }
.batch-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border-bottom: 1px solid #f0f3f8;
  background: #fff;
}
.batch-item:last-child { border-bottom: 0; }
.batch-item.is-running { background: #fbfdff; }
.batch-item.is-error { background: #fffafa; }
.batch-item-thumb {
  width: 42px;
  height: 42px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f1f4f9;
  color: #a7b3c5;
  overflow: hidden;
}
.batch-item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.batch-item-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.batch-item-copy strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.batch-item-copy > span { color: var(--faint); font-size: 11px; }
.batch-item-error { color: var(--danger); font-size: 11px; font-style: normal; }
.batch-item-side { flex: none; display: flex; align-items: center; gap: 7px; }
.batch-item-status {
  height: 22px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.batch-item-status.is-running { background: var(--accent-soft); color: var(--accent-strong); }
.batch-item-status.is-done { background: var(--ok-soft); color: var(--ok); }
.batch-item-status.is-error { background: #fff1f2; color: var(--danger); }
.batch-link {
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--accent-strong);
  font-size: 11px;
  cursor: pointer;
}
.batch-link:hover { background: var(--accent-soft); border-color: #bcd0f5; }
.batch-remove {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--faint);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.batch-remove:hover { background: #fff1f2; color: var(--danger); }
.batch-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 110px;
  border: 1px dashed var(--line-strong);
  border-radius: 9px;
  color: var(--muted);
  font-size: 12px;
}
.batch-modal-foot {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 18px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.batch-modal-foot > span { color: var(--muted); font-size: 11px; }
.batch-foot-actions { display: flex; align-items: center; gap: 8px; }

/* ---------- standalone product page ---------- */
body[data-page="product"] { height: 100vh; overflow: hidden; }
.product-back {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--muted);
}
.product-back:hover { background: #f1f4f8; color: var(--ink-2); }
.batch-top-chip {
  height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid #cfe0ff;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.product-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 12px;
  height: calc(100vh - 56px);
  padding: 12px 16px 16px;
  min-height: 0;
}
.product-gallery-panel,
.product-info-panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.gallery-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.gallery-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 8px;
  background: #f3f6fb;
}
.gallery-tab {
  height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.gallery-tab em {
  margin-left: 5px;
  color: var(--faint);
  font-style: normal;
  font-size: 11px;
}
.gallery-tab.is-active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1);
}
.gallery-tab.is-active em { color: var(--accent-strong); }
.gallery-count { color: var(--faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.gallery-stage {
  position: relative;
  isolation: isolate;
  flex: 1;
  min-height: 0;
  margin: 12px 14px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #eef1f5;
  overflow: hidden;
  cursor: zoom-in;
}
.gallery-blur {
  position: absolute;
  inset: -28px;
  z-index: -1;
  background-position: center;
  background-size: cover;
  filter: blur(30px) saturate(1.08);
  opacity: 0.48;
  transform: scale(1.08);
}
.gallery-stage > img {
  position: relative;
  z-index: 1;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.gallery-loading,
.gallery-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  background: rgba(255, 255, 255, 0.55);
}
.gallery-loading { flex-direction: row; }
.gallery-empty .icon { width: 32px; height: 32px; color: #a7b3c5; }
.gallery-empty strong { color: var(--ink-2); font-size: 13px; font-weight: 600; }
.gallery-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin-top: -17px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink-2);
  cursor: pointer;
  backdrop-filter: blur(6px);
}
.gallery-nav:hover { background: #fff; }
.gallery-nav.prev { left: 10px; }
.gallery-nav.next { right: 10px; }
.gallery-expand {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 3;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink-2);
  cursor: pointer;
}
.gallery-badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 2;
  height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.62);
  color: #fff;
  font-size: 11px;
  backdrop-filter: blur(6px);
}
.gallery-thumbs {
  flex: none;
  display: flex;
  gap: 7px;
  padding: 0 14px 12px;
  overflow-x: auto;
}
.gallery-thumb {
  position: relative;
  width: 58px;
  height: 58px;
  flex: none;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f1f4f9;
  overflow: hidden;
  cursor: pointer;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(47, 107, 255, 0.16);
}
.gallery-thumb-fallback {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  color: #a7b3c5;
}
.gallery-thumb.is-broken .gallery-thumb-fallback { display: grid; }
.product-info-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 16px 10px; }
.product-shop {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.product-title {
  margin: 6px 0 14px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.38;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.product-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.product-stat {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}
.product-stat span { display: block; color: var(--faint); font-size: 11px; }
.product-stat strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.product-block { margin-top: 16px; }
.product-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}
.product-block-head strong { color: var(--ink-2); font-size: 13px; font-weight: 600; }
.product-block-head span { color: var(--faint); font-size: 11px; }
.product-sku-list {
  max-height: 250px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.product-sku-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid #f0f3f8;
  font-size: 12px;
}
.product-sku-row:last-child { border-bottom: 0; }
.product-sku-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-sku-row strong { color: #d14343; font-variant-numeric: tabular-nums; }
.product-sku-row em { color: var(--faint); font-style: normal; white-space: nowrap; }
.product-sku-empty { padding: 18px 12px; color: var(--muted); font-size: 12px; text-align: center; }
.product-ref-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.product-actions {
  flex: none;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: #fff;
}
.product-selection { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.product-action-buttons {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
}
.product-action-buttons .btn { height: 38px; }

@media (max-width: 980px) {
  body[data-page="product"] { height: auto; overflow: auto; }
  .product-shell { grid-template-columns: 1fr; height: auto; }
  .product-gallery-panel { min-height: 62vh; }
  .product-info-panel { min-height: 0; }
  .gallery-stage { min-height: 42vh; }
  .product-info-scroll { overflow: visible; }
}

@media (max-width: 620px) {
  .product-shell { padding: 8px; gap: 8px; }
  .batch-bar { flex-wrap: wrap; padding: 9px 10px; }
  .batch-bar-actions { width: 100%; justify-content: flex-end; }
  .batch-chips { display: none; }
  .batch-config-row, .batch-note { flex-direction: column; align-items: stretch; gap: 6px; }
  .batch-label { width: auto; }
  .batch-run-head { flex-direction: column; align-items: stretch; }
  .batch-modal-foot { flex-direction: column; align-items: stretch; }
  .batch-foot-actions { justify-content: flex-end; }
}

/* ===== Flash readable typography (served through the existing portal.css route) ===== */
:root {
  --ui-font: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --muted: #1f2937;
  --faint: #1f2937;
  --text-meta: #1f2937;
  --text-on-page: #111827;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--ui-font) !important;
  font-size: 14px !important;
  color: var(--text-on-page);
  line-height: 1.55;
  -webkit-font-smoothing: subpixel-antialiased !important;
  -moz-osx-font-smoothing: auto;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
  font-optical-sizing: auto;
}

button,
input,
select,
textarea,
optgroup {
  font-family: var(--ui-font) !important;
  font-size: 13px !important;
  letter-spacing: 0;
}

input::placeholder,
textarea::placeholder {
  color: #1f2937 !important;
  opacity: 1;
}

:where(
  small,
  .batch-run-chip,
  .batch-group em,
  .batch-run-copy span,
  .batch-run-progress em,
  .batch-items-head > span:last-child,
  .batch-shop-head span,
  .batch-item-copy > span,
  .batch-item-error,
  .batch-item-images.is-empty,
  .batch-image-group-name,
  .batch-image-state,
  .batch-image-state small,
  .batch-item-status,
  .batch-link,
  .batch-modal-foot > span,
  .cat-account,
  .cat-seg button,
  .cat-filter-meta,
  .cat-link,
  .cat-batchrow,
  .cat-batch-btn,
  .cat-batch-go,
  .cat-batch-note,
  .cat-batchrow .batch-shop-chip,
  .cat-batchrow #batchViewRun,
  .cat-tabs button em,
  .cat-platforms button,
  .cat-shop-state p,
  .cat-shop-retry,
  .cat-shop-meta,
  .cat-shop-meta .tag,
  .cat-shop-picked,
  .cat-sidebar-foot,
  .cat-goods-status,
  .cat-goods-name,
  .cat-goods-price small,
  .cat-goods-meta,
  .cat-empty p,
  .cat-loadmore-note,
  .ref-library-link,
  .library-head-copy span,
  .library-picked,
  .library-product-back,
  .library-product-copy span,
  .library-stage-label,
  .library-gallery-tabs button,
  .library-product-price span,
  .library-product-tip,
  .tag,
  .status-pill,
  .price small,
  .goods-meta,
  .drawer-eyebrow,
  .detail-stat span,
  .load-more-note,
  .drawer-block-head span,
  .image-open span,
  .image-tile .image-pick,
  .selection-copy small,
  .field-hint,
  .auth-legal,
  .shops-meta,
  .shop-item .tag,
  .card-picked,
  .shop-picked,
  .batch-bar-copy > span,
  .batch-shop-chip,
  .batch-top-chip,
  .gallery-tab em,
  .gallery-count,
  .gallery-badge,
  .product-stat span,
  .product-block-head span,
  .batch-switch-copy small,
  .batch-switch-badge,
  .batch-switch-head-copy span,
  .batch-switch-shop-trigger-label,
  .batch-switch-shop-trigger strong,
  .batch-switch-shop-trigger em,
  .batch-switch-shop-panel-head,
  .batch-switch-shop-panel-head button,
  .batch-switch-shop-option strong,
  .batch-switch-shop-option em,
  .batch-switch-shop,
  .batch-switch-shop strong,
  .batch-switch-shop > span,
  .batch-switch-item-copy span,
  .batch-switch-item-status,
  .service-chip,
  .tab-count,
  .clear-link,
  .draft-kind,
  .draft-state,
  .draft-sub,
  .drafts-empty p,
  .toolbar-hint,
  .bg-chip,
  .mini-progress,
  .hint,
  .ref-group,
  .ref-group small,
  .drop-title,
  .thumb-group-head,
  .thumb-group-head small,
  .thumb-tag,
  .thumb-label,
  .ref-tip,
  .field > span:first-child,
  .prompt-label em,
  .prompt-label b,
  .option-copy small,
  .option-count,
  .privacy-note,
  .empty-copy p,
  .empty-tags span,
  .group-head span,
  .shot-loading strong,
  .shot-loading-text,
  .draft-media .shot-loading strong,
  .draft-media .shot-loading-text,
  .shot-badge,
  .shot-time,
  .shot-progress,
  .shot-versions,
  .shot-versions .sv-count,
  .shot-versions .sv-hint,
  .shot-regen,
  .draft-media .shot-versions .sv-hint,
  .shot-fail-chip,
  .draft-media .shot-fail-chip,
  .ref-tile.has-broken-img::after,
  .draft-media.has-broken-img::after,
  .shot-media.has-broken-img::after,
  .draft-pick-media.has-broken-img::after,
  .shot-meta strong,
  .shot-meta span,
  .shot-fail span,
  .group-empty,
  .estimate,
  .log-head span,
  .rail-badge,
  .log-state-note,
  .log-state-sub,
  .log-card-head,
  .log-card-head > span:last-child,
  .progress-hero span,
  .progress-note,
  .rail-group,
  .summary-row,
  .summary-row strong,
  .log-list time,
  .lightbox-versions-head,
  .lightbox-version.is-selected::after,
  .lightbox-version span,
  .steps li > span,
  .steps p,
  .modal-tip p,
  .restore-option span,
  .scope-pick-head span,
  .draft-picker-head span,
  .draft-pick-meta strong,
  .draft-pick-meta small,
  .draft-picker-specs-head span,
  .sku-pick-copy strong,
  .sku-pick-copy small,
  .cancel-modal-title span,
  .cancel-scope .scope-btn,
  .cancel-scope-hint,
  .cancel-summary-actions button,
  .cancel-shop-head em,
  .cancel-shop-head button,
  .cancel-item-copy span,
  .cancel-item-copy em,
  .cancel-modal-foot > span,
  .publish-group-head span,
  .publish-group-head em,
  .pub-noimg,
  .pub-tag,
  .pub-index,
  .pub-slot figcaption strong,
  .pub-slot figcaption small,
  .publish-modal-head span,
  .publish-batch-summary,
  .publish-step p,
  .publish-step em,
  .publish-result-error span,
  .action-scope-label,
  .scope-btn,
  .scope-btn em,
  .ref-board-group.is-drop-add::after,
  .ref-board-head,
  .ref-board-head strong,
  .ref-board-head small,
  .ref-rail-empty,
  .ref-noimg,
  .ref-tag,
  .ref-dup-badge,
  .ref-idx,
  .ref-slot,
  .ref-slot small,
  .ref-slot.is-full,
  .progress-verify,
  .cancel-result-stats span,
  .cancel-result-images-head span,
  .cancel-result-image figcaption,
  .cancel-result-note
) {
  font-size: 13px !important;
  line-height: 1.5 !important;
  font-weight: 500 !important;
}

:where(
  .topbar-back,
  .topbar-user,
  .toolbar-selection,
  .toolbar-meta,
  .doc-title,
  .batch-switch-copy strong,
  .batch-switch-search input,
  .batch-switch-item-copy strong,
  .batch-switch-empty,
  .sku-facts-columns,
  .sku-fact,
  .sku-fact-thumb.is-empty,
  .chip,
  .option-copy strong,
  .log-state-head strong,
  .toast,
  .lightbox-figure figcaption,
  .lightbox-versions-head span,
  .restore-tip,
  .draft-picker-toolbar span,
  .draft-picker-specs-head strong,
  .draft-picker-empty,
  .cancel-shop-head strong,
  .cancel-item-copy strong,
  .cancel-result-heading span:not(.cancel-result-mark),
  .cancel-result-images-head strong,
  .publish-empty,
  .publish-batch-summary strong,
  .publish-step strong,
  .publish-pending,
  .publish-group-head strong,
  .publish-result-error strong,
  .draft-meta strong,
  .group-head strong,
  .steps strong,
  .brand-sub,
  .section-line,
  .drawer-foot .meta,
  .image-tab,
  .image-empty,
  .sku-row,
  .sku-row strong,
  .drawer-image-loading,
  .selection-copy strong,
  .viewer-foot > span,
  .auth-kicker,
  .auth-point span,
  .form-error,
  .auth-foot,
  .shops-meta strong,
  .shops-empty p,
  .batch-modal-title span,
  .batch-label,
  .batch-note input,
  .batch-shop-head strong,
  .batch-item-copy strong,
  .batch-empty,
  .gallery-loading,
  .gallery-empty,
  .product-shop,
  .product-sku-row,
  .product-sku-empty,
  .product-ref-note,
  .cat-brand-sub,
  .cat-top-link,
  .cat-field input,
  .cat-query,
  .cat-batch-primary,
  .cat-shop-state strong,
  .cat-shop-logo,
  .cat-shop-name,
  .cat-alert,
  .cat-loadmore-btn,
  .library-stage-empty,
  .library-product-copy strong
) {
  font-size: 13px !important;
  line-height: 1.5 !important;
  font-weight: 500 !important;
}

:where(.tag, .status-pill, .gallery-badge, .card-picked, .shop-picked) {
  font-weight: 600 !important;
  letter-spacing: 0;
}

:where(.log-list li) {
  font-size: 13px !important;
  line-height: 1.55 !important;
  font-weight: 400 !important;
}

:where(.log-list time) {
  color: var(--faint) !important;
  font-size: 13px !important;
  line-height: 1.45 !important;
  font-weight: 500 !important;
}

:where(.log-state-note, .summary-row, .hint, .toolbar-hint, .field-hint) {
  color: var(--text-meta) !important;
}

:where(
  .batch-switch-chevron,
  .batch-switch-badge,
  .batch-switch-search,
  .batch-switch-search input,
  .batch-switch-shop-trigger,
  .batch-switch-shop-trigger > .icon:first-child,
  .batch-switch-shop-trigger-label,
  .batch-switch-shop-trigger em,
  .batch-switch-shop-chevron,
  .batch-switch-shop-panel-head,
  .batch-switch-shop-panel-head em,
  .batch-switch-shop-option em,
  .batch-switch-shop,
  .batch-switch-shop > span,
  .batch-switch-thumb,
  .batch-switch-item-status,
  .sku-facts-columns,
  .sku-fact-spec-input:disabled,
  .sku-fact-thumb.is-empty,
  .field input::placeholder,
  .field textarea::placeholder,
  .done-check.is-cancel,
  .shot-fail.is-cancel,
  .ref-slot.is-full,
  .progress-verify:not(.is-ok):not(.is-warn),
  .cancel-result-heading span:not(.cancel-result-mark),
  .cancel-result-stats span,
  .cancel-result-images-head span,
  .cancel-result-image figcaption,
  .cancel-result-note,
  .batch-image-state,
  .batch-image-state em,
  .batch-image-state small,
  .batch-item-status.is-cancelled
) {
  color: #1f2937 !important;
}

:where(.batch-switch-badge.is-running, .batch-switch-item-status.is-running) {
  color: #2f6bff !important;
}

:where(.batch-switch-badge.is-done, .batch-switch-item-status.is-done) {
  color: #0a7d59 !important;
}

:where(.batch-switch-badge.is-error, .batch-switch-item-status.is-error) {
  color: #d14343 !important;
}

:where(.batch-switch-item-status.is-cancelling) {
  color: #b7791f !important;
}

:where(
  .btn,
  .btn-sm,
  .scope-btn,
  .cat-seg button,
  .cat-platforms button,
  .cat-batchrow #batchViewRun,
  .clear-link,
  .cat-link,
  .batch-link,
  .cancel-summary-actions button,
  .cancel-shop-head button,
  .batch-switch-shop-panel-head button
) {
  font-size: 13.5px !important;
  line-height: 1.45 !important;
  font-weight: 500 !important;
}

:where(.prompt-field, .input, .field input, .field select, .field textarea) {
  font-size: 14px !important;
  line-height: 1.55 !important;
}

/* Unified UI font. Only title weight is strengthened; sizes, colors and spacing stay unchanged. */
:root body,
:root body * {
  font-family: var(--ui-font) !important;
}

:root body :is(h1, h2, h3, h4, h5, h6, strong, b),
.doc-title,
.block-label,
.action-scope-label,
.prompt-label,
.field > span:first-child,
.log-card-head > span:first-child,
.sku-facts-columns,
.ref-board-head,
.ref-board-head strong {
  font-weight: 700 !important;
}
