* {
  box-sizing: border-box;
}

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

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

.topbar p {
  margin: 0 0 4px;
  color: #637083;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

.home-link {
  color: #1769aa;
  text-decoration: none;
}

.page-shell {
  max-width: 1360px;
  margin: 0 auto;
  padding: 18px;
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
  padding: 16px;
  background: #ffffff;
  border: 1px solid #dde3ea;
  border-radius: 8px;
}

label {
  display: grid;
  gap: 6px;
  color: #52616f;
  font-size: 13px;
}

input,
select {
  width: 100%;
  padding: 0 10px;
  border: 1px solid #c9d3df;
  border-radius: 6px;
  background: #ffffff;
  font-size: 14px;
}

input,
select:not([multiple]) {
  height: 36px;
}

select[multiple] {
  min-height: 92px;
  padding: 6px 10px;
}

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

button:hover {
  background: #125482;
}

button.secondary {
  border: 1px solid #b7c6d8;
  background: #ffffff;
  color: #1769aa;
}

button.secondary:hover {
  background: #eef6fb;
}

.summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0;
  color: #65758b;
}

.request-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px 16px;
  background: #ffffff;
  border: 1px solid #dde3ea;
  border-radius: 8px;
}

.request-panel strong {
  display: block;
  margin-bottom: 8px;
}

.request-panel code {
  display: block;
  padding: 10px;
  overflow-x: auto;
  border-radius: 6px;
  background: #edf1f5;
  color: #1f4f7a;
}

.error {
  color: #b42318;
}

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

.merchant-card {
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #dde3ea;
  border-radius: 8px;
}

.merchant-cover {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #edf1f5;
}

.merchant-body {
  padding: 14px;
}

.merchant-title {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.4;
}

.meta-row,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-row {
  margin: 0 0 10px;
}

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

.activity-list,
.sku-list {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.activity-item,
.sku-item {
  padding: 10px;
  border: 1px solid #e5eaf0;
  border-radius: 8px;
  background: #f8fafc;
}

.activity-item strong,
.sku-item strong {
  display: block;
  margin-bottom: 5px;
}

.sku-item {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 10px;
}

.sku-item img {
  width: 54px;
  height: 54px;
  border-radius: 6px;
  object-fit: cover;
  background: #edf1f5;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 18, 26, 0.56);
}

.modal-panel {
  position: relative;
  width: min(720px, calc(100vw - 28px));
  max-height: calc(100vh - 56px);
  margin: 28px auto;
  overflow: auto;
  background: #ffffff;
  border-radius: 8px;
}

.modal-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #dde3ea;
}

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

pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 980px) {
  .topbar,
  .toolbar,
  .summary {
    display: block;
  }

  .toolbar label,
  .toolbar button {
    margin-bottom: 10px;
  }

  .toolbar button {
    width: 100%;
  }
}
