:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #687386;
  --line: #dde3ef;
  --primary: #2457f5;
  --primary-dark: #183fc4;
  --soft: #eef3ff;
}

.collect-product-picker {
  display: grid;
  gap: 10px;
}

.collect-product-picker .field-label {
  color: #536079;
  font-size: 13px;
  font-weight: 700;
}

.collect-product-search {
  width: 100%;
  border: 1px solid #dde3ef;
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff;
  font-size: 14px;
}

.collect-selected-product {
  border: 1px solid #dce7ff;
  background: #f5f8ff;
  color: #31528d;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
}

.collect-product-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  max-height: 360px;
  overflow: auto;
  padding: 4px;
}

.collect-product-list-picker .collect-product-options,
.collect-publish-options {
  grid-template-columns: 1fr;
  max-height: 340px;
}

.collect-publish-picker {
  align-content: start;
}

.collect-product-option {
  display: grid;
  grid-template-columns: 54px 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 1px solid #e2e7f0;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  text-align: left;
  color: #202a3a;
  cursor: pointer;
}

.collect-product-row-option,
.collect-publish-option {
  grid-template-columns: 48px 1fr;
  min-height: 58px;
}

.collect-product-option:hover {
  border-color: #9bb8ff;
  background: #f8fbff;
}

.collect-product-option.active {
  border-color: #3467eb;
  box-shadow: 0 0 0 2px rgba(52, 103, 235, 0.12);
}

.collect-product-option img,
.collect-product-option .thumb {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  object-fit: cover;
}

.collect-product-row-option img,
.collect-product-row-option .thumb,
.collect-publish-option img,
.collect-publish-option .thumb {
  width: 48px;
  height: 48px;
}

.collect-product-option strong {
  display: block;
  line-height: 1.35;
  font-size: 13px;
}

.collect-product-option small {
  display: block;
  margin-top: 4px;
  color: #69758a;
}

.collect-product-empty {
  padding: 18px;
  border: 1px dashed #d5ddeb;
  border-radius: 8px;
  color: #7a879c;
}

.native-product-select {
  display: none;
}

* {
  box-sizing: border-box;
}

html {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

.sidebar {
  width: 248px;
  flex: 0 0 248px;
  min-height: 100vh;
  padding: 22px 16px;
  background: #101828;
  color: #fff;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 4px 6px 24px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  font-weight: 800;
}

.brand span {
  display: block;
  color: #9aa7bd;
  font-size: 12px;
}

nav {
  display: grid;
  gap: 8px;
}

nav a {
  color: #cbd5e1;
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

nav a.active,
nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.nav-icon {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #9fb4ff;
  background: rgba(255, 255, 255, 0.06);
}

.nav-icon svg {
  width: 17px;
  height: 17px;
}

nav a.active .nav-icon,
nav a:hover .nav-icon {
  color: #fff;
  background: rgba(36, 87, 245, 0.9);
}

.nav-label {
  min-width: 0;
}

.shell {
  flex: 1;
  min-width: 0;
  width: calc(100% - 248px);
  max-width: calc(100vw - 248px);
  padding: 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 22px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
}

.topbar p,
.panel p,
.task p,
.task small,
.metric span {
  color: var(--muted);
}

button {
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  color: #fff;
  background: var(--primary);
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  background: var(--primary-dark);
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.small-btn {
  padding: 8px 10px;
  white-space: nowrap;
}

.ghost {
  background: #e7ecf6;
  color: #253049;
}

.danger {
  background: #ffe8ec;
  color: #c82140;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.04);
}

.metric {
  padding: 18px;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.panel {
  padding: 20px;
  margin-bottom: 18px;
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
}

.view-panel.split.active {
  display: grid;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
}

.task-list {
  display: grid;
  gap: 12px;
}

.api-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--muted);
}

.api-note code {
  padding: 6px 9px;
  border-radius: 6px;
  background: #f0f4ff;
  color: var(--primary-dark);
}

.product-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.product-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

.product-table th,
.product-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

.product-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  background: #f8faff;
  text-align: center;
}

.product-table tr:last-child td {
  border-bottom: 0;
}

.product-table small {
  display: block;
  margin: 4px 0;
  color: var(--muted);
}

.product-title-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
}

.product-title-link:hover {
  color: var(--primary);
}

.thumb {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #f1f5f9;
}

.empty-thumb {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
  text-decoration: none;
}

.text-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}

.mini-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mini-stats span {
  padding: 4px 7px;
  border-radius: 999px;
  background: #eef3ff;
  color: #3152a3;
  font-size: 12px;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.top-actions,
.search-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-form input {
  width: 260px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.product-manage-shell {
  padding-top: 0;
}

.product-top-nav {
  min-height: 58px;
  margin: 0 -28px 0;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, #e9fbff 0%, #f6efff 58%, #fff7fb 100%);
}

.nav-tabs {
  display: flex;
  align-items: stretch;
  gap: 18px;
  height: 58px;
}

.nav-tabs a {
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  color: var(--text);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  font-weight: 800;
}

.nav-tabs a.active {
  color: var(--primary-dark);
  border-bottom-color: var(--primary);
}

.top-search input {
  width: min(380px, 42vw);
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
}

.product-subnav {
  margin: 0 -28px 22px;
  min-height: 54px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  background: #eefcff;
  border-bottom: 1px solid var(--line);
}

.product-subnav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

.product-subnav strong {
  padding: 17px 18px;
  margin-left: -18px;
  background: rgba(255, 255, 255, 0.56);
}

.product-subnav button {
  margin-left: auto;
}

.legacy-product-wrap {
  background: linear-gradient(135deg, rgba(211, 244, 250, 0.8), rgba(255, 223, 238, 0.72));
}

.product-db-panel {
  padding-top: 24px;
}

.product-workbench {
  display: block;
}

.workbench-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: end;
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.04);
}

.workbench-hero .eyebrow {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.workbench-hero h1 {
  margin-bottom: 8px;
}

.workbench-hero p {
  max-width: 780px;
  color: var(--muted);
}

.workbench-hero code,
.product-library-table code {
  padding: 3px 6px;
  border-radius: 6px;
  background: #f1f5ff;
  color: #263b80;
}

.hero-actions,
.filter-actions,
.table-legend,
.data-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.workbench-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.summary-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.summary-card.primary {
  border-color: #b9c7ff;
  background: #f5f7ff;
}

.summary-card span,
.summary-card small {
  display: block;
  color: var(--muted);
}

.summary-card strong {
  display: block;
  margin: 6px 0;
  font-size: 26px;
}

.product-control-panel {
  padding: 16px;
}

.product-filter {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 180px auto;
  gap: 12px;
  align-items: end;
}

.product-filter label {
  margin: 0;
}

.product-filter label span {
  font-size: 12px;
  font-weight: 800;
}

.product-list-panel .panel-head {
  align-items: flex-end;
}

.table-legend span {
  padding: 5px 8px;
  border-radius: 999px;
  background: #f2f5fb;
  color: #4b5a73;
  font-size: 12px;
  font-weight: 700;
}

.product-library-table {
  min-width: 1080px;
}

.product-library-table th:first-child,
.product-library-table td:first-child {
  width: 36%;
}

.product-cell {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.product-cell .thumb {
  width: 64px;
  height: 64px;
}

.product-cell small {
  margin-top: 5px;
}

.sku-count {
  min-width: 42px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #eef3ff;
  color: var(--primary-dark);
  font-weight: 900;
}

.data-badges span {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.data-badges .ok {
  color: #126a35;
  background: #e8f8ee;
}

.data-badges .warn {
  color: #9a5a00;
  background: #fff4dc;
}

.sku-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 10px;
  padding: 10px 0;
}

.sku-chip-card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.sku-chip-card img,
.sku-chip-card .thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.sku-chip-card strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sku-chip-card small {
  margin-top: 3px;
}

.sync-panel {
  margin-bottom: 0;
}

.compact-hero {
  align-items: center;
}

.product-page-title {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.compact-cover {
  width: 92px;
  height: 92px;
  border-radius: 8px;
}

.publish-record-page {
  max-width: 1120px;
  margin: 0 auto;
}

.publish-record-page .compact-hero {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 18px 20px;
}

.publish-record-page .product-page-title {
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.publish-record-page .compact-cover {
  width: 112px;
  height: 112px;
}

.publish-record-page .workbench-hero .eyebrow {
  margin-bottom: 6px;
  letter-spacing: 0;
}

.publish-record-page .workbench-hero h1 {
  margin: 0 0 8px;
  font-size: 28px;
  line-height: 1.2;
}

.publish-record-page .workbench-hero p {
  max-width: none;
  line-height: 1.5;
}

.publish-record-page .hero-actions {
  align-self: center;
  justify-content: flex-end;
  min-width: 110px;
}

.notice {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-weight: 800;
}

.notice.ok {
  color: #126a35;
  background: #e8f8ee;
  border-color: #bfe8cc;
}

.notice.error {
  color: #b42336;
  background: #fff0f2;
  border-color: #ffc8d0;
}

.edit-form {
  display: block;
}

.edit-grid-panel {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.edit-cover-box {
  display: grid;
  gap: 10px;
}

.edit-cover {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f1f5f9;
}

.edit-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
}

.edit-fields label {
  margin: 0;
}

.edit-fields label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.sku-page-table {
  min-width: 960px;
}

.sku-edit-table {
  min-width: 1120px;
  table-layout: fixed;
}

.sku-edit-table input,
.sku-edit-table select {
  width: 100%;
  min-width: 110px;
  padding: 9px 10px;
}

.sku-edit-table th:last-child,
.sku-edit-table td:last-child {
  width: 88px;
  text-align: center;
}

.sku-edit-table th:nth-child(2),
.sku-edit-table td:nth-child(2) {
  width: 180px;
}

.sku-edit-table th:nth-child(3),
.sku-edit-table td:nth-child(3) {
  width: 160px;
}

.sku-edit-table th:nth-child(4),
.sku-edit-table td:nth-child(4),
.sku-edit-table th:nth-child(6),
.sku-edit-table td:nth-child(6),
.sku-edit-table th:nth-child(7),
.sku-edit-table td:nth-child(7) {
  width: 130px;
}

.sku-edit-table th:nth-child(5),
.sku-edit-table td:nth-child(5) {
  width: 210px;
}

.sku-bulk-supplier {
  margin: -4px 0 14px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid #dce6fb;
  border-radius: 8px;
  background: #f8fbff;
}

.sku-bulk-supplier strong {
  display: block;
  color: var(--text);
}

.sku-bulk-supplier span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.sku-bulk-supplier-control {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.sku-bulk-supplier-control .supplier-picker {
  width: 220px;
}

.sku-bulk-supplier-control .small-btn {
  white-space: nowrap;
}

.supplier-picker {
  position: relative;
  min-width: 180px;
}

.supplier-picker-trigger {
  width: 100%;
  min-height: 42px;
  padding: 6px 9px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  text-align: left;
  font-weight: 700;
}

.supplier-picker-trigger:hover {
  background: #f8fbff;
  border-color: #b9c8e8;
}

.supplier-picker-trigger img,
.supplier-picker-avatar {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  object-fit: cover;
}

.supplier-picker-avatar.empty {
  display: grid;
  place-items: center;
  background: #eef3ff;
  color: #3153bc;
  font-size: 12px;
  font-weight: 900;
}

.supplier-picker-trigger span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.supplier-picker-panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  width: 260px;
  padding: 8px;
  border: 1px solid #d9e2f2;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 36px rgba(18, 31, 56, 0.16);
}

.supplier-picker-search {
  width: 100%;
  min-width: 0;
  margin-bottom: 8px;
  padding: 8px 10px;
}

.supplier-picker-options {
  display: grid;
  gap: 4px;
  max-height: 240px;
  overflow: auto;
}

.supplier-picker-option {
  width: 100%;
  padding: 7px;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.supplier-picker-option:hover {
  background: #eef3ff;
  color: var(--primary-dark);
}

.supplier-picker-option img {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  object-fit: cover;
}

.supplier-picker-option strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delete-check {
  margin: 0;
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #b42336;
  font-weight: 800;
}

.delete-check input {
  width: 16px;
  height: 16px;
  padding: 0;
}

.sku-delete-btn {
  min-width: 58px;
  padding: 8px 10px;
}

.sku-row-pending-delete {
  opacity: 0.42;
  background: #fff5f6;
}

.sku-row-pending-delete input,
.sku-row-pending-delete select,
.sku-row-pending-delete .upload-thumb {
  pointer-events: none;
}

.sku-row-pending-delete .sku-delete-btn {
  pointer-events: none;
}

.upload-thumb {
  position: relative;
  margin: 0;
  width: 64px;
  display: inline-grid;
  cursor: pointer;
  color: inherit;
}

.upload-thumb input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-thumb .thumb {
  width: 64px;
  height: 64px;
}

.upload-thumb-text {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 4px;
  padding: 2px 3px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  pointer-events: none;
}

.upload-thumb.has-new-file .upload-thumb-text {
  background: rgba(18, 106, 53, 0.82);
}

.upload-thumb-large {
  width: 100%;
  min-height: 92px;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f8faff;
}

.upload-thumb-large .thumb {
  width: 100%;
  height: 92px;
  border: 0;
}

.new-sku-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.new-sku-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.new-sku-upload {
  grid-row: span 2;
}

.new-sku-card label {
  margin: 0;
}

.new-sku-card label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.new-row-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef3ff;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 900;
}

.sku-edit-table th:nth-child(1),
.sku-edit-table td:nth-child(1),
.sku-page-table th:nth-child(1),
.sku-page-table td:nth-child(1) {
  width: 86px;
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  margin: 0 -28px -28px;
  padding: 14px 28px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
  background: rgba(245, 247, 251, 0.94);
  backdrop-filter: blur(10px);
}

.product-manage-table th:nth-child(1),
.product-manage-table td:nth-child(1) {
  width: 90px;
}

.sku-row {
  display: none;
  background: #fbfcff;
}

.sku-row.open {
  display: table-row;
}

.legacy-sku-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
  padding: 8px 0;
}

.legacy-sku-card {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.legacy-sku-card img,
.legacy-sku-card .thumb {
  width: 54px;
  height: 54px;
  object-fit: cover;
}

.legacy-sku-card strong,
.legacy-sku-card small {
  display: block;
}

.empty-cell {
  color: var(--muted);
  text-align: center;
}

.task {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.task h3 {
  margin-bottom: 4px;
}

.task small {
  display: block;
  margin-top: 8px;
  word-break: break-all;
}

.task-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.badge {
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--primary-dark);
  font-weight: 700;
}

.split {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

pre {
  min-height: 220px;
  overflow: auto;
  padding: 14px;
  border-radius: 8px;
  background: #0b1020;
  color: #d9e2ff;
  white-space: pre-wrap;
}

.checklist {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
}

.checklist.wide {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px 28px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
}

.setting-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.setting-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.setting-card strong {
  font-size: 18px;
}

.path-list {
  display: grid;
  gap: 12px;
}

dialog {
  width: min(560px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
}

label {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  color: var(--muted);
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  font: inherit;
}

select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--text);
  background: #fff;
  font: inherit;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.detail-hero {
  margin-bottom: 18px;
}

.detail-hero-main {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.detail-cover {
  width: 168px;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f1f5f9;
}

.detail-hero h1 {
  margin: 8px 0;
  font-size: 24px;
  line-height: 1.25;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.detail-tags span {
  padding: 5px 9px;
  border-radius: 999px;
  background: #f2f5fb;
  color: #40516d;
  font-size: 12px;
  font-weight: 700;
}

.detail-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.detail-section {
  margin-bottom: 18px;
}

.compact-head {
  margin-bottom: 12px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px;
}

.media-tile {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faff;
  text-decoration: none;
}

.collect-media-tile {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  cursor: grab;
}

.collect-media-tile.dragging {
  opacity: 0.45;
  outline: 2px dashed #2563eb;
}

.collect-media-preview {
  position: relative;
  display: block;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
}

.collect-media-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: space-between;
  padding: 7px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.collect-media-actions form {
  margin: 0;
}

.collect-drag-handle,
.collect-media-delete,
.collect-sort-save {
  border: 0;
  border-radius: 7px;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.collect-drag-handle {
  background: #eef4ff;
  color: #2454c6;
}

.collect-media-delete {
  background: #fff1f2;
  color: #be123c;
}

.collect-sort-save {
  background: #2563eb;
  color: #fff;
}

.media-tile img,
.media-tile video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.media-tile video {
  background: #0b1020;
}

.sku-attr-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  margin: 2px 4px 2px 0;
  padding: 4px 7px;
  border-radius: 999px;
  background: #f2f5fb;
  color: #40516d;
  font-size: 12px;
  font-weight: 700;
  vertical-align: middle;
}

.muted-text {
  color: var(--muted);
}

.media-tile span {
  position: absolute;
  left: 8px;
  top: 8px;
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.76);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.square-media .media-tile {
  aspect-ratio: 1;
}

.square-media .collect-media-tile {
  aspect-ratio: auto;
  min-height: 176px;
}

.square-media .collect-media-preview {
  aspect-ratio: 1;
}

.portrait-media .media-tile {
  aspect-ratio: 3 / 4;
}

.detail-media {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.detail-media .media-tile {
  aspect-ratio: 4 / 5;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.video-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.video-card video {
  width: 100%;
  aspect-ratio: 16 / 10;
  display: block;
  border-radius: 8px;
  background: #0b1020;
}

.video-card strong,
.video-card small {
  display: block;
  margin-top: 8px;
}

.video-card small {
  color: var(--muted);
}

.attrs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.attr-item {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcff;
}

.attr-item span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.attr-item strong {
  word-break: break-word;
}

.sku-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.sku-detail-table {
  min-width: 980px;
}

.empty-box {
  padding: 22px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  background: #fbfcff;
}

.publish-workbench .workbench-hero p {
  max-width: 920px;
}

.publish-workbench,
.matrix-panel {
  min-width: 0;
  max-width: 100%;
}

.matrix-filter {
  grid-template-columns: 220px 240px 120px auto;
  justify-content: start;
}

.publish-matrix-shell {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.publish-matrix-wrap {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  max-height: calc(100vh - 330px);
}

.publish-matrix-bottom-scroll {
  width: 100%;
  max-width: 100%;
  height: 20px;
  margin-top: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #eef3ff;
}

.publish-matrix-bottom-scroll span {
  display: block;
  height: 1px;
}

.publish-matrix-bottom-scroll::-webkit-scrollbar {
  height: 16px;
}

.publish-matrix-bottom-scroll::-webkit-scrollbar-track {
  border-radius: 999px;
  background: #e7ecf6;
}

.publish-matrix-bottom-scroll::-webkit-scrollbar-thumb {
  border: 4px solid #e7ecf6;
  border-radius: 999px;
  background: #8ea2d6;
}

.publish-matrix-table {
  width: max-content;
  min-width: 1480px;
  border-collapse: separate;
  border-spacing: 0;
}

.publish-matrix-table th,
.publish-matrix-table td {
  height: 64px;
  padding: 8px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
  vertical-align: middle;
  background: #fff;
}

.publish-matrix-table th {
  position: sticky;
  top: 0;
  z-index: 4;
  height: 52px;
  color: #48566f;
  background: #f8faff;
  font-size: 12px;
}

.publish-matrix-table .sticky-col {
  position: sticky;
  z-index: 3;
  text-align: left;
}

.publish-matrix-table th.sticky-col {
  z-index: 6;
}

.publish-matrix-table .image-col {
  left: 0;
  width: 112px;
  min-width: 112px;
}

.publish-matrix-table .name-col {
  left: 112px;
  width: 270px;
  min-width: 270px;
}

.publish-matrix-table .category-col {
  width: 116px;
  min-width: 116px;
  color: var(--muted);
  font-weight: 700;
}

.publish-matrix-table .category-col strong,
.publish-matrix-table .category-col small {
  display: block;
}

.publish-matrix-table .category-col strong {
  color: var(--text);
  font-size: 12px;
}

.publish-matrix-table .category-col small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.publish-matrix-table .shop-col {
  width: 104px;
  min-width: 104px;
}

.publish-matrix-table .shop-col span,
.publish-matrix-table .shop-col small,
.publish-matrix-table .name-col small {
  display: block;
}

.publish-matrix-table .shop-col span {
  color: var(--text);
  font-weight: 900;
}

.publish-matrix-table .shop-col small,
.publish-matrix-table .name-col small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.matrix-link-title {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  color: var(--text);
  font-weight: 900;
  text-decoration: none;
}

.matrix-link-title:hover {
  color: var(--accent);
}

.matrix-link-thumb {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f1f5f9;
}

.matrix-link-title span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collect-bound-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 6px;
  border-radius: 999px;
  background: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.14);
  vertical-align: middle;
}

.collect-bound-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #e9f8ef;
  color: #16824b;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  vertical-align: middle;
}

.matrix-link-items {
  margin-top: 8px;
  display: grid;
  gap: 5px;
}

.matrix-link-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  padding: 4px 6px;
  border: 1px solid #edf1f7;
  border-radius: 6px;
  background: #fbfcff;
}

.matrix-link-item img {
  width: 24px;
  height: 24px;
  object-fit: cover;
  border-radius: 5px;
}

.matrix-link-item span {
  min-width: 0;
  overflow: hidden;
  color: #526178;
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.publish-matrix-table .action-col {
  width: 150px;
  min-width: 150px;
}

.publish-matrix-table .matrix-group-start td {
  border-top: 2px solid #e7eefb;
}

.matrix-cover {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f1f5f9;
}

.matrix-group-image {
  vertical-align: top;
  background: #fff;
}

.matrix-status-cell {
  background: #fff;
}

.matrix-cell-form {
  margin: 0;
}

.matrix-hit,
.matrix-miss {
  width: 72px;
  min-height: 58px;
  margin: 0 auto;
  padding: 0;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: inherit;
  text-decoration: none;
}

.matrix-hit:hover,
.matrix-miss:hover {
  background: #f7f9ff;
}

.matrix-hit img,
.matrix-hit span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 2px solid #bfe8cc;
  border-radius: 8px;
  object-fit: cover;
  background: #e8f8ee;
  color: #126a35;
  font-weight: 900;
}

.matrix-hit small {
  margin-top: 4px;
  color: #126a35;
  font-size: 11px;
  font-weight: 900;
}

.matrix-miss {
  color: #e05252;
  font-size: 34px;
  line-height: 1;
  font-weight: 300;
}

.matrix-publish-actions {
  width: 86px;
  min-height: 62px;
  margin: 0 auto;
  display: grid;
  gap: 6px;
  place-items: center;
}

.matrix-publish-start,
.matrix-record-link {
  width: 72px;
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.matrix-publish-start {
  border: 0;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
}

.matrix-publish-start:disabled {
  cursor: wait;
  opacity: 0.7;
}

.matrix-record-link {
  border: 1px solid #dbe5f5;
  background: #f8fbff;
  color: #45617f;
}

.publish-run-notice[hidden] {
  display: none;
}

.shop-form-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(160px, 0.8fr) 150px 120px auto;
  gap: 12px;
  align-items: end;
}

.shop-form-grid label {
  margin: 0;
}

.shop-form-grid label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.shop-form-actions {
  display: flex;
  align-items: end;
}

.supplier-form-grid {
  grid-template-columns: minmax(260px, 1fr) 160px auto;
  max-width: 720px;
}

.supplier-create-grid {
  display: grid;
  grid-template-columns: 76px minmax(260px, 1fr) 160px auto;
  gap: 12px;
  align-items: end;
  max-width: 840px;
}

.supplier-create-grid label {
  margin: 0;
}

.supplier-create-grid label span:not(.supplier-avatar):not(.supplier-avatar-text) {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.shop-table {
  min-width: 1180px;
  table-layout: fixed;
}

.shop-table th:nth-child(1),
.shop-table td:nth-child(1) {
  width: 58px;
}

.shop-table th:nth-child(4),
.shop-table td:nth-child(4) {
  width: 150px;
}

.shop-table th:nth-child(6),
.shop-table td:nth-child(6) {
  width: 96px;
  text-align: center;
}

.shop-table th:nth-child(7),
.shop-table td:nth-child(7) {
  width: 150px;
}

.shop-table input,
.shop-table select {
  width: 100%;
  min-width: 110px;
  padding: 8px 10px;
}

.shop-actions-cell {
  text-align: right;
  white-space: nowrap;
}

.shop-inline-action {
  margin: 0 0 0 8px;
  display: inline-flex;
  vertical-align: middle;
}

.shop-actions-cell .small-btn {
  min-width: 58px;
  padding-inline: 10px;
}

.supplier-table {
  min-width: 980px;
  table-layout: fixed;
}

.supplier-table th:nth-child(1),
.supplier-table td:nth-child(1) {
  width: 58px;
}

.supplier-table th:nth-child(2),
.supplier-table td:nth-child(2) {
  width: 92px;
}

.supplier-table th:nth-child(3),
.supplier-table td:nth-child(3) {
  width: auto;
}

.supplier-table th:nth-child(4),
.supplier-table td:nth-child(4) {
  width: 190px;
}

.supplier-table th:nth-child(5),
.supplier-table td:nth-child(5) {
  width: 110px;
  text-align: center;
}

.supplier-table th:nth-child(6),
.supplier-table td:nth-child(6) {
  width: 160px;
}

.supplier-table input {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
}

.supplier-days-field {
  display: grid;
  grid-template-columns: minmax(80px, 1fr) 24px;
  align-items: center;
  gap: 8px;
}

.supplier-days-field span {
  color: var(--text);
  font-weight: 700;
}

.supplier-actions-cell {
  text-align: right;
  white-space: nowrap;
}

.supplier-actions-cell .small-btn {
  min-width: 58px;
  padding-inline: 10px;
}

.supplier-avatar-upload {
  position: relative;
  width: 64px;
  height: 64px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
}

.supplier-avatar-upload.compact {
  width: 56px;
  height: 56px;
}

.supplier-avatar-upload input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.supplier-avatar {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #f5f8ff;
}

.supplier-avatar-upload.compact .supplier-avatar {
  width: 56px;
  height: 56px;
  border-radius: 9px;
}

.supplier-avatar.empty {
  display: grid;
  place-items: center;
  color: #3153bc;
  font-size: 13px;
  font-weight: 900;
}

.supplier-avatar-text {
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 5px;
  padding: 2px 3px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  pointer-events: none;
}

.supplier-avatar-upload.has-new-file .supplier-avatar-text {
  background: rgba(18, 106, 53, 0.82);
}

.publish-record-panel {
  max-width: none;
}

.publish-record-panel .panel-head {
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.publish-record-panel .panel-head h2 {
  margin-bottom: 4px;
}

.publish-record-panel .table-legend {
  justify-content: flex-end;
  padding-top: 2px;
}

.publish-record-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.publish-record-form label {
  margin: 0;
}

.publish-record-form label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.publish-record-form input[readonly] {
  color: #5b667a;
  background: #f6f8fc;
}

.wide-field {
  grid-column: 1 / -1;
}

.record-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  padding-top: 2px;
}

.danger-zone {
  max-width: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-color: #ffc8d0;
  background: #fff8fa;
}

.danger-zone p {
  color: var(--muted);
}

.work-page {
  max-width: 1500px;
}

.work-stats .metric.overdue {
  border-color: #ffd3d8;
  background: #fff8f9;
}

.work-stats .metric.overdue strong {
  color: #c62b3a;
}

.work-stats .metric.done {
  border-color: #cfe9d7;
  background: #f7fcf8;
}

.work-stats .metric.done strong {
  color: #18753a;
}

.work-task-form {
  display: grid;
  grid-template-columns: minmax(260px, 2fr) repeat(3, minmax(140px, 1fr));
  gap: 14px;
  align-items: end;
}

.work-task-form label,
.work-filter-form label {
  margin: 0;
}

.work-task-form label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.work-task-form input,
.work-task-form select,
.work-task-form textarea,
.work-filter-form input,
.work-filter-form select {
  width: 100%;
  min-width: 0;
}

.work-title-field {
  grid-column: auto;
}

.work-description-field {
  grid-column: 1 / -2;
}

.work-description-field textarea {
  resize: vertical;
}

.work-form-actions {
  display: flex;
  justify-content: flex-end;
  align-items: end;
}

.work-form-actions button {
  width: 100%;
}

.work-filter-form {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 160px 160px auto auto;
  gap: 10px;
  align-items: center;
  padding: 14px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8faff;
}

.work-task-list {
  display: grid;
  gap: 10px;
}

.work-task-card {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 4px solid #8ca1d9;
  border-radius: 12px;
  background: #fff;
}

.work-task-card.status-doing {
  border-left-color: #315bd6;
}

.work-task-card.status-done {
  border-left-color: #2a9b50;
  background: #f9fcfa;
}

.work-task-card.status-done h3 {
  color: #728078;
  text-decoration: line-through;
}

.work-task-card.status-archived {
  opacity: 0.72;
}

.work-task-card.is-overdue {
  border-left-color: #d83b4d;
  background: #fffafb;
}

.work-task-check form,
.work-task-actions form {
  margin: 0;
}

.work-check-button {
  width: 28px;
  height: 28px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 2px solid #9aabd5;
  border-radius: 50%;
  color: #fff;
  background: #fff;
}

.status-done .work-check-button {
  border-color: #2a9b50;
  background: #2a9b50;
}

.work-task-main {
  min-width: 0;
}

.work-task-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.work-task-title-row h3 {
  margin: 0 4px 0 0;
  font-size: 17px;
}

.work-task-main p {
  margin: 9px 0 0;
  color: #596579;
  line-height: 1.65;
}

.work-priority,
.work-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.work-priority {
  color: #41506a;
  background: #edf1f8;
}

.priority-high {
  color: #9a5a00;
  background: #fff1cf;
}

.priority-urgent {
  color: #b42335;
  background: #ffe3e7;
}

.priority-low {
  color: #4f6872;
  background: #edf6f8;
}

.work-status {
  color: #3153a5;
  background: #eaf0ff;
}

.work-task-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.overdue-text {
  color: #c62b3a;
  font-weight: 800;
}

.work-task-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.work-empty {
  padding: 44px 18px;
  border: 1px dashed #c8d1e4;
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
  background: #fafbfe;
}

@media (max-width: 900px) {
  body {
    display: block;
  }

  .sidebar {
    width: auto;
    flex-basis: auto;
    min-height: auto;
  }

  .shell {
    width: 100%;
    max-width: 100%;
  }

  .status-grid,
  .detail-summary,
  .split,
  .settings-grid,
  .checklist.wide,
  .matrix-filter,
  .shop-form-grid,
  .publish-record-form {
    grid-template-columns: 1fr;
  }

  .work-task-form,
  .work-filter-form,
  .work-task-card {
    grid-template-columns: 1fr;
  }

  .work-title-field,
  .work-description-field {
    grid-column: auto;
  }

  .work-task-actions {
    justify-content: flex-start;
  }

  .wide-field {
    grid-column: auto;
  }

  .danger-zone {
    display: block;
  }

  .publish-record-page .compact-hero {
    grid-template-columns: 1fr;
  }

  .publish-record-page .product-page-title {
    grid-template-columns: 80px minmax(0, 1fr);
  }

  .publish-record-page .compact-cover {
    width: 80px;
    height: 80px;
  }

  .publish-record-page .hero-actions {
    justify-content: flex-start;
  }

  .detail-hero-main {
    grid-template-columns: 1fr;
  }

  .detail-cover {
    width: 100%;
    max-width: 260px;
  }

  .task,
  .topbar,
  .panel-head {
    flex-direction: column;
    align-items: stretch;
  }
}

/* custom.test inspired visual system — 2026-07-24 */
:root {
  --bg: #eef5fb;
  --panel: #ffffff;
  --text: #111827;
  --muted: #6c7a92;
  --line: #dbe7f3;
  --primary: #4f73f6;
  --primary-dark: #3159d4;
  --accent: #2fa0a2;
  --soft: #eef4ff;
  --shadow: 0 20px 50px rgba(84, 109, 138, 0.14);
  --soft-shadow: 0 10px 30px rgba(84, 109, 138, 0.1);
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 16% 12%, rgba(47, 160, 162, 0.16), transparent 28%),
    radial-gradient(circle at 82% 7%, rgba(79, 115, 246, 0.17), transparent 30%),
    linear-gradient(135deg, #f7fbfc 0%, #eef6fb 46%, #eaf1ff 100%);
  color: var(--text);
  font-family: "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: 252px;
  min-height: 100vh;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  color: #15233a;
  background: rgba(255, 255, 255, 0.8);
  border-right: 1px solid rgba(219, 231, 243, 0.92);
  box-shadow: 10px 0 36px rgba(84, 109, 138, 0.04);
  backdrop-filter: blur(18px);
}

.brand {
  gap: 12px;
  padding: 4px 0 28px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  box-shadow: 0 12px 28px rgba(47, 160, 162, 0.24);
}

.brand strong {
  display: block;
  font-size: 17px;
  line-height: 22px;
}

.brand span {
  color: #71809a;
  margin-top: 3px;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar nav a {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 8px;
  color: #5f6f88;
  gap: 12px;
  font-weight: 700;
  transition: color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.sidebar nav a:hover {
  color: #29415f;
  background: rgba(79, 115, 246, 0.08);
  transform: translateX(2px);
}

.sidebar nav a.active {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  box-shadow: 0 14px 30px rgba(47, 160, 162, 0.21);
}

.nav-icon,
.sidebar nav a:hover .nav-icon,
.sidebar nav a.active .nav-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: currentColor;
  background: transparent;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
}

.sidebar-footer {
  display: grid;
  gap: 14px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.system-card {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
}

.system-card > div > span {
  display: block;
  margin-bottom: 2px;
  color: #71809a;
  font-size: 12px;
}

.system-card strong {
  display: block;
}

.system-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  border-radius: 8px;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--primary));
}

.sidebar-home {
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #415875;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.48);
}

.sidebar-home:hover {
  color: var(--primary-dark);
  border-color: #b9cdf5;
  background: #fff;
}

.shell {
  width: calc(100% - 252px);
  max-width: calc(100vw - 252px);
  min-height: 100vh;
  margin-left: 252px;
  padding: 25px 28px 44px;
}

.workbench-hero {
  position: relative;
  min-height: 130px;
  align-items: start;
  overflow: hidden;
  padding: 24px 26px;
  border-color: rgba(219, 231, 243, 0.8);
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.94), rgba(236, 246, 250, 0.84) 54%, rgba(220, 234, 255, 0.78));
  box-shadow: var(--soft-shadow);
}

.workbench-hero::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -50px;
  top: -72px;
  border-radius: 42px;
  background: rgba(93, 165, 220, 0.17);
  transform: rotate(18deg);
}

.workbench-hero > * {
  position: relative;
  z-index: 1;
}

.workbench-hero h1 {
  margin-bottom: 9px;
  font-size: 34px;
  line-height: 42px;
  font-weight: 800;
}

.workbench-hero .eyebrow {
  margin-bottom: 6px;
  color: var(--accent);
  letter-spacing: 0.08em;
}

.workbench-hero p {
  font-size: 14px;
  color: #61728d;
}

.panel,
.metric,
.summary-card {
  border-color: rgba(219, 231, 243, 0.9);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(12px);
}

.panel {
  padding: 18px;
}

.panel-head {
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  font-size: 20px;
}

button,
.button-link:not(.ghost):not(.danger) {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  box-shadow: 0 12px 28px rgba(47, 160, 162, 0.18);
  font-weight: 800;
}

button:hover,
.button-link:not(.ghost):not(.danger):hover {
  color: #fff;
  background: linear-gradient(135deg, #288f91, #4167ec);
}

.button-link.primary-action {
  min-height: 42px;
  padding: 0 18px;
  white-space: nowrap;
}

.ghost {
  min-height: 42px;
  padding: 0 16px;
  color: #30445f;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: none;
}

.ghost:hover {
  color: var(--primary-dark);
  border-color: #a9c4f5;
  background: #f8fbff;
}

.danger {
  color: #ef476f;
  background: #fff4f7;
  border: 1px solid #ffd3dc;
  box-shadow: none;
}

.small-btn {
  min-height: 36px;
  padding: 0 12px;
}

input,
select,
textarea,
.collect-product-search {
  min-height: 42px;
  color: var(--text);
  background: #fff;
  border-color: #d7e4f2;
  outline: none;
}

input:focus,
select:focus,
textarea:focus,
.collect-product-search:focus {
  border-color: #8fb3ff;
  box-shadow: 0 0 0 3px rgba(79, 115, 246, 0.12);
}

.product-control-panel {
  padding: 14px 16px;
}

.product-table-wrap {
  border-color: var(--line);
  background: #fff;
}

.product-table {
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
}

.product-table th,
.product-table td {
  padding: 13px 14px;
  border-color: var(--line);
}

.product-table th {
  color: #63748d;
  background: #f5f8fc;
  font-size: 13px;
  text-align: left;
}

.product-table tbody tr {
  transition: background 0.16s ease;
}

.product-table tbody tr:hover {
  background: #fbfdff;
}

.product-cell .thumb,
.thumb {
  border-color: var(--line);
  background: #f8fbff;
}

.product-title-link {
  color: #3159d4;
}

.sku-count {
  color: #3159d4;
  background: #eaf1ff;
}

.table-legend span {
  color: #4b6472;
  background: #edf4f7;
  border: 1px solid #d8e6eb;
}

.data-badges .ok {
  color: #047857;
  background: #e6f8f0;
}

.data-badges .warn {
  color: #b96b09;
  background: #fff3df;
}

.notice {
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}

@media (max-width: 1000px) {
  body {
    display: block;
  }

  .sidebar {
    position: static;
    width: 100%;
    min-height: auto;
    padding: 18px;
  }

  .brand {
    padding-bottom: 18px;
  }

  .sidebar nav {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .sidebar-footer {
    display: none;
  }

  .shell {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    padding: 16px;
  }

  .workbench-hero {
    min-height: auto;
  }

  .product-filter {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  .sidebar nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar nav a {
    padding: 0 10px;
  }

  .workbench-hero {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .workbench-hero h1 {
    font-size: 28px;
    line-height: 36px;
  }

  .hero-actions {
    justify-content: flex-start;
  }
}
