﻿:root {
  color-scheme: light;
  --ink: #17241f;
  --muted: #68736e;
  --line: #e2e7e3;
  --paper: #ffffff;
  --canvas: #f4f6f4;
  --brand: #1f684d;
  --brand-deep: #194f3c;
  --accent: #d95d4b;
  --accent-soft: #fff0ed;
  --amber: #a56c18;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: #e8ece9;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: #e8ece9;
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  color: inherit;
}

button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

img,
video {
  display: block;
  max-width: 100%;
}

.mobile-app {
  position: relative;
  width: min(100%, 640px);
  min-height: 100dvh;
  margin: 0 auto;
  overflow-x: clip;
  background: var(--canvas);
  box-shadow: 0 0 0 1px rgba(23, 36, 31, 0.04);
}

.store-hero {
  position: relative;
  height: 278px;
  padding: calc(14px + var(--safe-top)) 16px 18px;
  overflow: hidden;
  color: #fff;
  background-color: #dcefe3;
  background-position: 68% center;
  background-size: cover;
}

.store-hero::after {
  position: absolute;
  inset: 0;
  z-index: 0;
  content: "";
  background: rgba(15, 35, 27, 0.18);
  pointer-events: none;
}

.hero-top,
.store-identity {
  position: relative;
  z-index: 1;
}

.hero-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 10px;
  align-items: center;
}

.search-box {
  display: flex;
  min-width: 0;
  height: 44px;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  color: #38443f;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 22px;
}

.search-box svg {
  width: 20px;
  flex: 0 0 20px;
}

.search-box input {
  width: 100%;
  min-width: 0;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
}

.search-box input::placeholder {
  color: #76817c;
}

.icon-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  padding: 0;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(23, 36, 31, 0.08);
  border-radius: 50%;
  cursor: pointer;
}

.icon-button svg {
  width: 22px;
  height: 22px;
}

.hero-top .icon-button {
  color: #fff;
  background: rgba(25, 46, 37, 0.68);
  border-color: rgba(255, 255, 255, 0.2);
}

.store-identity {
  position: absolute;
  right: 16px;
  bottom: 18px;
  left: 16px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
}

.store-logo {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
}

.store-identity h1 {
  margin: 0 0 4px;
  font-size: 25px;
  line-height: 1.18;
}

.store-identity p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.store-notice {
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  color: #4c5b54;
  font-size: 13px;
  background: #edf4ef;
  border-bottom: 1px solid #dfe7e1;
}

.store-notice svg {
  width: 16px;
  color: var(--brand);
}

.store-tabs {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  height: 56px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.tab-button,
.sort-button {
  position: relative;
  padding: 0 8px;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.tab-button {
  font-size: 17px;
  font-weight: 600;
}

.tab-button.active {
  color: var(--ink);
  font-weight: 800;
}

.tab-button.active::after {
  position: absolute;
  bottom: 7px;
  left: 50%;
  width: 26px;
  height: 3px;
  content: "";
  background: var(--accent);
  border-radius: 2px;
  transform: translateX(-50%);
}

.sort-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) 48px;
  height: 50px;
  padding: 0 10px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.sort-button {
  min-width: 0;
  font-size: 14px;
}

.sort-button.active {
  color: var(--accent);
  font-weight: 700;
}

.sort-bar .icon-button {
  width: 40px;
  height: 40px;
  margin: 5px 0;
  border: 0;
  border-radius: 6px;
}

.result-meta {
  padding: 12px 16px 0;
  color: var(--muted);
  font-size: 13px;
}

.product-list {
  display: grid;
  gap: 10px;
  padding: 12px 12px 28px;
}

.product-row {
  display: grid;
  grid-template-columns: clamp(128px, 38vw, 182px) minmax(0, 1fr);
  min-width: 0;
  min-height: 168px;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid #e7ebe8;
  border-radius: 8px;
  cursor: pointer;
}

.product-row:active {
  background: #fafbfa;
}

.product-thumb {
  width: 100%;
  height: 100%;
  min-height: 168px;
  object-fit: cover;
  background: #e8eee9;
}

.product-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 13px 13px 12px;
}

.product-title {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #17211d;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-rec {
  display: -webkit-box;
  margin: 7px 0 0;
  overflow: hidden;
  color: #8a6331;
  font-size: 12px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.tag-row {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.tag {
  max-width: 100%;
  padding: 3px 6px;
  overflow: hidden;
  color: #3b705c;
  font-size: 11px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
  background: #edf5f0;
  border: 1px solid #dcebe2;
  border-radius: 4px;
}

.price-line {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 7px;
  margin-top: auto;
  padding-top: 10px;
}

.price {
  color: #df493f;
  font-size: 23px;
  font-weight: 800;
  line-height: 1;
}

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

.original-price {
  color: #9da49f;
  font-size: 12px;
  text-decoration: line-through;
}

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

.product-grid .product-row {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.product-grid .product-thumb {
  min-height: 0;
  aspect-ratio: 1 / 1;
}

.product-grid .product-copy {
  min-height: 158px;
}

.product-grid .product-rec {
  display: none;
}

.product-grid .tag-row {
  flex-wrap: nowrap;
  overflow: hidden;
}

.category-layout {
  display: grid;
  grid-template-columns: clamp(88px, 24vw, 116px) minmax(0, 1fr);
  min-height: calc(100dvh - 56px);
  background: #fff;
}

.category-menu {
  background: #f0f2f1;
  border-right: 1px solid var(--line);
}

.category-menu button {
  position: relative;
  width: 100%;
  min-height: 62px;
  padding: 10px 7px;
  color: #6a746f;
  line-height: 1.3;
  background: transparent;
  border: 0;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.category-menu button.active {
  color: var(--ink);
  font-weight: 800;
  background: #fff;
}

.category-menu button.active::before {
  position: absolute;
  top: 20px;
  bottom: 20px;
  left: 0;
  width: 3px;
  content: "";
  background: var(--accent);
}

.category-products {
  min-width: 0;
  padding: 14px 10px 28px;
}

.category-title {
  margin: 0 4px 12px;
  font-size: 18px;
}

.category-products .product-list {
  gap: 12px;
  padding: 0;
}

.category-products .product-row {
  grid-template-columns: clamp(104px, 31vw, 148px) minmax(0, 1fr);
  min-height: 142px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}

.category-products .product-thumb {
  min-height: 132px;
  margin-bottom: 10px;
  border-radius: 6px;
}

.category-products .product-copy {
  min-width: 0;
  padding: 6px 4px 12px 10px;
}

.empty-state {
  display: grid;
  min-height: 280px;
  place-items: center;
  padding: 40px 24px;
  color: var(--muted);
  text-align: center;
}

.empty-state svg {
  width: 44px;
  height: 44px;
  margin-bottom: 12px;
  color: #9eaaa4;
}

.detail-page {
  min-height: 100dvh;
  padding-bottom: calc(84px + var(--safe-bottom));
  background: var(--canvas);
}

.media-stage {
  position: relative;
  overflow: hidden;
  background: #e9efea;
  aspect-ratio: 1 / 1;
}

.media-stage img,
.media-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-toolbar {
  position: absolute;
  top: calc(12px + var(--safe-top));
  right: 12px;
  left: 12px;
  z-index: 5;
  display: flex;
  justify-content: space-between;
}

.detail-toolbar .icon-button {
  color: #fff;
  background: rgba(20, 33, 28, 0.72);
  border-color: rgba(255, 255, 255, 0.14);
}

.media-dots {
  position: absolute;
  right: 0;
  bottom: 14px;
  left: 0;
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: 6px;
}

.media-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  background: rgba(255, 255, 255, 0.7);
  border: 0;
  border-radius: 50%;
}

.media-dot.active {
  width: 18px;
  background: var(--accent);
  border-radius: 4px;
}

.media-nav {
  position: absolute;
  top: 50%;
  display: grid;
  width: 38px;
  height: 52px;
  place-items: center;
  padding: 0;
  color: #fff;
  background: rgba(20, 33, 28, 0.45);
  border: 0;
  transform: translateY(-50%);
}

.media-nav.prev { left: 0; }
.media-nav.next { right: 0; }
.media-nav svg { width: 20px; }

.detail-summary,
.detail-section {
  margin-top: 10px;
  padding: 18px 16px;
  background: #fff;
  border-top: 1px solid #e8ece9;
  border-bottom: 1px solid #e8ece9;
}

.detail-price-row {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.detail-price-row .price {
  font-size: 31px;
}

.detail-summary h1 {
  margin: 13px 0 6px;
  font-size: 21px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.detail-subtitle {
  margin: 0;
  color: var(--amber);
  font-size: 14px;
  line-height: 1.5;
}

.detail-section h2 {
  margin: 0 0 15px;
  font-size: 19px;
}

.detail-copy {
  margin: 0;
  color: #4f5b55;
  font-size: 15px;
  line-height: 1.75;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.detail-image-stack {
  display: grid;
  gap: 10px;
  margin-top: 15px;
}

.detail-image-stack img {
  width: 100%;
  border-radius: 6px;
}

.section-head {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head h2 {
  margin: 0;
}

.section-head span {
  color: var(--muted);
  font-size: 13px;
}

.review-list {
  display: grid;
  gap: 0;
}

.review-card {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.review-card:first-child {
  padding-top: 0;
  border-top: 0;
}

.review-author {
  display: flex;
  align-items: center;
  gap: 9px;
}

.review-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  background: var(--brand);
  border-radius: 50%;
}

.review-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.review-name {
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
}

.review-date {
  margin-top: 2px;
  color: #9aa29e;
  font-size: 12px;
}

.review-text {
  margin: 12px 0 0;
  color: #39443f;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.review-images {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 10px;
}

.review-images button {
  padding: 0;
  overflow: hidden;
  background: #eef1ef;
  border: 0;
  border-radius: 6px;
  aspect-ratio: 1 / 1;
}

.review-images img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.recommend-item {
  min-width: 0;
  padding: 0;
  overflow: hidden;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
}

.recommend-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.recommend-item > strong,
.recommend-item > .recommend-price {
  display: block;
  margin: 9px 10px 0;
}

.recommend-item > strong {
  min-height: 42px;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.45;
}

.recommend-item > .recommend-price {
  margin-bottom: 11px;
  color: #df493f;
  font-size: 18px;
  font-weight: 800;
}

.buy-dock {
  position: fixed;
  right: 50%;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  width: min(100%, 640px);
  min-height: calc(70px + var(--safe-bottom));
  padding: 8px 10px calc(8px + var(--safe-bottom));
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(23, 36, 31, 0.08);
  transform: translateX(50%);
  backdrop-filter: blur(12px);
}

.dock-home {
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 0;
  color: #34423c;
  font-size: 11px;
  background: transparent;
  border: 0;
}

.dock-home svg {
  width: 24px;
  height: 24px;
}

.buy-button,
.primary-action {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  font-weight: 800;
  background: var(--accent);
  border: 0;
  border-radius: 7px;
  cursor: pointer;
}

.buy-button {
  flex-direction: column;
  line-height: 1.15;
}

.buy-button .buy-price {
  font-size: 18px;
}

.buy-button .buy-label {
  font-size: 13px;
}

.buy-button:disabled {
  color: #f4f5f4;
  background: #9da59f;
  cursor: not-allowed;
}

.modal-layer[hidden],
.toast[hidden] {
  display: none;
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: end center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  background: rgba(13, 23, 19, 0.55);
  border: 0;
}

.buy-sheet {
  position: relative;
  z-index: 1;
  width: min(100%, 640px);
  max-height: 82dvh;
  padding: 20px 18px calc(18px + var(--safe-bottom));
  overflow-y: auto;
  background: #fff;
  border-radius: 8px 8px 0 0;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.sheet-head h2 {
  margin: 3px 0 0;
  font-size: 22px;
}

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

.sheet-close {
  background: #f1f3f2;
  border: 0;
}

.taobao-text {
  min-height: 148px;
  margin-top: 18px;
  padding: 16px;
  overflow: auto;
  color: #24312b;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Microsoft YaHei", monospace;
  font-size: 15px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #f3f6f4;
  border: 1px dashed #b9c6bf;
  border-radius: 6px;
}

.sheet-hint {
  margin: 12px 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.primary-action {
  width: 100%;
  min-height: 50px;
}

.primary-action svg {
  width: 19px;
}

.toast {
  position: fixed;
  bottom: calc(94px + var(--safe-bottom));
  left: 50%;
  z-index: 120;
  max-width: min(80vw, 360px);
  padding: 11px 16px;
  color: #fff;
  font-size: 14px;
  text-align: center;
  background: rgba(20, 32, 27, 0.9);
  border-radius: 6px;
  transform: translateX(-50%);
}

.expired-page {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: 28px;
  text-align: center;
}

.expired-page svg {
  width: 52px;
  height: 52px;
  color: #94a099;
}

.expired-page h1 {
  margin: 18px 0 7px;
  font-size: 23px;
}

.expired-page p {
  margin: 0 0 22px;
  color: var(--muted);
}

.secondary-action {
  min-height: 44px;
  padding: 0 20px;
  color: #fff;
  font-weight: 700;
  background: var(--brand);
  border: 0;
  border-radius: 6px;
}

@media (max-width: 370px) {
  .store-hero {
    height: 250px;
    padding-right: 12px;
    padding-left: 12px;
  }

  .store-identity {
    right: 12px;
    left: 12px;
  }

  .product-list {
    padding-right: 8px;
    padding-left: 8px;
  }

  .product-row {
    grid-template-columns: 120px minmax(0, 1fr);
  }

  .product-copy {
    padding: 10px;
  }

  .product-title {
    font-size: 14px;
  }

  .price {
    font-size: 20px;
  }

  .category-products {
    padding-right: 7px;
    padding-left: 7px;
  }

  .category-products .product-row {
    grid-template-columns: 98px minmax(0, 1fr);
  }

  .category-products .product-rec,
  .category-products .tag-row {
    display: none;
  }
}

@media (min-width: 641px) {
  .mobile-app {
    min-height: 100vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
