.wechat-product-page {
  --wx-green: #07c160;
  --wx-green-dark: #059b4d;
  --wx-ink: #17233d;
  --wx-muted: #718096;
  --wx-border: #e5ebf2;
}

.wechat-product-page-title {
  align-items: flex-start;
  gap: 24px;
}

.wechat-product-page-title h2 {
  margin-bottom: 8px;
}

.wechat-product-list-panel,
.wechat-product-editor-panel {
  border: 1px solid #edf1f6;
  box-shadow: 0 10px 30px rgba(24, 39, 75, 0.05);
}

.wechat-product-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 0;
}

.wechat-product-summary > div {
  padding: 18px 20px;
  border: 1px solid var(--wx-border);
  border-radius: 12px;
  background: #f8fafc;
}

.wechat-product-summary span,
.wechat-product-summary strong {
  display: block;
}

.wechat-product-summary span {
  color: var(--wx-muted);
  font-size: 13px;
}

.wechat-product-summary strong {
  margin-top: 5px;
  color: var(--wx-ink);
  font-size: 24px;
}

.wechat-product-table-status,
.wechat-product-status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 3px 10px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #526174;
  font-size: 12px;
  font-weight: 700;
}

.wechat-product-table-status[data-state="published"],
.wechat-product-status-badge[data-state="on_sale"] {
  background: #e8f8ef;
  color: #078746;
}

.wechat-product-table-status[data-state="failed"] {
  background: #fff0f1;
  color: #c53a47;
}

.wechat-product-table-status[data-state="uploaded"],
.wechat-product-table-status[data-state="pending"] {
  background: #fff7df;
  color: #9a6700;
}

.wechat-product-empty {
  padding: 48px 24px;
  border: 1px dashed #cfd8e5;
  border-radius: 14px;
  text-align: center;
  color: var(--wx-muted);
}

.wechat-product-empty strong {
  display: block;
  color: var(--wx-ink);
  font-size: 18px;
}

.wechat-product-empty p {
  margin: 8px 0 18px;
}

.wechat-product-editor-panel {
  max-width: 1180px;
  margin: 0 auto;
}

.wechat-product-context {
  display: grid;
  grid-template-columns: minmax(280px, 480px) 1fr;
  gap: 18px;
  align-items: end;
  margin: 22px 0;
  padding: 18px 20px;
  border: 1px solid #dce7f3;
  border-radius: 14px;
  background: #f6faff;
}

.wechat-product-context label,
.wechat-product-form label {
  margin: 0;
}

.wechat-product-context .hint {
  margin: 0 0 9px;
}

.wechat-product-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 24px;
}

.wechat-product-form label {
  align-self: start;
}

.wechat-product-form input,
.wechat-product-form textarea,
.wechat-product-form select {
  width: 100%;
}

.wechat-product-form textarea {
  resize: vertical;
  min-height: 112px;
}

.wechat-product-price-input {
  display: flex;
  align-items: center;
  border: 1px solid #d7dee8;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.wechat-product-price-input:focus-within {
  border-color: #2f80ed;
  box-shadow: 0 0 0 3px rgba(47, 128, 237, 0.12);
}

.wechat-product-price-input > span {
  padding-left: 13px;
  color: #526174;
  font-weight: 700;
}

.wechat-product-price-input input {
  border: 0;
  box-shadow: none;
}

.wechat-product-description-field,
.wechat-product-image-field {
  grid-column: 1 / -1;
}

.wechat-product-image-field {
  display: grid;
  grid-template-columns: 210px 1fr;
  column-gap: 20px;
}

.wechat-product-image-field > .image-upload-preview {
  grid-row: 2 / span 3;
  width: 200px;
  height: 200px;
}

.wechat-product-image-field > .image-upload-actions,
.wechat-product-image-field > .hint {
  grid-column: 2;
}

#wechatProductNameByteCount.is-error {
  color: #c53a47;
}

.wechat-product-workflow {
  margin-top: 28px;
  padding: 22px;
  border: 1px solid var(--wx-border);
  border-radius: 16px;
  background: #fbfcfe;
}

.wechat-product-workflow-header p {
  margin: 6px 0 0;
  color: var(--wx-muted);
}

#wechatProductWorkflowStatus[data-state="error"] {
  color: #c53a47;
}

#wechatProductWorkflowStatus[data-state="ready"] {
  color: #078746;
}

.wechat-product-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.wechat-product-steps li {
  display: flex;
  gap: 12px;
  min-height: 78px;
  padding: 14px;
  border: 1px solid var(--wx-border);
  border-radius: 12px;
  background: #fff;
}

.wechat-product-steps li > span {
  display: grid;
  flex: 0 0 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: #eaf0f6;
  color: #637083;
  font-weight: 800;
}

.wechat-product-steps li strong,
.wechat-product-steps li small {
  display: block;
}

.wechat-product-steps li small {
  margin-top: 4px;
  color: var(--wx-muted);
  line-height: 1.4;
}

.wechat-product-steps li[data-state="working"] {
  border-color: #8bc7a8;
  background: #f2fbf6;
}

.wechat-product-steps li[data-state="working"] > span,
.wechat-product-steps li[data-state="done"] > span {
  background: var(--wx-green);
  color: #fff;
}

.wechat-product-steps li[data-state="done"] {
  border-color: #b9e4cd;
}

.wechat-product-steps li[data-state="error"] {
  border-color: #f0b7bd;
  background: #fff8f8;
}

.wechat-product-steps li[data-state="error"] > span {
  background: #d94b59;
  color: #fff;
}

.wechat-product-primary-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

#submitWechatProductButton {
  min-width: 150px;
  background: var(--wx-green);
  border-color: var(--wx-green);
}

#submitWechatProductButton:hover {
  background: var(--wx-green-dark);
  border-color: var(--wx-green-dark);
}

.wechat-product-advanced {
  margin-top: 20px;
  padding: 16px 18px;
  border: 1px solid var(--wx-border);
  border-radius: 12px;
}

.wechat-product-advanced summary {
  cursor: pointer;
  color: #44546a;
  font-weight: 700;
}

.wechat-product-raw-status {
  max-height: 220px;
  margin: 14px 0 0;
  padding: 14px;
  overflow: auto;
  border-radius: 9px;
  background: #152033;
  color: #dbe7f5;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
}

@media (max-width: 900px) {
  .wechat-product-summary,
  .wechat-product-form,
  .wechat-product-steps,
  .wechat-product-context {
    grid-template-columns: 1fr;
  }

  .wechat-product-image-field {
    display: block;
  }

  .wechat-product-image-field > .image-upload-preview {
    margin: 10px 0;
  }

  .wechat-product-primary-actions {
    flex-direction: column-reverse;
  }

  .wechat-product-primary-actions button {
    width: 100%;
  }
}
