:root {
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  --page: #d9d9d9;
  --surface: #ffffff;
  --text: #312f49;
  --muted: #7b7a88;
  --line: #dddddf;
  --blue: #19aede;
  --purple: #3c2d78;
  --danger: #df273b;
  --shadow: 0 2px 10px rgba(30, 30, 45, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.phone-frame {
  width: min(100%, 620px);
  min-height: 100vh;
  margin: 0 auto;
  background: #ededed;
  box-shadow: 0 0 28px rgba(0, 0, 0, 0.18);
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 8px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

.brand-mark {
  color: var(--danger);
  font-size: 24px;
  font-weight: 900;
  font-style: italic;
}

.brand strong {
  color: var(--text);
  font-size: 18px;
}

.icon-button,
.mini-button {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  min-height: 42px;
  border-radius: 8px;
  color: var(--text);
  background: transparent;
  font-size: 26px;
}

main {
  padding: 22px 16px 80px;
}

.browse-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 4px;
  font-size: 20px;
}

.browse-head p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.view-actions {
  display: flex;
  gap: 8px;
}

.mini-button {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--line);
  background: #f8f8f8;
  font-size: 22px;
}

.mini-button.active {
  color: #ffffff;
  background: var(--blue);
}

.tools {
  display: grid;
  grid-template-columns: 1fr 138px;
  gap: 10px;
  margin-bottom: 12px;
}

.search-box {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #a8a8ad;
  background: #f7f7f7;
}

.search-box input,
.tools select {
  width: 100%;
  min-height: 42px;
  border: 0;
  color: var(--text);
  background: transparent;
  outline: none;
}

.tools select {
  padding: 0 10px;
  border: 1px solid #a8a8ad;
  background: #f7f7f7;
}

.product-list {
  display: grid;
  gap: 8px;
}

.product-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 104px;
  gap: 10px;
  align-items: center;
  min-height: 108px;
  padding: 14px;
  border-radius: 7px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.product-image {
  position: relative;
  width: 68px;
  height: 82px;
  margin: 0 auto;
  border: 1px solid #d7d7dc;
  border-radius: 12px 12px 8px 8px;
  background: #f7fbff;
  overflow: hidden;
}

.product-image.has-image {
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.product-image.has-image svg {
  display: block;
  width: 100%;
  height: 100%;
}

.product-image.has-image::before,
.product-image.has-image::after {
  display: none;
}

.product-image.has-image.carton,
.product-image.has-image.bag,
.product-image.has-image.box {
  background: transparent;
}

.product-image::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 50%;
  width: 16px;
  height: 8px;
  border-radius: 4px 4px 2px 2px;
  background: var(--cap, #2165b3);
  transform: translateX(-50%);
}

.product-image::after {
  content: attr(data-kind);
  position: absolute;
  right: 6px;
  bottom: 9px;
  left: 6px;
  padding: 4px 2px;
  border-radius: 4px;
  color: #ffffff;
  background: var(--label, #1f8bd5);
  font-size: 9px;
  font-weight: 900;
  text-align: center;
}

.product-image.carton {
  height: 82px;
  border-radius: 3px;
  background: linear-gradient(90deg, #ffffff, var(--carton, #bfe7ff));
}

.product-image.carton::before {
  display: none;
}

.product-image.bag {
  height: 82px;
  border-radius: 4px;
  background: var(--bag, #dd2440);
}

.product-image.box {
  height: 82px;
  border-radius: 5px;
  background: linear-gradient(135deg, #d9c2a4, #f4e7d5);
}

.product-info h2 {
  margin-bottom: 0;
  font-size: 15px;
  line-height: 1.25;
}

.remaining-field {
  display: grid;
  gap: 6px;
  color: var(--purple);
  font-size: 12px;
  font-weight: 900;
}

.remaining-field input {
  width: 100%;
  min-height: 42px;
  border: 2px solid var(--purple);
  border-radius: 999px;
  color: var(--text);
  text-align: center;
  outline: none;
}

.remaining-field input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(25, 174, 222, 0.18);
}

.preorder-note {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  color: #9b99a5;
  font-size: 13px;
  font-weight: 700;
}

.preorder-note strong {
  color: var(--danger);
}

.submit-panel {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 18px;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.submit-panel label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.submit-panel input,
.submit-panel textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  color: var(--text);
  outline: none;
}

.submit-summary {
  padding: 10px 12px;
  border-radius: 6px;
  color: var(--purple);
  background: #eeeaf8;
  font-weight: 900;
}

.primary-button {
  min-height: 48px;
  border-radius: 6px;
  color: #ffffff;
  background: var(--purple);
  font-weight: 900;
}

.empty-state {
  padding: 28px 16px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 560px) {
  .phone-frame {
    box-shadow: none;
  }

  .top-bar {
    grid-template-columns: 42px 1fr 42px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .brand-mark {
    font-size: 22px;
  }

  .brand strong {
    display: none;
  }

  main {
    padding-right: 10px;
    padding-left: 10px;
  }

  .tools,
  .field-grid {
    grid-template-columns: 1fr;
  }

  .product-card {
    grid-template-columns: 64px minmax(0, 1fr) 94px;
    min-height: 112px;
    padding: 12px 10px;
  }

  .remaining-field {
    grid-column: 3;
    grid-row: 1;
  }
}
