@font-face {
  font-family: "OPPO Sans 4.0";
  src: url("./assets/fonts/OPPO-Sans-4.0.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  font-family: "OPPO Sans 4.0", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  --ink: #17202a;
  --muted: #6d7682;
  --line: #e8edf2;
  --paper: #f6f7f9;
  --surface: #ffffff;
  --surface-raised: rgba(255, 255, 255, 0.92);
  --orange: #ff5000;
  --orange-deep: #ff4400;
  --green: #07c160;
  --blue: #ff5000;
  --red: #d93030;
  --shadow: 0 18px 44px rgba(18, 32, 44, 0.08);
  --shadow-soft: 0 8px 22px rgba(18, 32, 44, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f6f7f9;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

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

button:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px) saturate(1.25);
  box-shadow: none;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--orange-deep);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  font-size: 23px;
  line-height: 1.15;
  letter-spacing: 0;
}

main {
  width: min(100%, 920px);
  margin: 0 auto;
  padding: 18px 14px 104px;
}

.cart-button,
.primary-button,
.ghost-button {
  min-height: 42px;
  border-radius: 8px;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease;
}

.cart-button,
.primary-button {
  border: 0;
  background: linear-gradient(180deg, #ff7a1a, var(--orange));
  color: #fff;
  box-shadow: 0 10px 22px rgba(255, 80, 0, 0.22);
}

.cart-button:hover,
.primary-button:hover,
.ghost-button:hover,
.add-cart-button:hover {
  transform: translateY(-1px);
}

.ghost-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  color: var(--blue);
}

.cart-button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 82px;
  justify-content: center;
}

.cart-button strong {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: #fff;
  color: var(--orange);
}

.profile-panel,
.gift-panel,
.buyer-strip,
.order-history-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-raised);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.profile-panel {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.auth-panel {
  max-width: 520px;
  margin: 0 auto;
}

.profile-copy {
  display: grid;
  gap: 8px;
}

.profile-copy p:last-child,
.gift-panel p,
.product-card p {
  color: var(--muted);
  line-height: 1.55;
}

.profile-form {
  display: grid;
  gap: 14px;
}

.auth-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.auth-switch button {
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.auth-switch button.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 6px 16px rgba(18, 32, 44, 0.08);
}

.profile-form label span,
.note-field span {
  color: #26313c;
  font-size: 13px;
}

.profile-form label,
.note-field {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 800;
}

.profile-form input,
.profile-form textarea,
.note-field textarea,
.option-row select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(18, 32, 44, 0.02);
  transition:
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

.profile-form input:focus,
.profile-form textarea:focus,
.note-field textarea:focus,
.option-row select:focus {
  outline: 0;
  border-color: rgba(255, 80, 0, 0.48);
  box-shadow: 0 0 0 4px rgba(255, 80, 0, 0.12);
}

.profile-form input {
  height: 46px;
  padding: 0 12px;
}

.profile-form textarea,
.note-field textarea {
  resize: vertical;
  padding: 10px 12px;
}

.register-fields,
.form-actions {
  display: grid;
  gap: 14px;
}

.form-hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.buyer-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 16px;
}

.buyer-strip strong,
.buyer-strip span {
  display: block;
}

.buyer-strip span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.strip-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 8px;
}

.profile-editor {
  margin-bottom: 16px;
}

.gift-panel {
  margin-top: 12px;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(246, 249, 251, 0.92)),
    var(--surface);
}

.gift-copy {
  display: grid;
  gap: 6px;
}

.gift-copy span {
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e9fff5;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.progress {
  overflow: hidden;
  height: 8px;
  margin-top: 14px;
  border-radius: 999px;
  background: #e7edf2;
}

.progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), #ffb000);
}

.gift-rules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.gift-rules div {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
  box-shadow: var(--shadow-soft);
}

.gift-rules img {
  width: 100%;
  height: 82px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
}

.gift-rules b {
  color: var(--orange);
}

.gift-rules span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 18px 0 14px;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.order-history-panel {
  margin-top: 22px;
  padding: 8px 12px 14px;
}

.order-history-list {
  display: grid;
  gap: 10px;
}

.order-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.order-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.order-card-head strong,
.order-card-head span,
.order-card-head b {
  display: block;
}

.order-card-head span,
.order-meta,
.order-items-preview span:last-child {
  color: var(--muted);
  font-size: 13px;
}

.order-card-head b {
  color: var(--orange);
  white-space: nowrap;
}

.order-gift {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 8px;
  background: #e9fff5;
}

.order-gift span {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.order-gift strong {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  text-align: right;
}

.order-gift-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.order-gift-item {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.order-gift-item img {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 6px;
  object-fit: cover;
}

.order-items-preview {
  display: grid;
  gap: 8px;
}

.order-items-preview div {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.tabs button {
  flex: 0 0 auto;
  height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  font-weight: 800;
  cursor: pointer;
}

.tabs button.active {
  border-color: rgba(255, 80, 0, 0.24);
  background: #fff;
  color: var(--orange-deep);
  box-shadow: 0 8px 20px rgba(18, 32, 44, 0.08);
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 2px 14px;
}

.section-title h2 {
  font-size: 20px;
}

.catalog-section + .catalog-section {
  margin-top: 28px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.product-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.product-card:hover {
  transform: translateY(-2px);
  border-color: #d4dde6;
  box-shadow: 0 18px 36px rgba(18, 32, 44, 0.1);
}

.product-card.sold-out {
  background: #f5f7fa;
}

.product-media {
  position: relative;
  padding: 10px;
  background: linear-gradient(180deg, #fbfcfd, #f4f8fa);
}

.product-image {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
}

.sold-out .product-image {
  filter: grayscale(1);
  opacity: 0.62;
}

.stock-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(32, 33, 36, 0.88);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.product-copy {
  min-height: 82px;
  padding: 12px 12px 8px;
}

.product-copy h3 {
  font-size: 14px;
  line-height: 1.35;
  display: -webkit-box;
  min-height: 38px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-copy p {
  margin-top: 4px;
  font-size: 12px;
}

.option-row,
.price-row {
  display: grid;
  align-items: center;
  gap: 8px;
}

.option-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.price-row {
  grid-template-columns: 1fr;
  padding: 0 12px;
}

.option-row,
.price-row {
  margin-bottom: 12px;
}

.option-placeholder {
  min-height: 38px;
  margin-bottom: 10px;
}

.option-row select {
  min-width: 0;
  width: 100%;
  min-height: 38px;
  padding: 6px 8px;
}

.option-row strong,
.price-row strong {
  color: var(--ink);
  white-space: nowrap;
  font-size: 20px;
}

.price-row span {
  color: var(--muted);
  font-size: 12px;
}

.option-row strong {
  order: -1;
}

.stepper {
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  align-items: center;
  margin-top: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.stepper button {
  height: 36px;
  border: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
}

.stepper span {
  text-align: center;
  font-weight: 800;
}

.add-cart-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: calc(100% - 24px);
  min-height: 38px;
  margin: auto 12px 12px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(180deg, #ff7a1a, var(--orange));
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.add-cart-button b {
  display: inline-grid;
  min-width: 44px;
  height: 22px;
  place-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  font-size: 12px;
}

.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  align-items: end;
  background: rgba(23, 32, 42, 0.42);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.cart-drawer[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}

.cart-sheet {
  max-height: 86vh;
  overflow: auto;
  padding: 18px 16px 22px;
  border-radius: 16px 16px 0 0;
  background: #fff;
  box-shadow: 0 -20px 50px rgba(18, 32, 44, 0.16);
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.icon-button {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  font-size: 24px;
  cursor: pointer;
}

.cart-items {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.cart-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.cart-thumb {
  display: block;
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: 6px;
  background: #fff;
}

.cart-item span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.cart-item b {
  color: var(--orange);
  white-space: nowrap;
}

.cart-item-side {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.cart-mini-stepper {
  display: grid;
  grid-template-columns: 28px 30px 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.cart-mini-stepper button {
  border: 0;
  background: var(--paper);
  color: var(--ink);
  font-weight: 900;
}

.cart-mini-stepper span {
  display: grid;
  place-items: center;
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.sku-drawer {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: grid;
  align-items: end;
  background: rgba(23, 32, 42, 0.48);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.sku-drawer[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}

.sku-sheet {
  position: relative;
  max-height: 88vh;
  overflow: auto;
  padding: 18px 16px 22px;
  border-radius: 16px 16px 0 0;
  background: #fff;
  box-shadow: 0 -20px 50px rgba(18, 32, 44, 0.18);
}

.sku-close {
  position: absolute;
  top: 12px;
  right: 12px;
}

.sku-head {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  padding-right: 44px;
}

.sku-head img {
  width: 92px;
  height: 92px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.sku-head strong,
.sku-head span,
.sku-head small {
  display: block;
}

.sku-head strong {
  line-height: 1.35;
}

.sku-head span {
  margin-top: 8px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
}

.sku-head small {
  margin-top: 4px;
  color: var(--muted);
}

.sku-options {
  margin-top: 18px;
}

.sku-options p {
  margin-bottom: 10px;
  font-weight: 900;
}

.sku-options div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sku-options button {
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}

.sku-options button.active {
  border-color: rgba(255, 80, 0, 0.42);
  background: rgba(255, 80, 0, 0.08);
  color: var(--orange-deep);
  font-weight: 900;
}

.sku-qty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0;
  font-weight: 900;
}

.compact-stepper {
  width: 132px;
  margin: 0;
}

.empty {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.note-field {
  margin-top: 16px;
}

.summary {
  display: grid;
  gap: 10px;
  margin: 16px 0;
  padding: 14px;
  border-radius: 8px;
  background: var(--paper);
}

.summary div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.summary span {
  color: var(--muted);
}

#summaryGift {
  display: grid;
  justify-items: start;
  gap: 6px;
  min-width: 0;
  text-align: left;
}

#summaryGift .summary-gift-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  max-width: 100%;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

#summaryGift .summary-gift-item img {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  object-fit: cover;
}

#summaryGift .summary-gift-item b {
  font-size: 12px;
  white-space: nowrap;
}

.primary-button {
  width: 100%;
  min-height: 48px;
  font-size: 16px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 30;
  transform: translate(-50%, 20px);
  width: max-content;
  max-width: calc(100vw - 32px);
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(23, 32, 42, 0.96);
  color: #fff;
  opacity: 0;
  text-align: center;
  transition: 0.2s ease;
}

.toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}

[hidden] {
  display: none !important;
}

@media (min-width: 720px) {
  .topbar {
    padding: 18px max(24px, calc((100vw - 920px) / 2));
  }

  h1 {
    font-size: 28px;
  }

  main {
    padding-top: 22px;
  }

  .profile-editor {
    grid-template-columns: 0.78fr 1fr;
    align-items: start;
    padding: 24px;
  }

  .auth-panel {
    padding: 28px;
  }

  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }

  .product-image {
    aspect-ratio: 4 / 5;
  }

  .cart-drawer {
    justify-content: end;
    align-items: stretch;
  }

  .cart-sheet {
    width: min(430px, 100vw);
    max-height: none;
    border-radius: 0;
  }
}
