:root {
  --bg: #f6f2ed;
  --surface: #ffffff;
  --surface-soft: #fbfbfb;
  --line: #e8e1d8;
  --line-strong: #d9cec1;
  --brand: #f57b08;
  --brand-deep: #d96500;
  --text: #5f5750;
  --text-soft: #a79d93;
  --mint: #46c4bf;
  --shadow: 0 18px 40px rgba(136, 97, 44, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(255, 179, 89, 0.18), transparent 38%),
    linear-gradient(180deg, #faf7f2 0%, #f5efe8 100%);
  color: var(--text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

.page {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 24px 12px;
}

.phone {
  width: min(100%, 390px);
  min-height: 844px;
  background: var(--surface);
  border-radius: 34px;
  overflow: hidden;
  box-shadow: var(--shadow);
  position: relative;
  border: 1px solid rgba(217, 206, 193, 0.7);
}

.topbar {
  height: 68px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #ff8d1c 0%, #f67700 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.08);
}

.logo {
  width: 104px;
  height: 38px;
  background: #fff4e8;
  border: 2px solid rgba(198, 90, 0, 0.35);
  display: grid;
  place-items: center;
  border-radius: 4px;
  overflow: hidden;
}

.logo-mark {
  width: 92px;
  height: 28px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--brand-deep);
}

.logo-mark b {
  font-size: 20px;
  line-height: 1;
  transform: skew(-8deg);
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}

.logo-text strong {
  font-size: 16px;
  color: #d16200;
}

.logo-text span {
  font-size: 8px;
  color: #b6763d;
  margin-top: 2px;
}

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

.top-icon {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(179, 73, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: grid;
  place-items: center;
}

.top-icon,
.main-tab,
.filter,
.cart-btn {
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background-color 0.18s ease,
    opacity 0.18s ease;
}

.top-icon:active,
.main-tab:active,
.filter:active,
.cart-btn:active {
  transform: scale(0.96);
}

.top-icon svg {
  width: 24px;
  height: 24px;
  stroke: #fff5eb;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.top-icon.is-highlight {
  box-shadow: 0 8px 18px rgba(171, 69, 0, 0.22);
  background: rgba(173, 70, 0, 0.28);
}

.cart-count {
  position: absolute;
  top: -6px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #fff8ef;
  color: #d96500;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(99, 45, 0, 0.14);
  opacity: 0;
  transform: scale(0.8);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.cart-count.is-visible {
  opacity: 1;
  transform: scale(1);
}

.main-tabs,
.filters {
  display: flex;
  align-items: center;
  background: var(--surface);
}

.main-tabs {
  height: 58px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  justify-content: space-between;
  gap: 10px;
}

.main-tab {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #5d5145;
}

.main-tab span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 2px;
  border-radius: 17px;
  font-size: 15px;
  line-height: 1;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.main-tab.active span {
  padding: 0 12px;
  color: #fff8ef;
  background: linear-gradient(180deg, #ff9b30 0%, #eb7400 100%);
  box-shadow:
    inset 0 -2px 0 rgba(134, 53, 0, 0.22),
    0 6px 12px rgba(239, 116, 0, 0.18);
  font-weight: 700;
}

.filters {
  height: 58px;
  padding: 0 8px;
  border-bottom: 1px solid var(--line);
  gap: 2px;
}

.filter {
  flex: 1;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 16px;
  color: #8a7d71;
  position: relative;
}

.filter.is-cycling {
  color: #b46a12;
}

.filter + .filter::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15px;
  width: 1px;
  height: 28px;
  background: rgba(223, 214, 206, 0.8);
}

.filter.active {
  color: #b46a12;
  font-weight: 700;
}

.filter.active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 0;
  height: 3px;
  background: #e78d22;
  border-radius: 999px 999px 0 0;
}

.filter .caret,
.filter .sort {
  font-size: 13px;
  margin-left: 4px;
  color: #b8aea5;
}

.list {
  padding-bottom: 28px;
  background:
    linear-gradient(180deg, rgba(249, 247, 243, 0.92), rgba(249, 247, 243, 0) 18%),
    #fff;
}

.product {
  display: grid;
  grid-template-columns: 96px 1fr 52px;
  gap: 14px;
  padding: 18px 16px;
  border-bottom: 1px solid var(--line);
  min-height: 152px;
  transition:
    transform 0.24s ease,
    background-color 0.24s ease,
    box-shadow 0.24s ease;
}

.product.is-added {
  background: linear-gradient(180deg, rgba(255, 247, 236, 0.96), #fff);
  box-shadow: inset 0 1px 0 rgba(255, 179, 89, 0.12);
}

.thumb {
  width: 96px;
  height: 96px;
  border: 1px solid #ece6de;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 4px 10px rgba(124, 95, 58, 0.08);
}

.thumb-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-body {
  min-width: 0;
}

.title {
  margin: 2px 0 12px;
  font-size: 18px;
  line-height: 1.35;
  color: #62554a;
  letter-spacing: 0.01em;
}

.progress {
  height: 8px;
  border-radius: 999px;
  background: #edf1f2;
  overflow: hidden;
  position: relative;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f09b29 0%, #ef7400 100%);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 8px;
  font-size: 12px;
  color: #b3a79b;
}

.stat strong {
  display: block;
  margin-bottom: 3px;
  font-size: 15px;
  font-weight: 700;
}

.stat:nth-child(1) strong {
  color: #d79223;
}

.stat:nth-child(2) {
  text-align: center;
}

.stat:nth-child(2) strong {
  color: #6b6057;
}

.stat:nth-child(3) {
  text-align: right;
}

.stat:nth-child(3) strong {
  color: var(--mint);
}

.cart-btn {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 6px;
  align-self: center;
  background: linear-gradient(180deg, #ff921f 0%, #ef7400 100%);
  box-shadow: 0 6px 14px rgba(239, 116, 0, 0.22);
  display: grid;
  place-items: center;
}

.cart-btn svg {
  width: 26px;
  height: 26px;
  stroke: #fff6ec;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cart-btn:disabled {
  cursor: default;
  opacity: 0.52;
  box-shadow: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 20;
  max-width: min(calc(100vw - 32px), 320px);
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(37, 31, 26, 0.88);
  color: #fffaf4;
  font-size: 14px;
  line-height: 1.2;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 12px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}

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

@media (max-width: 420px) {
  .page {
    padding: 0;
  }

  .phone {
    width: 100%;
    min-height: 100vh;
    border-radius: 0;
    border: 0;
    box-shadow: none;
  }
}
