:root {
  --brand: #ff0036;
  --brand-dark: #c4002f;
  --brand-soft: #fff1f3;
  --gold: #ffb800;
  --text: #1f1f1f;
  --muted: #666;
  --weak: #999;
  --line: #eee;
  --bg: #f5f5f5;
  --white: #fff;
  --green: #12b76a;
  --orange: #f79009;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Alibaba PuHuiTi 3.0", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
}

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

button {
  border: 0;
  cursor: pointer;
}

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

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  min-height: 100vh;
  padding-bottom: 68px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: grid;
  grid-template-columns: 140px minmax(220px, 1fr) auto;
  gap: 18px;
  align-items: center;
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 22px;
  font-weight: 800;
  color: var(--brand);
}

.logo-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: var(--brand);
  color: var(--white);
  font-weight: 900;
}

.search {
  display: flex;
  min-width: 0;
  border: 2px solid var(--brand);
  border-radius: 999px;
  overflow: hidden;
  background: var(--white);
}

.promo-strip {
  position: relative;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 6px 58px;
  background: linear-gradient(90deg, #ff001f 0%, #f20a19 56%, #e60012 100%);
  color: var(--white);
  box-shadow: 0 3px 10px rgba(255, 0, 54, 0.22);
}

.promo-strip-inner {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.promo-emoji {
  font-size: 30px;
  line-height: 1;
}

.promo-strip strong {
  font-size: 24px;
  font-weight: 900;
}

.promo-strip-btn {
  min-height: 34px;
  border-radius: 8px;
  padding: 0 16px;
  background: var(--white);
  color: var(--brand);
  font-weight: 800;
}

.promo-close {
  position: absolute;
  right: 18px;
  top: 50%;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.18);
  color: var(--white);
  font-size: 22px;
  line-height: 1;
}

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 10px 16px;
}

.search button,
.primary-btn {
  background: var(--brand);
  color: var(--white);
  font-weight: 700;
}

.search button {
  padding: 0 22px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.ghost-btn,
.secondary-btn {
  background: var(--white);
  color: var(--brand);
  border: 1px solid var(--brand);
}

.ghost-btn,
.primary-btn,
.secondary-btn,
.danger-btn,
.plain-btn {
  min-height: 36px;
  border-radius: 999px;
  padding: 0 16px;
}

.danger-btn {
  background: var(--brand-dark);
  color: var(--white);
}

.plain-btn {
  background: #f7f7f7;
  color: var(--text);
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 20px;
}

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
  margin-bottom: 18px;
}

.hero-main {
  min-height: 260px;
  border-radius: 18px;
  padding: 34px;
  background:
    radial-gradient(circle at 78% 35%, rgba(255, 184, 0, 0.35), transparent 34%),
    linear-gradient(135deg, #ff0036, #ff4f18);
  color: var(--white);
  overflow: hidden;
}

.hero-main h1 {
  max-width: 520px;
  margin: 0 0 12px;
  font-size: 34px;
  line-height: 1.18;
}

.hero-main p {
  max-width: 460px;
  margin: 0 0 24px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 16px;
}

.hero-side {
  display: grid;
  gap: 12px;
}

.promo-tile {
  border-radius: 16px;
  padding: 20px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.promo-tile strong {
  display: block;
  margin-bottom: 8px;
  font-size: 18px;
}

.section {
  margin-top: 24px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.section-title {
  margin: 0;
  font-size: 22px;
}

.tabs,
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tab {
  min-height: 34px;
  padding: 0 15px;
  border-radius: 999px;
  background: var(--white);
  color: var(--text);
  border: 1px solid var(--line);
}

.tab.active {
  color: var(--brand);
  border-color: var(--brand);
  background: var(--brand-soft);
  font-weight: 700;
}

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

.product-card {
  overflow: hidden;
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.1);
}

.product-image {
  display: grid;
  aspect-ratio: 1;
  place-items: center;
  background: linear-gradient(135deg, #fff5f6, #ffe7eb);
  color: var(--brand);
  font-size: 48px;
  font-weight: 900;
}

.product-body {
  padding: 12px;
}

.product-title {
  display: -webkit-box;
  min-height: 40px;
  margin: 0 0 8px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.45;
}

.price {
  color: var(--brand);
  font-size: 22px;
  font-weight: 800;
}

.price small {
  font-size: 13px;
}

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

.card {
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
  gap: 22px;
}

.detail-info {
  padding: 22px;
}

.detail-info h1 {
  margin: 0 0 12px;
  font-size: 28px;
}

.sku-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 16px;
}

.sku-btn {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
}

.sku-btn.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
}

.qty {
  display: inline-grid;
  grid-template-columns: 34px 48px 34px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.qty button {
  height: 34px;
  background: #fafafa;
}

.qty span {
  text-align: center;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.action-row button {
  min-height: 42px;
  padding: 0 24px;
}

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

.field {
  display: grid;
  gap: 6px;
}

.field.full {
  grid-column: 1 / -1;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 12px;
  outline: 0;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--brand);
}

.cart-layout,
.checkout-layout,
.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
}

.cart-item,
.order-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.cart-item:last-child,
.order-card:last-child {
  border-bottom: 0;
}

.thumb {
  display: grid;
  width: 82px;
  height: 82px;
  place-items: center;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 28px;
  font-weight: 900;
}

.summary {
  position: sticky;
  top: 82px;
  align-self: start;
  padding: 18px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 10px 0;
}

.free-tip {
  margin: 12px 0;
  border-radius: 6px;
  padding: 10px;
  background: var(--brand-soft);
  color: var(--brand);
}

.status {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  border-radius: 4px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
}

.status.pending {
  background: #fff4e5;
  color: var(--orange);
}

.status.paid {
  background: var(--brand-soft);
  color: var(--brand);
}

.status.shipped,
.status.done {
  background: #ecfdf3;
  color: var(--green);
}

.status.cancelled {
  background: #f2f4f7;
  color: var(--weak);
}

.empty {
  padding: 46px 18px;
  text-align: center;
}

.admin-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 100vh;
}

.admin-side {
  background: #1f1f1f;
  color: var(--white);
  padding: 20px;
}

.admin-side .logo {
  margin-bottom: 22px;
  color: var(--white);
}

.side-link {
  display: block;
  margin: 8px 0;
  border-radius: 6px;
  padding: 11px 12px;
  color: rgba(255, 255, 255, 0.78);
}

.side-link.active {
  background: var(--brand);
  color: var(--white);
  font-weight: 700;
}

.admin-main {
  min-width: 0;
  background: #f7f8fa;
}

.admin-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: var(--white);
  padding: 14px 22px;
}

.admin-content {
  padding: 22px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  vertical-align: middle;
}

.table th {
  color: var(--muted);
  font-weight: 700;
}

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

.mini-btn {
  min-height: 30px;
  border-radius: 6px;
  padding: 0 10px;
  background: #f5f5f5;
}

.mini-btn.red {
  background: var(--brand-soft);
  color: var(--brand);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 22px;
  z-index: 50;
  border-radius: 8px;
  padding: 12px 16px;
  background: #1f1f1f;
  color: var(--white);
  box-shadow: var(--shadow);
}

.mobile-nav {
  display: none;
}

@media (max-width: 900px) {
  .topbar-inner {
    grid-template-columns: 1fr;
  }

  .promo-strip {
    min-height: 44px;
    padding: 6px 46px 6px 12px;
  }

  .promo-strip-inner {
    justify-content: flex-start;
    gap: 8px;
    font-size: 14px;
  }

  .promo-strip strong {
    font-size: 17px;
  }

  .promo-emoji {
    font-size: 22px;
  }

  .promo-strip-btn {
    display: none;
  }

  .nav-actions {
    justify-content: space-between;
  }

  .hero,
  .detail-grid,
  .cart-layout,
  .checkout-layout,
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cart-item,
  .order-card {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .cart-item > .table-actions,
  .cart-item > .price {
    grid-column: 2;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .summary {
    position: static;
  }

  .admin-shell {
    grid-template-columns: 1fr;
  }

  .admin-side {
    display: none;
  }

  .table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  .mobile-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--line);
    background: var(--white);
  }

  .mobile-nav button {
    min-height: 56px;
    background: var(--white);
    color: var(--muted);
  }

  .mobile-nav button.active {
    color: var(--brand);
    font-weight: 700;
  }
}

@media (max-width: 520px) {
  .container {
    padding: 16px 12px;
  }

  .hero-main {
    min-height: 220px;
    padding: 24px;
  }

  .hero-main h1 {
    font-size: 26px;
  }

  .product-grid {
    gap: 10px;
  }

  .product-body {
    padding: 10px;
  }

  .price {
    font-size: 20px;
  }
}
