/* 商品管理内容页独立样式（可在 iframe 中单独加载） */
* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  margin: 0;
  padding: 0;
  background: #f0f2f5;
  min-height: 100vh;
}

.layout {
  display: flex;
  height: calc(100vh - 52px);
  overflow: hidden;
}

body.content-page .layout {
  height: 100vh;
}

.left {
  flex: 1;
  min-width: 320px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-right: 1px solid #e8e8e8;
  overflow: hidden;
}

.layout.has-right .left {
  flex: 0 0 60%;
}

.right {
  width: 0;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  background: #fff;
  transition: width 0.2s ease, min-width 0.2s ease;
}

.layout.has-right .right {
  width: 40%;
  min-width: 280px;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 24px;
}

.panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.panel-header h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.btn {
  display: inline-block;
  padding: 8px 16px;
  background: #F5A623;
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 14px;
}

.btn:hover {
  opacity: 0.9;
}

.btn.secondary {
  background: #666;
}

.list-wrap {
  flex: 1;
  overflow: auto;
}

#listWrap {
  display: none;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
  font-size: 13px;
}

th {
  background: #fafafa;
  font-weight: 600;
  color: #666;
}

tr:hover {
  background: #fafafa;
}

tr.selected {
  background: #fff7e6;
}

/* 剩余库存少于 10：行高亮 + 标签，提醒运营补货 */
tr.low-stock {
  background: #fff5f0;
  box-shadow: inset 4px 0 0 #ff4d4f;
}

tr.low-stock:hover {
  background: #ffeee8;
}

tr.low-stock.selected {
  background: #ffece6;
  box-shadow: inset 4px 0 0 #ff4d4f;
}

.list-stock--alert {
  white-space: nowrap;
  vertical-align: middle;
}

.stock-value--low {
  font-weight: 700;
  color: #cf1322;
}

.stock-alert-badge {
  display: inline-block;
  margin-left: 10px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  border-radius: 4px;
  background: linear-gradient(180deg, #ff7875 0%, #ff4d4f 100%);
  color: #fff;
  vertical-align: middle;
  letter-spacing: 0.04em;
  box-shadow: 0 1px 2px rgba(207, 19, 34, 0.35);
}

tr {
  cursor: pointer;
}

.list-name {
  font-weight: 500;
}

.list-price {
  white-space: nowrap;
}

.price-original {
  text-decoration: line-through;
  color: #999;
  margin-left: 0.35em;
}

.price-current {
  font-weight: 500;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.badge.active {
  background: #e6f7e6;
  color: #52c41a;
}

.badge.inactive {
  background: #fff1f0;
  color: #ff4d4f;
}

.loading {
  padding: 24px;
  text-align: center;
  color: #999;
}

.error {
  padding: 12px;
  background: #fff1f0;
  color: #c00;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 13px;
  display: none;
}

#error {
  margin: 0 20px 12px;
}

.form-placeholder {
  color: #999;
  text-align: center;
  padding: 48px 24px;
}

.form-placeholder p {
  margin: 0 0 12px;
}

.form-frame {
  width: 100%;
  height: 100%;
  min-height: 400px;
  border: none;
  display: block;
}

@media (max-width: 768px) {
  .layout {
    flex-direction: column;
  }

  .layout:not(.has-right) .right {
    display: none;
  }

  .left {
    width: 100%;
    height: 40%;
    min-height: 200px;
  }

  .layout.has-right .left {
    flex: none;
    height: 40%;
  }

  .right {
    min-height: 60%;
  }
}
