:root {
  --primary: #FFD6DE;
  --primary-dark: #F0A8B4;
  --primary-light: #FFE8EE;
  --primary-soft: #FFF0F3;
  --primary-pale: #FFF5F7;
  --primary-bg: #FFE8EE;
  --mint: #FFE8EE;
  --mint-soft: #FFF5F7;
  --cream: #FFF8F5;
  --accent: #FFC8D4;
  --bg-color: #FFF8F9;
  --surface: #FFFFFF;
  --text-color: #5C4548;
  --text-secondary: #8A6E72;
  --text-muted: #C4A8AC;
  --border-color: #F8E4E8;
  --shadow: 0 5px 16px rgba(240, 168, 180, 0.14);
  --shadow-soft: 0 3px 10px rgba(255, 214, 222, 0.35);
  --gradient-header: linear-gradient(160deg, #FFD6DE 0%, #FFE8EE 48%, #FFF5F7 100%);
  --gradient-banner: linear-gradient(90deg, #FFC8D4, #FFD6DE);
  --gradient-member: linear-gradient(135deg, #FFF5F7 0%, #FFE8EE 45%, #FFD6DE 100%);
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 7px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg-color);
  color: var(--text-color);
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(56px + var(--safe-bottom));
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ===== 首页 ===== */
.page { min-height: 100vh; padding-bottom: 24px; background: var(--bg-color); }

.hero-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--cream);
}
.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  background: var(--gradient-header);
}
.hero-content {
  position: relative;
  z-index: 2;
  padding: 14vh 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.brand-logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--gradient-header);
  display: block;
}
.qrcode {
  width: 180px;
  height: 180px;
  margin: 12px auto 0;
  display: block;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  padding: 8px;
}
.hero-fallback {
  width: 100%;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--gradient-header);
  color: var(--text-color);
  padding: 40px 20px 50px;
}
.hero-fallback .brand {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 2px;
}
.hero-fallback .sub {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}
.hero-mask {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 40px;
  background: linear-gradient(180deg, transparent, var(--bg-color));
  pointer-events: none;
}

.search-float {
  margin: 0;
}
.search-inner {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 10px 14px;
  box-shadow: var(--shadow-soft);
}
.search-inner .icon {
  font-size: 15px;
  color: var(--primary-dark);
  margin-right: 7px;
}
.search-inner input {
  flex: 1;
  border: 0;
  outline: none;
  font-size: 13px;
  background: transparent;
  color: var(--text-color);
}
.search-inner input::placeholder { color: var(--text-muted); }

.print-banner {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 11px 14px;
  background: var(--gradient-banner);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
}
.print-icon { font-size: 16px; margin-right: 7px; }
.print-text {
  flex: 1;
  font-size: 13px;
  color: var(--text-color);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.member-block {
  margin: 0;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  background: var(--gradient-member);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.member-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255,255,255,.55);
  color: var(--text-color);
  font-size: 10px;
  margin-bottom: 5px;
}
.member-title {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-color);
}
.member-desc {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}
.member-right { text-align: right; margin-left: 10px; flex-shrink: 0; }
.member-price {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-color);
}
.member-cta {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-secondary);
}

.hero-content .section-head {
  margin: 2px 0 0;
  margin-bottom: 0;
}

.latest-section {
  margin-top: 0;
  padding: 4px 14px 0;
}
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-color);
}
.section-more {
  font-size: 12px;
  color: var(--primary-dark);
}

.latest-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.latest-item {
  background: var(--surface);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-soft);
  padding-bottom: 8px;
  display: block;
  color: inherit;
}
.latest-thumb-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 120%;
  background: var(--primary-pale);
}
.latest-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.latest-tag {
  position: absolute;
  left: 6px;
  top: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(92, 69, 72, 0.48);
  color: #fff;
  font-size: 10px;
}
.latest-title {
  display: block;
  margin: 7px 8px 0;
  font-size: 12px;
  color: var(--text-color);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.latest-price {
  display: block;
  margin: 4px 8px 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-dark);
}

.empty-tip {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  padding: 40px 0;
}

/* ===== 底栏（对齐小程序 tabBar） ===== */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: #fff;
  border-top: 1px solid #f5e8eb;
  padding-bottom: var(--safe-bottom);
}
.tabbar a {
  text-align: center;
  padding: 8px 0 6px;
  color: #C4A8AC;
  font-size: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.tabbar a.active { color: #F0A8B4; font-weight: 600; }
.tabbar .ico { font-size: 18px; line-height: 1; }

/* ===== 分类页 ===== */
.cat-page {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-color);
  padding-bottom: calc(56px + var(--safe-bottom));
}
.top-tabs {
  display: flex;
  justify-content: center;
  gap: 40px;
  padding: 10px 0 4px;
  background: var(--surface);
}
.top-tab {
  position: relative;
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 500;
  padding-bottom: 7px;
  background: none;
  border: 0;
  cursor: pointer;
}
.top-tab.active { color: var(--text-color); font-weight: 700; }
.tab-underline {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 24px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
}
.orient-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 4px 14px 8px;
  background: var(--surface);
}
.orient-tab {
  padding: 5px 14px;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--primary-pale);
  border-radius: 999px;
  border: 0;
  cursor: pointer;
}
.orient-tab.active {
  background: var(--gradient-banner);
  color: var(--text-color);
  font-weight: 600;
  box-shadow: var(--shadow-soft);
}
.cat-search { padding: 6px 14px 8px; background: var(--surface); }
.cat-main { flex: 1; display: flex; overflow: hidden; min-height: 0; }
.sidebar {
  width: 84px;
  background: var(--primary-pale);
  overflow-y: auto;
  flex-shrink: 0;
}
.sidebar-item {
  padding: 16px 6px;
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  position: relative;
  border: 0;
  background: transparent;
  width: 100%;
  cursor: pointer;
}
.sidebar-item.active {
  background: var(--surface);
  color: var(--primary-dark);
  font-weight: 600;
}
.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  border-radius: 0 3px 3px 0;
  background: var(--primary);
}
.cat-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  overflow: hidden;
  min-width: 0;
}
.tag-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px;
  white-space: nowrap;
  scrollbar-width: none;
}
.tag-tabs::-webkit-scrollbar { display: none; }
.tag-tab {
  display: inline-block;
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 999px;
  background: var(--primary-pale);
  color: var(--text-secondary);
  border: 0;
  cursor: pointer;
  flex-shrink: 0;
}
.tag-tab.active {
  background: var(--primary-dark);
  color: #fff;
}
.grid-scroll { flex: 1; overflow-y: auto; padding: 0 8px 16px; }
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

/* ===== 详情 ===== */
.detail-page { padding-bottom: 80px; }
.preview-section {
  position: relative;
  background: var(--cream);
}
.preview-img { width: 100%; display: block; }
.preview-title-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 10px 14px;
  background: linear-gradient(180deg, transparent, rgba(92,69,72,.45));
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}
.info-section { padding: 16px 14px; }
.info-section .title {
  font-size: 18px;
  font-weight: 700;
  display: block;
}
.info-section .spec,
.info-section .notice {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}
.price-box { margin-top: 12px; }
.price-box .price {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-dark);
}
.variant-section { padding: 0 14px 8px; }
.section-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-color);
}
.variant-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 0;
}
.variant-item {
  width: 88px;
  flex-shrink: 0;
  text-align: center;
  border: 2px solid transparent;
  border-radius: 10px;
  padding: 4px;
  background: var(--surface);
}
.variant-item.active { border-color: var(--primary-dark); }
.variant-thumb {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 6px;
  background: var(--primary-pale);
}
.variant-name { font-size: 11px; color: var(--text-secondary); }
.bottom-buy {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  padding: 10px 14px calc(10px + var(--safe-bottom));
  background: #fff;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 10px;
  z-index: 30;
}
.btn-primary {
  flex: 1;
  border: 0;
  border-radius: 999px;
  padding: 12px;
  background: var(--gradient-banner);
  color: var(--text-color);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}
.btn-ghost {
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 12px 18px;
  background: #fff;
  color: var(--text-secondary);
  cursor: pointer;
}

/* ===== 设计 / 我的 ===== */
.section { padding: 16px 14px 0; }
.section-sub {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}
.style-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 12px;
}
.style-card {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-soft);
}
.style-icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: 8px;
}
.style-name { font-weight: 700; font-size: 14px; display: block; }
.style-desc { font-size: 11px; color: var(--text-secondary); margin-top: 4px; display: block; }
.contact-section, .user-header, .menu-list, .order-card, .share-entry, .member-entry {
  margin: 14px;
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-soft);
}
.ship-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.ship-mini-card {
  background: var(--surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 6px;
  box-shadow: var(--shadow-soft);
  text-align: center;
}
.ship-mini-card .ship-title {
  font-weight: 600;
  display: block;
  font-size: 13px;
  color: var(--text-color);
}
.ship-mini-card .ship-desc {
  font-size: 10px;
  color: var(--text-secondary);
  display: block;
  margin-top: 6px;
  line-height: 1.4;
}
.contact-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.qrcode-tip, .qrcode-note {
  display: block; text-align: center; margin-top: 8px;
  font-size: 12px; color: var(--text-secondary);
}
.user-row { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--gradient-header);
  object-fit: cover;
}
.nickname { font-size: 17px; font-weight: 700; display: block; }
.welcome { font-size: 12px; color: var(--text-secondary); }
.login-btn {
  margin-left: auto;
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  background: var(--gradient-banner);
  color: var(--text-color);
  font-weight: 600;
  cursor: pointer;
}
.login-btn.ghost { background: #fff; border: 1px solid var(--border-color); }
.menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-color);
  color: inherit;
}
.menu-item:last-child { border-bottom: 0; }
.order-card {
  display: flex;
  gap: 12px;
  align-items: center;
}
.order-card .grow { flex: 1; min-width: 0; }
.order-card .desc { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%);
  background: rgba(92, 69, 72, 0.9);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 99;
}

@media (min-width: 768px) {
  .page, .cat-page, .detail-page { max-width: 480px; margin: 0 auto; }
  .tabbar, .bottom-buy { max-width: 480px; left: 50%; transform: translateX(-50%); }
}
