:root {
  --bg: #fff;
  --text: #111;
  --muted: #666;
  --line: #e6e6e6;
  --card: #f7f7f7;
  --btn: #111;
  --btn-text: #fff;
  --danger: #c0392b;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: 12px 16px 40px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.brand {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--btn);
  color: var(--btn-text);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  width: 100%;
}

.btn-block {
  width: 100%;
}

.btn-ghost {
  background: #f0f0f0;
  color: var(--text);
}

.btn-sell,
.btn-sell-solid {
  background: #1f7a4c;
  color: #fff;
}

.btn-sell {
  min-height: 40px;
  margin: 0 12px 12px;
}

.top-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.tabs-secondary {
  margin-top: -4px;
}

.tabs-secondary .tab {
  font-size: 13px;
  min-height: 36px;
  background: #f7f7f7;
}

.tag-instock {
  background: #e8f7ee;
  color: #1f7a4c;
}

.tag-partial {
  background: #fff4e5;
  color: #8a5a00;
}

.tag-soldout {
  background: #fdecea;
  color: #c0392b;
}

.list-item {
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
}

.list-item .card {
  background: transparent;
  border-radius: 0;
}

.stock-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px !important;
  flex-wrap: wrap;
}

.money.is-profit {
  color: #1f7a4c;
}

.money.is-loss {
  color: #c0392b;
}

.actions-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.sales-section {
  margin: 8px 0 20px;
}

.section-title {
  font-size: 17px;
  margin: 0 0 10px;
}

.sale-list,
.trade-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sale-card,
.trade-card {
  display: block;
  background: var(--card);
  border-radius: 12px;
  padding: 12px;
  text-decoration: none;
  color: inherit;
}

.sale-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.sale-row.muted,
.muted {
  color: var(--muted);
  font-size: 14px;
}

.sale-notes {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.sell-summary {
  background: var(--card);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 16px;
}

.sell-name {
  margin: 0 0 4px;
  font-weight: 700;
}

.summary-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.summary-item {
  background: var(--card);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.summary-item strong {
  font-size: 18px;
}

.search {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.search input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  font: inherit;
  border: 1px solid #ccc;
  border-radius: 10px;
  background: #fff;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #f0f0f0;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

.tab.is-active {
  background: var(--btn);
  color: var(--btn-text);
}

.tag {
  display: inline-block;
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.tag-shoe {
  background: #e8f1ff;
  color: #1f4b99;
}

.tag-apparel {
  background: #f3e9ff;
  color: #6b3fa0;
}

.info-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.info-top h2 {
  margin: 0;
}

.detail-tags {
  margin: -8px 0 14px;
}

.form select {
  display: block;
  width: 100%;
  margin-top: 6px;
  font: inherit;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 10px;
  background: #fff;
}

.flash {
  background: #fff4e5;
  color: #8a5a00;
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 16px;
}

.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card {
  display: flex;
  gap: 12px;
  background: var(--card);
  border-radius: 12px;
  padding: 12px;
  text-decoration: none;
  color: inherit;
}

.thumb {
  width: 88px;
  height: 88px;
  flex-shrink: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #eee;
  display: flex;
  align-items: center;
  justify-content: center;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.no-img {
  color: var(--muted);
  font-size: 13px;
}

.no-img.big {
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eee;
  border-radius: 12px;
  font-size: 16px;
}

.info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.info h2 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.info p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty {
  text-align: center;
  padding: 48px 12px;
  color: var(--muted);
}

.page-title,
.detail h1 {
  font-size: 22px;
  margin: 0 0 16px;
}

.photo img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  margin-bottom: 16px;
  background: #eee;
}

.meta {
  margin: 0 0 20px;
}

.meta > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.meta dt {
  color: var(--muted);
  font-weight: 400;
}

.meta dd {
  margin: 0;
  text-align: right;
  word-break: break-word;
}

.meta .full {
  display: block;
}

.meta .full dd {
  text-align: left;
  margin-top: 6px;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

.actions form {
  margin: 0;
}

.back {
  display: block;
  text-align: center;
  color: var(--muted);
  padding: 12px;
  text-decoration: none;
}

.form label {
  display: block;
  font-weight: 600;
  margin-bottom: 14px;
}

.form input,
.form textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  font: inherit;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 10px;
  background: #fff;
}

.sku-wrap {
  position: relative;
  margin-top: 6px;
}

.sku-wrap input {
  margin-top: 0;
}

.sku-suggest {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  position: absolute;
  left: 0;
  right: 0;
  z-index: 20;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.sku-suggest-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.sku-suggest li:last-child .sku-suggest-item {
  border-bottom: 0;
}

.sku-suggest-item:active,
.sku-suggest-item:hover {
  background: #f3f3f3;
}

.sku-code {
  font-weight: 700;
  color: var(--text);
}

.sku-name {
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.form textarea {
  resize: vertical;
}

.req {
  font-weight: 400;
  color: var(--muted);
  font-size: 13px;
}

.hint {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 10px;
}

.preview {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 16px;
}
