:root {
  --page: #f3f4f6;
  --panel: #ffffff;
  --text: #22252c;
  --muted: #7b818b;
  --line: #e5e7eb;
  --accent: #2388e8;
  --accent-soft: #51b7f0;
  --price: #d85660;
  --shadow: 0 8px 22px rgba(30, 38, 55, 0.09);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

.phone-shell {
  width: min(100vw, 480px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--page);
  overflow-x: hidden;
}

.wechat-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 58px 1fr 58px;
  align-items: center;
  height: 108px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: #f8f8f9;
  border-bottom: 1px solid var(--line);
}

.chrome-icon,
.chrome-menu {
  border: 0;
  background: transparent;
  color: #17191f;
  cursor: pointer;
}

.chrome-icon {
  font-size: 48px;
  line-height: 1;
  font-weight: 200;
}

.chrome-menu {
  font-size: 28px;
  line-height: 1;
  letter-spacing: 4px;
}

.wechat-title {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.wechat-title strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 20px;
  font-weight: 800;
}

.mall-header {
  position: relative;
  display: grid;
  grid-template-columns: 128px 1fr 128px;
  align-items: center;
  min-height: 76px;
  padding: 14px 18px 4px;
  background: var(--page);
}

.language-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  width: 122px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 4px 10px rgba(31, 40, 60, 0.05);
  color: #20242b;
  font-size: 17px;
  font-weight: 700;
}

.flag {
  position: relative;
  display: block;
  width: 34px;
  height: 24px;
  overflow: hidden;
  border-radius: 4px;
  background: #e3312d;
}

.flag::before {
  content: "★";
  position: absolute;
  top: 2px;
  left: 5px;
  color: #ffe15a;
  font-size: 12px;
  line-height: 1;
}

.flag span,
.flag span::before,
.flag span::after {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #ffe15a;
}

.flag span {
  top: 5px;
  left: 17px;
}

.flag span::before,
.flag span::after {
  content: "";
  left: 5px;
}

.flag span::before {
  top: 5px;
}

.flag span::after {
  top: 12px;
}

.chevron {
  color: #656b76;
  font-size: 16px;
}

.mall-header h1 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 24px;
  font-weight: 900;
}

.search-zone {
  padding: 10px 24px 14px;
  background: var(--page);
}

.search-zone input {
  width: 100%;
  height: 48px;
  padding: 0 22px;
  border: 1px solid #d8dbe1;
  border-radius: 24px;
  outline: none;
  background: var(--panel);
  color: #22252c;
  font-size: 18px;
  box-shadow: inset 0 1px 2px rgba(23, 30, 45, 0.03);
}

.search-zone input::placeholder {
  color: #a0a4ad;
}

.search-zone input:focus {
  border-color: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(55, 157, 236, 0.13);
}

.category-strip {
  position: sticky;
  top: 108px;
  z-index: 10;
  display: flex;
  gap: 24px;
  overflow-x: auto;
  padding: 8px 18px 20px;
  background: var(--page);
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}

.category-strip[hidden] {
  display: none;
}

.category-strip-primary {
  padding-bottom: 14px;
}

.category-strip-secondary {
  top: 172px;
  gap: 18px;
  padding-top: 8px;
  padding-bottom: 14px;
  background: #f7f8fa;
}

.category-strip::-webkit-scrollbar {
  display: none;
}

.category-tab {
  position: relative;
  flex: 0 0 auto;
  min-width: 58px;
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: #5e6570;
  cursor: pointer;
  font-size: 19px;
  font-weight: 700;
}

.category-tab.is-active {
  color: var(--accent);
}

.category-tab.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 26px;
  height: 11px;
  border: solid var(--accent-soft);
  border-width: 0 0 5px 5px;
  border-radius: 0 0 0 18px;
  transform: translateX(-50%) rotate(-20deg);
}

.category-tab-secondary {
  min-width: 54px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 20px;
  font-size: 17px;
  font-weight: 700;
}

.category-tab-secondary.is-active {
  border-color: var(--accent-soft);
  background: #eaf5ff;
}

.category-tab-secondary.is-active::after {
  right: 10px;
  left: auto;
  bottom: -5px;
  width: 14px;
  height: 8px;
  transform: rotate(-20deg);
}

.catalog-body {
  padding: 20px 12px 72px;
}

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

.product-card {
  min-width: 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.product-card:active {
  transform: scale(0.985);
  box-shadow: 0 4px 14px rgba(30, 38, 55, 0.13);
}

.product-image-frame {
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 10px;
  background: #fafafa;
}

.product-image-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #f4f5f7;
}

.product-info {
  padding: 14px 10px 12px;
}

.product-info h2 {
  min-height: 28px;
  margin: 0 0 20px;
  overflow: hidden;
  color: #31363e;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 700;
}

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
}

.product-meta strong {
  min-width: 0;
  overflow: hidden;
  color: var(--price);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: clamp(15px, 4.4vw, 20px);
  font-weight: 900;
}

.add-button {
  display: grid;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, #4aa5fb, #237fe4);
  box-shadow: 0 7px 14px rgba(35, 126, 228, 0.32);
  color: white;
  cursor: pointer;
  font-size: 26px;
  font-weight: 400;
  line-height: 1;
}

.empty-state {
  margin: 42px 0;
  color: var(--muted);
  text-align: center;
  font-size: 16px;
}

.detail-root[hidden] {
  display: none;
}

.detail-root {
  min-height: calc(100vh - 108px);
  background: #ffffff;
}

.detail-page {
  min-height: calc(100vh - 108px);
  padding: 46px 24px 34px;
  background: #ffffff;
}

.detail-toolbar {
  position: relative;
  display: grid;
  grid-template-columns: 64px 1fr 64px;
  align-items: center;
  min-height: 62px;
}

.detail-toolbar h2 {
  grid-column: 2;
  margin: 0;
  text-align: center;
  color: #1f242c;
  font-size: 24px;
  font-weight: 900;
}

.detail-home {
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #eaf5ff;
  box-shadow: 0 8px 18px rgba(40, 139, 225, 0.16);
  color: #288eea;
  cursor: pointer;
  font-size: 40px;
  line-height: 1;
}

.detail-home span {
  transform: translateY(-2px);
}

.consult-button {
  display: block;
  width: min(100%, 312px);
  height: 50px;
  margin: 28px auto 38px;
  border: 0;
  border-radius: 25px;
  background: #e6f3ff;
  box-shadow: 0 8px 18px rgba(29, 115, 191, 0.1);
  color: #2b8fe6;
  cursor: pointer;
  font-size: 21px;
  font-weight: 700;
}

.detail-copy {
  margin: 0 0 34px;
}

.detail-copy h1 {
  margin: 0 0 24px;
  color: #1f242c;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.35;
}

.description-lines {
  display: grid;
  gap: 11px;
  color: #666d77;
  font-size: 21px;
  line-height: 1.42;
}

.description-lines p {
  margin: 0;
  overflow-wrap: anywhere;
}

.detail-media-frame {
  position: relative;
  display: grid;
  min-height: 420px;
  place-items: center;
  margin: 0 -2px 26px;
  padding: 46px 28px 50px;
  border-radius: 4px;
  background: #ffffff;
}

.detail-media-frame::before,
.detail-media-frame::after {
  content: "";
  position: absolute;
  right: 0;
  left: 0;
  height: 104px;
  border-radius: 4px;
  background: #fafafa;
  box-shadow: inset 0 0 0 1px #f5f5f5;
}

.detail-media-frame::before {
  top: 0;
}

.detail-media-frame::after {
  bottom: 0;
}

.detail-image {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  background: transparent;
}

.detail-dots {
  position: absolute;
  top: 50%;
  right: 12px;
  z-index: 2;
  display: grid;
  gap: 11px;
  transform: translateY(-50%);
}

.detail-dots span {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 5px rgba(32, 43, 60, 0.24);
}

.detail-dots .is-active {
  height: 44px;
  background: #2f91ea;
  box-shadow: 0 3px 8px rgba(47, 145, 234, 0.28);
}

.scroll-hint {
  margin: 0;
  color: #9ba0a8;
  text-align: center;
  font-size: 18px;
  line-height: 1.5;
}

@media (max-width: 380px) {
  .mall-header {
    grid-template-columns: 112px 1fr 112px;
    padding-inline: 14px;
  }

  .language-pill {
    width: 110px;
    font-size: 15px;
  }

  .product-grid {
    gap: 10px 8px;
  }

  .product-info {
    padding: 12px 9px;
  }

  .add-button {
    flex-basis: 34px;
    width: 34px;
    height: 34px;
  }
}
