* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f6f7f9;
  color: #1f2933;
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 28px;
  background: #ffffff;
  border-bottom: 1px solid #dde3ea;
}

.topbar h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
}

.topbar p {
  margin: 5px 0 0;
  color: #65758b;
}

.nav-link {
  color: #1769aa;
  text-decoration: none;
  white-space: nowrap;
}

.pager-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pager-form label {
  color: #52616f;
  font-size: 14px;
}

.pager-form input {
  width: 84px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid #c9d3df;
  border-radius: 6px;
  font-size: 15px;
}

.pager-form .search-input {
  width: 220px;
}

button {
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: #1769aa;
  color: #ffffff;
  font-size: 14px;
  cursor: pointer;
}

button:hover {
  background: #125482;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(360px, 43%) 1fr;
  gap: 18px;
  height: calc(100vh - 82px);
  max-width: 1360px;
  margin: 0 auto;
  padding: 18px;
}

.product-panel,
.detail-panel {
  min-height: 0;
  height: 100%;
  background: #ffffff;
  border: 1px solid #dde3ea;
  border-radius: 8px;
}

.product-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid #e5eaf0;
}

.panel-head h2 {
  margin: 0;
  font-size: 18px;
}

.panel-head span {
  color: #65758b;
  font-size: 14px;
}

.state,
.empty-detail {
  color: #65758b;
  padding: 22px;
}

.error {
  color: #b42318;
  background: #fff1f0;
}

.product-list {
  display: grid;
  gap: 1px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  background: #e5eaf0;
}

.product-item {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 14px;
  height: auto;
  min-height: 110px;
  width: 100%;
  padding: 14px 16px;
  background: #ffffff;
  border: 0;
  border-radius: 0;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.product-item:hover,
.product-item.active {
  background: #eef6fb;
}

.product-thumb,
.detail-cover,
.sku-thumb {
  display: block;
  background: #edf1f5;
  object-fit: cover;
}

.product-thumb {
  width: 82px;
  height: 82px;
  border-radius: 6px;
}

.product-name {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 8px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  background: #edf1f5;
  color: #425466;
  font-size: 12px;
}

.price {
  color: #b54708;
  font-weight: 700;
}

.detail-view {
  padding: 18px;
}

.detail-panel {
  overflow-y: auto;
}

.detail-header {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid #e5eaf0;
}

.detail-cover {
  width: 180px;
  height: 180px;
  border-radius: 8px;
}

.detail-title {
  margin: 0 0 10px;
  font-size: 24px;
  line-height: 1.35;
}

.detail-section {
  padding: 18px 0 0;
}

.detail-section h3 {
  margin: 0 0 12px;
  font-size: 17px;
}

.section-title,
.sku-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-title {
  margin-bottom: 12px;
}

.section-title h3 {
  margin: 0;
}

.copy-button {
  flex: 0 0 auto;
  height: 30px;
  padding: 0 12px;
  border: 1px solid #b7c6d8;
  background: #ffffff;
  color: #1769aa;
  font-size: 13px;
}

.copy-button:hover {
  background: #eef6fb;
}

.copy-button:disabled {
  border-color: #b8d7c5;
  background: #eef8f1;
  color: #18794e;
  cursor: default;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 10px;
}

.summary-item {
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #e5eaf0;
  border-radius: 8px;
}

.summary-item span {
  display: block;
  margin-bottom: 5px;
  color: #65758b;
  font-size: 12px;
}

.rich-text {
  line-height: 1.75;
  color: #344054;
}

.rich-text img,
.rich-text video,
.rich-text iframe {
  max-width: 100%;
  height: auto;
}

.rich-text img {
  display: block;
}

.rich-text table {
  max-width: 100%;
}

.sku-list,
.store-list {
  display: grid;
  gap: 10px;
}

.sku-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e5eaf0;
  border-radius: 8px;
}

.sku-thumb {
  width: 64px;
  height: 64px;
  border-radius: 6px;
}

.store-item {
  padding: 12px;
  border: 1px solid #e5eaf0;
  border-radius: 8px;
}

.store-item strong {
  display: block;
  margin-bottom: 6px;
}

.store-item p,
.sku-item p {
  margin: 4px 0;
  color: #52616f;
}

@media (max-width: 900px) {
  .topbar,
  .workspace,
  .detail-header {
    display: block;
  }

  .pager-form {
    margin-top: 16px;
  }

  .workspace {
    height: auto;
    padding: 12px;
  }

  .product-panel,
  .detail-panel {
    height: auto;
    overflow: visible;
    min-height: auto;
    margin-bottom: 12px;
  }

  .detail-cover {
    width: 100%;
    max-width: 260px;
    height: auto;
    aspect-ratio: 1;
    margin-bottom: 14px;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }
}
