:root {
  --accent: #95ac56;
  --accent-deep: #799b58;
  --ink: #1b1b1b;
  --muted: #8b8b8b;
  --line: #ececec;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: #eae8e2;
  font-family: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 16px 16px 26px;
}

.device {
  position: relative;
  width: 393px;
  height: 852px;
  flex: 0 0 auto;
  background: #fff;
  border-radius: 26px;
  box-shadow: 0 18px 50px rgba(37, 42, 30, 0.22), 0 0 0 8px #1d1f1c, 0 0 0 9px #3a3d36;
  overflow: hidden;
}

.viewport {
  position: absolute;
  inset: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.viewport::-webkit-scrollbar { width: 0; height: 0; }

.screen {
  position: relative;
  width: 393px;
  min-height: 852px;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center top;
  overflow: hidden;
}

.screen > .n { position: absolute; }
.n { box-sizing: border-box; }
.n svg { display: block; overflow: visible; pointer-events: none; }
.n.t { overflow: visible; }

/* clickable affordance */
.n[data-hit="1"] { cursor: pointer; }

/* bottom tab bar */
.nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 60px;
  z-index: 60;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.05);
  transition: transform 0.18s ease;
}
.nav[hidden] { display: none; }
.nav .n { position: absolute; }

/* toast */
.toast {
  position: absolute;
  left: 50%;
  bottom: 96px;
  transform: translate(-50%, 12px);
  z-index: 200;
  max-width: 300px;
  padding: 9px 18px;
  border-radius: 20px;
  background: rgba(24, 26, 22, 0.86);
  color: #fff;
  font-size: 13px;
  line-height: 18px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.dim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.35); z-index: 150; }
.dim[hidden] { display: none; }

/* back hit area */
.back-hit {
  position: absolute;
  left: 4px;
  top: 40px;
  width: 56px;
  height: 48px;
  z-index: 40;
  cursor: pointer;
  border: 0;
  background: transparent;
}

/* banner carousel */
.banner { touch-action: pan-y; }
.banner-track { display: flex; width: 100%; height: 100%; transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1); }
.banner-slide { flex: 0 0 100%; height: 100%; background-size: cover; background-position: center; }
.banner-dots { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; justify-content: center; gap: 5px; }
.banner-dots i { width: 5px; height: 5px; border-radius: 50%; background: rgba(255, 255, 255, 0.55); }
.banner-dots i.on { background: #fff; width: 14px; border-radius: 3px; }

/* search overlay pieces */
.sx-input {
  position: absolute;
  border: 0;
  outline: 0;
  background: transparent;
  font-family: inherit;
  font-size: 14px;
  color: #1b1b1b;
  z-index: 20;
}
.sx-input::placeholder { color: #909090; }
.sx-panel {
  position: absolute;
  left: 15px;
  width: 363px;
  z-index: 18;
}
.sx-title { font-size: 15px; color: #1b1b1b; margin: 0 0 10px; font-weight: 500; display: flex; justify-content: space-between; align-items: center; }
.sx-title button { border: 0; background: transparent; color: #8b8b8b; font-size: 12px; font-family: inherit; padding: 2px 0; cursor: pointer; }
.sx-chips { display: flex; flex-wrap: wrap; gap: 9px; }
.sx-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 15px;
  background: #f1f1ee;
  color: #333;
  font-size: 13px;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}
.sx-chip i {
  font-style: normal;
  color: #9a9a9a;
  font-size: 14px;
  line-height: 1;
  padding: 0 1px;
}
.sx-results { display: flex; flex-direction: column; gap: 8px; }
.sx-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: 12px;
  padding: 9px 12px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.sx-item img { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; flex: 0 0 auto; background: #f2f2f2; }
.sx-item .tt { font-size: 14px; color: #1b1b1b; }
.sx-item .ss { font-size: 11px; color: #909090; margin-top: 2px; }
.sx-empty { color: #9a9a9a; font-size: 13px; padding: 14px 0; text-align: center; }

/* dynamic lists (favorites / cart) */
.dyn-list { display: block; }
.fav-row { position: relative; height: 137px; margin-bottom: 8px; }
.fav-row .im {
  position: absolute; left: 0; top: 0; width: 101px; height: 119px; border-radius: 16px;
  background-size: cover; background-position: center; background-color: #f2f2f2;
}
.fav-row .card {
  position: absolute; left: 101px; top: 0; width: 261px; height: 119px; border-radius: 16px;
  background: #fff; padding: 14px 12px 12px;
}
.fav-row .tt { font-size: 15px; line-height: 18px; color: #1b1b1b; height: 36px; overflow: hidden; }
.fav-row .pr { font-size: 12px; color: #1b1b1b; margin-top: 8px; }
.fav-row .lk { font-size: 12px; color: #4d6b3a; margin-top: 6px; display: inline-block; }
.fav-row .st {
  position: absolute; right: 10px; top: 75%; transform: translateY(-50%); width: 26px; height: 26px; cursor: pointer;
  display: grid; place-items: center;
}
.fav-row .st svg { width: 15px; height: 15px; }
.empty-box { padding: 40px 0; text-align: center; color: #9a9a9a; font-size: 13px; }

.cart-row { position: relative; height: 131px; margin-bottom: 8px; }
.cart-row .im {
  position: absolute; left: 0; top: 0; width: 101px; height: 119px; border-radius: 16px;
  background-size: cover; background-position: center; background-color: #f2f2f2;
}
.cart-row .card {
  position: absolute; left: 101px; top: 0; width: 260px; height: 119px; border-radius: 16px;
  background: #fff; padding: 12px 12px 10px;
}
.cart-row .tt { font-size: 13px; line-height: 17px; color: #1b1b1b; height: 34px; overflow: hidden; padding-right: 34px; }
.cart-row .pr { font-size: 14px; color: #b25b3a; margin-top: 4px; font-weight: 500; }
.cart-row .qty { position: absolute; right: 10px; bottom: 10px; display: flex; align-items: center; gap: 8px; }
.cart-row .qty button {
  width: 22px; height: 22px; border-radius: 50%; border: 0; background: #f0f0f0;
  color: #4c4c4c; font-size: 15px; line-height: 1; font-family: inherit; cursor: pointer;
}
.cart-row .qty span { min-width: 16px; text-align: center; font-size: 13px; }
.cart-row .del {
  position: absolute; right: 8px; top: 8px; width: 22px; height: 22px; border: 0; background: transparent;
  color: #b0b0b0; font-size: 16px; line-height: 1; font-family: inherit; cursor: pointer;
}

.cart-bar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 58px; z-index: 55;
  background: rgba(255, 255, 255, 0.97); box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.06);
  display: flex; align-items: center; justify-content: space-between; padding: 0 16px;
}
.cart-bar .sum { font-size: 13px; color: #4c4c4c; }
.cart-bar .sum b { color: #b25b3a; font-size: 17px; margin-left: 4px; }
.cart-bar .go {
  border: 0; border-radius: 20px; height: 38px; padding: 0 26px;
  background: var(--accent); color: #fff; font-size: 15px; font-family: inherit; cursor: pointer;
}

/* detail page floating add-to-cart */
.fab {
  position: absolute; right: 16px; bottom: 22px; z-index: 56;
  width: 46px; height: 46px; border-radius: 50%; border: 0;
  background: var(--accent); color: #fff; font-size: 26px; line-height: 1;
  box-shadow: 0 6px 16px rgba(95, 122, 60, 0.35); cursor: pointer;
  display: grid; place-items: center; padding-bottom: 2px;
  font-family: inherit;
}
.fab:active { transform: scale(0.94); }

/* cart badge on mall cart icon */
.cart-badge {
  position: absolute; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px;
  background: #c4533a; color: #fff; font-size: 10px; line-height: 15px; text-align: center;
  z-index: 30; pointer-events: none;
}

/* caption under device */
.hint {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  color: #6d6d68; font-size: 12px;
}
.hint b { color: #2f332b; font-size: 14px; font-weight: 600; }
.hint button {
  border: 1px solid #cfcfc8; background: #fff; color: #4f5348; border-radius: 14px;
  padding: 6px 14px; font-size: 12px; font-family: inherit; cursor: pointer;
}
@media (max-width: 900px) {
  .hint { display: none; }
}

/* 内容详情页浮动收藏星 */
.star-float {
  position: absolute;
  right: 16px;
  top: 48px;
  width: 28px;
  height: 28px;
  z-index: 30;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.star-float svg { display: block; }
/* 扩大星标点击热区 */
[data-fav-key]::after {
  content: "";
  position: absolute;
  left: -10px;
  right: -10px;
  top: -10px;
  bottom: -10px;
}

/* 导航四等分点击热区 */
.nav-hit {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 25%;
  z-index: 70;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}
.nav-hit:nth-child(1) { left: 0; }
.nav-hit:nth-child(2) { left: 25%; }
.nav-hit:nth-child(3) { left: 50%; }
.nav-hit:nth-child(4) { left: 75%; }
/* 截图模式：1:1 画布，无外框与阴影 */
body.shot .stage { padding: 0; }
body.shot .hint { display: none !important; }
body.shot .device { border-radius: 0; box-shadow: none; }
/* 手机窄屏：铺满屏幕，去掉外框与阴影 */
body.mobile .stage { padding: 0; gap: 0; }
body.mobile .hint { display: none !important; }
body.mobile .device { border-radius: 0; box-shadow: none; }
body.mobile, body.mobile .stage { background: #fff; }