/* ?? � ??????? */
:root {
  --bg: #faf8f5;
  --bg-card: #ffffff;
  --bg-elevated: #fff;
  --text: #2c2420;
  --text-muted: #7a6f68;
  --text-light: #a89e96;
  --accent: #e8724a;
  --accent-dark: #d05a32;
  --accent-soft: #fdeee8;
  --green: #5b8c5a;
  --green-soft: #edf5ed;
  --blue: #4a90a4;
  --blue-soft: #e8f3f6;
  --brown: #8b7355;
  --brown-soft: #f3efe9;
  --purple: #9b6b9e;
  --purple-soft: #f5eef5;
  --border: #ebe4dc;
  --shadow: 0 2px 12px rgba(44, 36, 32, 0.06);
  --shadow-lg: 0 8px 32px rgba(44, 36, 32, 0.1);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --topbar-h: 56px;
  --tabbar-h: 64px;
  --font: "Noto Sans SC", "DM Sans", system-ui, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  overscroll-behavior: none;
}

.app {
  height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

/* Topbar — 固定在壳顶，不随内容滚动 */
.topbar {
  position: relative;
  flex-shrink: 0;
  z-index: 100;
  padding-top: env(safe-area-inset-top, 0px);
  background: rgba(250, 248, 245, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  height: var(--topbar-h);
  padding: 0 12px;
  gap: 8px;
}

.topbar-back,
.topbar-action {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--text);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.topbar-back svg,
.topbar-action svg { width: 22px; height: 22px; }

.topbar-back:active,
.topbar-action:active { background: var(--border); }

.topbar-brand {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.topbar--channel .brand-icon { display: none; }
.topbar--channel .brand-name {
  font-size: 17px;
  font-weight: 700;
}

.topbar-search-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.topbar-search-field[hidden] { display: none !important; }
.topbar-search-field svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.topbar-search-field input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  outline: none;
}
.topbar-search-field input::placeholder { color: var(--text-light); }
.topbar--home-search .topbar-inner {
  gap: 0;
}
.topbar--home-search .topbar-search-field {
  flex: 1;
  width: 100%;
  max-width: none;
}

.topbar--home-immersive {
  background: transparent;
  border-bottom: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.topbar--home-immersive .topbar-inner {
  display: none;
  height: 0;
}

.topbar--profile .topbar-inner {
  gap: 2px;
}
.topbar--profile .topbar-brand {
  flex: 1;
}
.topbar--profile .topbar-action {
  width: 40px;
}

.brand-icon { font-size: 22px; }

.brand-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.topbar-back[hidden],
.topbar-action[hidden],
.topbar-brand[hidden] { display: none !important; }

/* Main — 唯一滚动区 */
.main {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 8px);
}

/* 全屏搜索：盖住 main / tabbar，避免透出首页与商城 */
html.is-searching .main,
html.is-searching .tabbar,
html.is-searching .pdp-bar {
  visibility: hidden !important;
  pointer-events: none !important;
}
html.is-searching .topbar {
  visibility: hidden !important;
  pointer-events: none !important;
}

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  padding-top: env(safe-area-inset-top, 0px);
}
.search-overlay[hidden] { display: none !important; }

.search-overlay-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  height: var(--topbar-h);
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.search-overlay-back {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.search-overlay-back svg { width: 22px; height: 22px; }
.search-overlay-back:active { background: var(--border); }

.search-overlay-field {
  flex: 1;
  min-width: 0;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  color: var(--text-muted);
}
.search-overlay-field svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.search-overlay-field input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  outline: none;
}
.search-overlay-field input::placeholder { color: var(--text-light); }

.search-clear {
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  padding: 0;
}
.search-clear[hidden] { display: none !important; }

.search-submit {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 8px 4px 8px 2px;
  cursor: pointer;
}

.search-overlay-body {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}

.search-pane {
  padding: 16px;
}
.search-pane[hidden] { display: none !important; }
.search-pane--results {
  padding-top: 8px;
}

.search-section {
  margin-bottom: 22px;
}
.search-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.search-section-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.search-section-head h3 .muted-ico {
  opacity: 0.7;
  font-size: 13px;
}
.search-section-action {
  border: none;
  background: transparent;
  color: var(--text-light);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 4px;
}

.search-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.search-tag {
  border: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 12px;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}
.search-tag:active { background: var(--accent-soft); border-color: var(--accent); }
.search-tag--hot {
  position: relative;
}
.search-tag--hot::after {
  content: "热";
  margin-left: 4px;
  font-size: 10px;
  color: #e04b4b;
  font-weight: 700;
}

.search-discover-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
}
.search-discover-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: transparent;
  padding: 6px 0;
  text-align: left;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}
.search-discover-item .badge {
  font-size: 10px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 4px;
  padding: 1px 4px;
  flex-shrink: 0;
}

.search-hot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.search-hot-card {
  border: none;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  text-align: center;
  font: inherit;
  cursor: pointer;
  border: 1px solid var(--border);
}
.search-hot-card .rank {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
}
.search-hot-card .emoji { font-size: 22px; line-height: 1.2; }
.search-hot-card .title {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text);
  line-height: 1.3;
}

.search-suggest-query {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: none;
  background: transparent;
  padding: 12px 4px;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.search-suggest-query strong { color: var(--accent); font-weight: 600; }

.search-hit {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 12px;
  border: none;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  cursor: pointer;
  font: inherit;
  border: 1px solid transparent;
}
.search-hit:active { border-color: var(--border); }
.search-hit strong { display: block; font-size: 14px; color: var(--text); }
.search-hit span { font-size: 12px; color: var(--text-muted); }

.search-result-toolbar {
  margin-bottom: 8px;
}
.search-result-toolbar .filter-chips {
  margin-bottom: 8px;
}

html.is-pdp .main {
  padding-bottom: calc(76px + max(var(--safe-bottom), 28px) + 16px);
}

html.is-stack:not(.is-pdp) .main {
  padding-bottom: calc(20px + max(var(--safe-bottom), 16px));
}

html.is-stack .cart-footer,
html.is-stack .checkout-footer {
  bottom: calc(8px + max(var(--safe-bottom), 12px));
}

html.is-stack .toast {
  bottom: calc(24px + max(var(--safe-bottom), 16px));
}

.view {
  padding: 16px;
  animation: fadeIn 0.25s ease;
}

.view[hidden] { display: none !important; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ?? Hero ?? */
.hero {
  padding: 8px 4px 20px;
}

.hero-eyebrow {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hero-title {
  margin: 0 0 10px;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.hero-desc {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ?? Quick grid ?? */
.home-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
  padding: 4px;
  border-radius: 14px;
  background: var(--bg-card);
  box-shadow: var(--shadow);
}
.home-mode {
  border: none;
  border-radius: 10px;
  padding: 12px;
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.home-mode.is-active {
  background: var(--accent);
  color: #fff;
}
.pet-hub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}
.form-card .is-invalid,
.form-card input.is-invalid,
.form-card select.is-invalid,
.form-card textarea.is-invalid {
  border-color: #c44 !important;
  box-shadow: 0 0 0 2px rgba(204, 68, 68, 0.15);
}
#btnExpandCats {
  margin: -8px 0 18px;
}
.pin-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}
.pin-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 4px;
  border: none;
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow);
  cursor: pointer;
  font: inherit;
}
.pin-item:active { transform: scale(0.97); }
.pin-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 20px;
}
.pin-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  line-height: 1.2;
}

.home-shortcut-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 8px 0 22px;
}
.home-shortcut {
  border: none;
  border-radius: 999px;
  padding: 10px 6px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-card);
  box-shadow: var(--shadow);
  color: var(--text);
  cursor: pointer;
}
.home-shortcut:active { transform: scale(0.97); }

.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}
.quick-grid--compact {
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 20px;
}
.quick-item--compact {
  padding: 12px 4px;
}
.quick-item--compact .quick-icon {
  width: 40px;
  height: 40px;
  font-size: 18px;
}
.quick-item--compact .quick-label {
  font-size: 11px;
  text-align: center;
  line-height: 1.25;
}
.quick-item--compact .quick-desc { display: none; }

.service-cat-hub {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.service-hub-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: none;
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.menu-group-title {
  padding: 14px 4px 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.menu-group-title--clickable {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.menu-group-title--clickable::-webkit-details-marker { display: none; }
.menu-group-title--clickable::after {
  content: "??";
  font-weight: 500;
  font-size: 11px;
}
.menu-admin[open] > .menu-group-title--clickable::after { content: "??"; }
.menu-admin {
  border-top: 1px solid var(--border, #ebe4dc);
  border-bottom: 1px solid var(--border, #ebe4dc);
  margin: 4px 0;
}

.quick-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px;
  border: none;
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow);
  cursor: pointer;
  font: inherit;
  transition: transform 0.15s;
}

.quick-item:active { transform: scale(0.97); }

.quick-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.quick-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.quick-desc {
  font-size: 11px;
  color: var(--text-light);
}

@media (min-width: 420px) {
  .quick-grid:not(.quick-grid--compact) { grid-template-columns: repeat(4, 1fr); }
}

/* ?? Section head ?? */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.section-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.link-btn {
  border: none;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
}

/* ?? Cards scroll ?? */
.card-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 24px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.card-scroll::-webkit-scrollbar { display: none; }

.service-card {
  flex: 0 0 240px;
  scroll-snap-align: start;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  border: none;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: transform 0.15s;
}

.service-card:active { transform: scale(0.98); }

.service-card-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 8px;
}

.service-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
}

.service-card p {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.service-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

.service-card-meta .price {
  font-weight: 700;
  color: var(--accent);
}

.service-card-meta .rating {
  color: var(--text-muted);
  font-size: 12px;
}

/* ?? Trust bar ?? */
.trust-bar {
  display: flex;
  justify-content: space-around;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-top: 8px;
}

.trust-item {
  text-align: center;
}

.trust-item strong {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
}

.trust-item span {
  font-size: 12px;
  color: var(--text-muted);
}

/* ?? Filter chips ?? */
.filter-chips,
.community-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  scrollbar-width: none;
  margin-bottom: 4px;
}

.filter-chips::-webkit-scrollbar,
.community-tabs::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-card);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}

.chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* ?? Service list ?? */
.service-list { display: flex; flex-direction: column; gap: 10px; }

.list-item {
  display: flex;
  gap: 14px;
  padding: 14px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: none;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  width: 100%;
  transition: transform 0.15s;
}

.list-item:active { transform: scale(0.99); }

.list-item-body { flex: 1; min-width: 0; }

.list-item-body h3 {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
}

.list-item-body p {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.list-item-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-light);
}

.list-item-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  flex-shrink: 0;
}

.list-item-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
}

.list-item-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 4px;
}

/* ?? Module banners ?? */
.module-banner {
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  margin-bottom: 20px;
  color: #fff;
}

.module-banner h2 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 700;
}

.module-banner p {
  margin: 0;
  font-size: 14px;
  opacity: 0.9;
}

.module-banner--funeral { background: linear-gradient(135deg, #8b7355, #6b5344); }
.module-banner--transport { background: linear-gradient(135deg, #4a90a4, #3a7080); }
.module-banner--pharmacy { background: linear-gradient(135deg, #5b8c5a, #4a7049); }
.module-banner--shop { background: linear-gradient(135deg, #e8724a, #d05a32); }

/* ?? Info cards ?? */
.info-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.info-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}

.info-card-icon { font-size: 24px; margin-bottom: 6px; }
.info-card h4 { margin: 0 0 4px; font-size: 14px; font-weight: 700; }
.info-card p { margin: 0; font-size: 12px; color: var(--text-muted); line-height: 1.4; }

/* ?? Packages ?? */
.package-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }

.package-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  border: 2px solid transparent;
  position: relative;
}

.package-card.is-hot {
  border-color: var(--accent);
}

.package-badge {
  position: absolute;
  top: -1px;
  right: 16px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 0 0 8px 8px;
}

.package-card h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
}

.package-price {
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
}

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

.package-items {
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.package-items li {
  font-size: 13px;
  color: var(--text-muted);
  padding: 3px 0;
  padding-left: 16px;
  position: relative;
}

.package-items li::before {
  content: "?";
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 700;
  font-size: 12px;
}

/* ?? Product grid ?? */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 10px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.product-card-media {
  position: relative;
  margin: -10px -10px 8px;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  background: var(--brown-soft, #f3efe9);
  min-height: 110px;
  display: grid;
  place-items: center;
}
.product-card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(44, 36, 32, 0.78);
  color: #fff;
}
.product-card-badge.hot { background: #c45a3a; }
.product-trust {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 2px 0 4px;
}
.product-trust span {
  font-size: 10px;
  color: var(--green, #5b8c5a);
  background: var(--green-soft, #edf5ed);
  border-radius: 4px;
  padding: 1px 5px;
}

.topbar--stack .brand-icon { display: none; }

.product-card:active { transform: scale(0.98); }

.product-emoji {
  width: 100%;
  aspect-ratio: 1;
  background: var(--bg);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  margin-bottom: 10px;
}

.product-card h4 {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card .price {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
}

.product-card .rx-badge {
  display: inline-block;
  font-size: 10px;
  background: #fde8e8;
  color: #c44;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  margin-left: 4px;
}

.product-card .sales {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 2px;
}

/* ?? Quote form ?? */
.quote-form {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quote-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.quote-form input,
.quote-form select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--bg);
  outline: none;
}

.quote-form input:focus,
.quote-form select:focus { border-color: var(--accent); }

.quote-result {
  background: var(--green-soft);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.6;
}

.quote-result strong { color: var(--green); font-size: 20px; }

/* ?? Alert ?? */
.alert {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.5;
}

.alert-info {
  background: var(--blue-soft);
  color: #3a6070;
}

.alert strong { display: block; margin-bottom: 2px; }

/* ?? Vet list ?? */
.vet-list { display: flex; flex-direction: column; gap: 10px; }

.vet-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: none;
  text-align: left;
  font: inherit;
  cursor: pointer;
  width: 100%;
}

.vet-avatar { font-size: 36px; }

.vet-info { flex: 1; }
.vet-info h4 { margin: 0; font-size: 15px; font-weight: 700; }
.vet-info p { margin: 2px 0 0; font-size: 12px; color: var(--text-muted); }

.vet-status {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}

.vet-status.online { background: var(--green-soft); color: var(--green); }
.vet-status.offline { background: #f0eeec; color: var(--text-light); }

.vet-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
}

/* ?? Posts ?? */
.post-list { display: flex; flex-direction: column; gap: 10px; }

.post-list.compact .post-card { padding: 12px 14px; }

.post-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  border: none;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  width: 100%;
  transition: transform 0.15s;
}

.post-card:active { transform: scale(0.99); }

.post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.post-avatar { font-size: 28px; }

.post-author {
  font-size: 13px;
  font-weight: 600;
}

.post-time {
  font-size: 11px;
  color: var(--text-light);
}

.post-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}

.post-card p {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-footer {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-light);
}

/* ?? FAB ?? */
.fab {
  position: fixed;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px);
  right: max(16px, calc(50% - 240px + 16px));
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  z-index: 50;
  transition: transform 0.15s;
}

.fab:active { transform: scale(0.95); }

/* ?? Profile ?? */
.profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}

.profile-info { flex: 1; min-width: 0; }
.profile-info h2 { margin: 0; font-size: 18px; font-weight: 700; }
.profile-info p { margin: 4px 0 0; font-size: 13px; color: var(--text-muted); }

.pet-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.pet-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.pet-card-emoji { font-size: 32px; }
.pet-card-info h4 { margin: 0; font-size: 15px; font-weight: 700; }
.pet-card-info p { margin: 2px 0 0; font-size: 12px; color: var(--text-muted); }

.menu-list {
  margin-top: 20px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: none;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}

.menu-item:last-child { border-bottom: none; }
.menu-item:active { background: var(--bg); }

.menu-icon { font-size: 20px; width: 28px; text-align: center; }
.menu-label { flex: 1; font-size: 15px; font-weight: 500; }

.menu-badge {
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

.menu-arrow { width: 18px; height: 18px; color: var(--text-light); }

/* ?? Detail ?? */
.detail-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  box-shadow: var(--shadow);
}

.detail-content h2 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
}

.detail-content .detail-price {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 16px;
}

.detail-content .detail-desc {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 20px;
}

.detail-actions {
  display: flex;
  gap: 10px;
}

/* ?? Buttons ?? */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover { background: var(--accent-dark); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--accent);
  color: var(--accent);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-block { width: 100%; }

/* ?? Tabbar ?? */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  min-height: calc(var(--tabbar-h) + var(--safe-bottom));
  height: auto;
  padding-top: 6px;
  padding-bottom: max(var(--safe-bottom), 10px);
  display: flex;
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  z-index: 100;
  box-sizing: border-box;
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  border: none;
  background: none;
  color: var(--text-light);
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0 2px;
  transition: color 0.15s;
  overflow: visible;
  line-height: 1.2;
}

.tab svg {
  width: 22px;
  height: 22px;
  overflow: visible;
  flex-shrink: 0;
}

.tab span {
  display: block;
  line-height: 1.15;
  white-space: nowrap;
}

.tab.is-active { color: var(--accent); font-weight: 600; }

.tabbar[hidden] { display: none !important; }

/* 商品详情成交条：替换五个 Tab */
.pdp-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px 0;
  padding-bottom: max(28px, calc(var(--safe-bottom) + 14px));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  box-sizing: border-box;
}
.pdp-bar[hidden] { display: none !important; }
.pdp-bar-icon {
  flex: 0 0 auto;
  width: 44px;
  border: none;
  background: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 2px 0 4px;
  font: inherit;
  font-size: 10px;
  cursor: pointer;
}
.pdp-bar-icon svg { width: 22px; height: 22px; }
.pdp-bar-icon.is-active { color: var(--accent); }
.pdp-bar-cart,
.pdp-bar-buy {
  flex: 1;
  min-width: 0;
  height: 40px;
  border: none;
  border-radius: 20px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  margin-bottom: 2px;
}
.pdp-bar-cart {
  background: var(--accent-soft);
  color: var(--accent-dark);
}
.pdp-bar-buy {
  background: var(--accent);
  color: #fff;
}
.pdp-bar-cart:disabled,
.pdp-bar-buy:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

html.is-native .pdp-bar {
  max-width: none;
  left: 0;
  transform: none;
  /* Android WebView 常拿不到 inset，保底抬高避免手势条压住按钮 */
  padding-bottom: max(36px, calc(var(--safe-bottom) + 20px));
}

/* ?? Toast ?? */
.toast {
  position: fixed;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 20px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(44, 36, 32, 0.88);
  color: #fff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 200;
  max-width: 80%;
  text-align: center;
}

.toast.is-shown {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ?? Modal ?? */
.modal {
  border: none;
  border-radius: var(--radius-lg);
  padding: 0;
  max-width: 400px;
  width: calc(100% - 32px);
  box-shadow: var(--shadow-lg);
}

.modal::backdrop {
  background: rgba(44, 36, 32, 0.4);
}

.modal-inner {
  padding: 24px 20px;
}

.modal-inner h3 {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 700;
}

.modal-inner label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.modal-inner input,
.modal-inner select,
.modal-inner textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--bg);
  outline: none;
  resize: vertical;
}

.modal-inner input:focus,
.modal-inner select:focus,
.modal-inner textarea:focus { border-color: var(--accent); }

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}

/* ?? Desktop ?? */
@media (min-width: 481px) {
  .app {
    box-shadow: 0 0 0 1px var(--border), var(--shadow-lg);
    min-height: 100vh;
  }
}

/* ?? Mobile native / PWA ?? */
html.is-native {
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html.is-native input,
html.is-native textarea,
html.is-native select {
  user-select: text;
}

html.is-native .app,
html.is-native .tabbar {
  max-width: none;
}

html.is-native .tabbar {
  left: 0;
  transform: none;
  /* 灰条靠系统导航栏颜色解决，这里不额外垫高 */
  padding-bottom: max(var(--safe-bottom), 10px);
  min-height: calc(var(--tabbar-h) + max(var(--safe-bottom), 10px));
}

html.is-native .pdp-bar {
  padding-bottom: max(36px, calc(var(--safe-bottom) + 20px));
}

html.is-native .fab {
  right: 16px;
}

html.splash-active .app {
  visibility: hidden;
}

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 18vh 24px calc(10vh + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  gap: 0;
  background: #faf8f5;
  transition: opacity 0.28s ease, visibility 0.28s;
}

.splash-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1;
  justify-content: center;
}

/* 圆角放在包裹层：部分 Android WebView 对 img 自身 border-radius 裁剪失效 */
.splash-logo-wrap {
  width: 72px;
  height: 72px;
  margin: 0 0 16px;
  border-radius: 18px; /* 18/72 ≈ 25%，与 H5 启动比例一致 */
  overflow: hidden;
  background: transparent;
  animation: splash-rise 0.55s ease both;
}
.splash-logo {
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 0;
  object-fit: cover;
  background: transparent;
  display: block;
}

.splash-title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--accent);
  animation: splash-rise 0.55s ease 0.06s both;
}

.splash-tagline {
  margin: 12px 0 0;
  font-size: 14px;
  color: #666;
  letter-spacing: 0.14em;
  animation: splash-rise 0.55s ease 0.12s both;
}

.splash-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: 0;
  animation: splash-rise 0.55s ease 0.18s both;
}

.splash-foot-term {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--accent);
}

.splash-foot-tip {
  margin: 8px 0 0;
  font-size: 12px;
  color: #888;
  letter-spacing: 0.1em;
}

@keyframes splash-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.offline-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 300;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 16px 8px;
  font-size: 13px;
  text-align: center;
}
.offline-bar[hidden] { display: none !important; }

.modal-onboard { max-width: 360px; }
.onboard-inner { text-align: center; }
.onboard-slide { display: none; padding: 8px 0 16px; }
.onboard-slide.is-active { display: block; animation: fadeIn 0.3s ease; }
.onboard-icon { font-size: 56px; margin-bottom: 16px; }
.onboard-slide h3 { margin: 0 0 10px; font-size: 20px; font-weight: 700; }
.onboard-slide p { margin: 0; font-size: 14px; color: var(--text-muted); line-height: 1.65; }
.onboard-dots { display: flex; justify-content: center; gap: 8px; margin: 16px 0; }
.onboard-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); transition: background 0.2s, transform 0.2s; }
.onboard-dot.is-active { background: var(--accent); transform: scale(1.2); }
.detail-actions { flex-wrap: wrap; }
.detail-actions .btn { flex: 1; min-width: 90px; }

@media (prefers-reduced-motion: reduce) {
  .view { animation: none; }
}

/* ?? v1.1: orders / cart / chat / profile ?? */
.module-banner--emergency {
  background: linear-gradient(135deg, #c44, #a33);
}
.module-banner--market { background: linear-gradient(135deg, #c47a3a, #a05e28); }
.module-banner--vaccine { background: linear-gradient(135deg, #3d8b7a, #2d6b5c); }
.module-banner--boarding { background: linear-gradient(135deg, #6b8e4e, #557240); }
.module-banner--training { background: linear-gradient(135deg, #5a6fa8, #455888); }
.module-banner--breeding { background: linear-gradient(135deg, #b85c7a, #944860); }
.module-banner--insurance { background: linear-gradient(135deg, #4a7c9b, #386278); }
.module-banner--hotel { background: linear-gradient(135deg, #7a6b9e, #5e5280); }
.module-banner--grooming { background: linear-gradient(135deg, #d47a8a, #b85c6c); }
.module-banner--homewash { background: linear-gradient(135deg, #5a9ea8, #457e88); }
.module-banner--neuter { background: linear-gradient(135deg, #6a8f6b, #547454); }
.module-banner--lost { background: linear-gradient(135deg, #c45c3a, #a0482c); }
.module-banner--chip { background: linear-gradient(135deg, #5c6b7a, #45525e); }
.module-banner--claims { background: linear-gradient(135deg, #4a7c9b, #2f5a72); }
.module-banner--merchant { background: linear-gradient(135deg, #8b6b4a, #6e5438); }
.module-banner--photo { background: linear-gradient(135deg, #6b7a9e, #535f7c); }
.module-banner--member { background: linear-gradient(135deg, #c9a227, #a8841c); }
.module-banner--support { background: linear-gradient(135deg, #4a8a7a, #38685c); }
.module-banner--reviews { background: linear-gradient(135deg, #e08a4a, #c06e35); }
.module-banner--clinic { background: linear-gradient(135deg, #4d8b6e, #3a6e56); }
.module-banner--license { background: linear-gradient(135deg, #6d7a8b, #556070); }
.module-banner--quarantine { background: linear-gradient(135deg, #5a7a9e, #446080); }
.module-banner--walk { background: linear-gradient(135deg, #7a9e5a, #5e7c44); }
.module-banner--events { background: linear-gradient(135deg, #c47a6b, #a05e52); }
.module-banner--iot { background: linear-gradient(135deg, #5a8aa8, #446c88); }
.module-banner--adopt { background: linear-gradient(135deg, #d4895a, #b36e42); }
.module-banner--friendly { background: linear-gradient(135deg, #5a9e8a, #447a6a); }
.module-banner--health { background: linear-gradient(135deg, #6b8f9e, #527280); }
.module-banner--dna { background: linear-gradient(135deg, #7a6b9e, #5e5280); }
.module-banner--rehab { background: linear-gradient(135deg, #4a8a9e, #386e80); }
.module-banner--nutrition { background: linear-gradient(135deg, #6b9e5a, #527c44); }
.module-banner--ambulance { background: linear-gradient(135deg, #c45a5a, #a04444); }
.module-banner--memorial { background: linear-gradient(135deg, #8b7a6b, #6e6156); }
.module-banner--exotic { background: linear-gradient(135deg, #5a8b6b, #446e54); }
.module-banner--policy { background: linear-gradient(135deg, #6b6b7a, #545460); }
.module-banner--finder { background: linear-gradient(135deg, #9e6b4a, #805436); }

.memorial-words {
  font-style: italic;
  line-height: 1.6;
  color: var(--text-muted);
}

.member-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  margin-bottom: 16px;
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow);
}
.member-label { margin: 0; font-size: 13px; color: var(--text-muted); }
.member-hero strong { font-size: 32px; color: var(--accent); }

.chat-bubble small {
  display: block;
  margin-top: 4px;
  opacity: 0.65;
  font-size: 11px;
}

.form-card textarea {
  padding: 12px 14px;
  border: 1px solid var(--border, #e8e2da);
  border-radius: 10px;
  font: inherit;
  background: var(--bg, #faf8f5);
  color: var(--text);
  resize: vertical;
  min-height: 72px;
}

.form-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.form-card h3 { margin: 0 0 4px; font-size: 16px; }
.form-card label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}
.form-card input,
.form-card select {
  padding: 12px 14px;
  border: 1px solid var(--border, #e8e2da);
  border-radius: 10px;
  font: inherit;
  background: var(--bg, #faf8f5);
  color: var(--text);
}
.form-card input:focus,
.form-card select:focus { outline: none; border-color: var(--accent); }

.package-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 6px;
}
.package-top strong { color: var(--accent); white-space: nowrap; }
.pkg-items {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 13px;
}
.product-emoji { font-size: 36px; margin-bottom: 8px; }
.product-meta { font-size: 12px; color: var(--text-muted); margin: 4px 0 8px; }
.product-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
}
.product-card h3 { margin: 0; font-size: 15px; }
.cert-card .cert-qr {
  margin-top: 12px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #eee;
  color: #111;
  font-weight: 700;
  letter-spacing: 0.12em;
  border: 1px dashed #bbb;
}

@media (min-width: 420px) {
  .quick-grid:not(.quick-grid--compact) { grid-template-columns: repeat(4, 1fr); }
}

.btn-lg {
  padding: 16px 20px;
  font-size: 16px;
}

.empty-hint {
  text-align: center;
  color: var(--text-muted);
  padding: 32px 16px;
  font-size: 14px;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.stat-pill {
  border: none;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 12px 4px;
  text-align: center;
  font: inherit;
  cursor: pointer;
}

.stat-pill strong {
  display: block;
  font-size: 18px;
  color: var(--accent);
}

.stat-pill span {
  font-size: 11px;
  color: var(--text-muted);
}

.order-list,
.consult-list,
.cart-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.order-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}

.order-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 12px;
}

.order-type { color: var(--text-muted); }

.order-status {
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
}

.status-processing,
.status-shipping { background: var(--blue-soft); color: var(--blue); }
.status-done { background: var(--green-soft); color: var(--green); }
.status-cancelled { background: #f0eeec; color: var(--text-light); }
.status-unpaid { background: #fff0e8; color: var(--accent); }

/* 结算/购买弹层：地址卡片（参考主流电商） */
.checkout-addr-card { padding: 0; overflow: hidden; }
.addr-pick-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 14px;
  border: none;
  background: transparent;
  text-align: left;
  font: inherit;
  cursor: pointer;
  box-sizing: border-box;
}
.addr-pick-card.is-empty .addr-pick-body strong { color: var(--accent); }
.addr-pick-icon {
  flex-shrink: 0;
  font-size: 20px;
  line-height: 1;
  opacity: 0.75;
}
.addr-pick-body {
  flex: 1;
  min-width: 0;
}
.addr-pick-body strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.addr-pick-body span {
  display: block;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}
.addr-pick-chevron {
  flex-shrink: 0;
  font-size: 22px;
  color: var(--text-light);
  line-height: 1;
}
.addr-card.is-selected {
  border: 1px solid var(--accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}

.order-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}

.order-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.order-meta strong { color: var(--accent); font-size: 15px; }

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

.consult-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border: none;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.consult-time {
  font-size: 11px;
  color: var(--text-light);
  flex-shrink: 0;
}

.chat-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

.chat-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.chat-msgs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 280px;
  max-height: 50vh;
  overflow-y: auto;
  padding: 8px 4px 16px;
}

.chat-bubble {
  max-width: 80%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
}

.chat-bubble.vet {
  align-self: flex-start;
  background: var(--bg-card);
  box-shadow: var(--shadow);
}

.chat-bubble.me {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
}

.chat-input-bar {
  position: sticky;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 8px);
  display: flex;
  gap: 8px;
  padding: 10px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.chat-input-bar input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font: inherit;
  outline: none;
  background: var(--bg);
}

.chat-input-bar input:focus { border-color: var(--accent); }

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.cart-emoji { font-size: 32px; }
.cart-info { flex: 1; min-width: 0; }
.cart-info h4 { margin: 0 0 4px; font-size: 14px; }

.qty-ctrl {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty-ctrl button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  font-size: 16px;
  cursor: pointer;
}

.cart-footer {
  position: sticky;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 8px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.cart-total strong {
  color: var(--accent);
  font-size: 20px;
}

.fav-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-card-btn {
  border: none;
  background: none;
  padding: 0;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  width: 100%;
}

.about-card {
  text-align: center;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  box-shadow: var(--shadow);
}

.about-logo { font-size: 56px; margin-bottom: 8px; }
.about-card h2 { margin: 0 0 4px; font-size: 24px; }
.about-ver { margin: 0 0 16px; color: var(--text-muted); font-size: 13px; }
.about-desc { margin: 0 0 20px; color: var(--text-muted); line-height: 1.6; font-size: 14px; }

.about-list {
  text-align: left;
  margin: 0;
  padding: 0 0 0 18px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.8;
}

.form-note {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--text-light);
}

.view[data-view="chat"] {
  display: flex;
  flex-direction: column;
  min-height: calc(100dvh - var(--topbar-h) - var(--tabbar-h) - 40px);
}

.view[data-view="chat"][hidden] {
  display: none !important;
}

/* ?? v1.2 sync / track / pay ?? */
.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #bbb;
  flex-shrink: 0;
}

.sync-dot.is-online { background: #5b8c5a; box-shadow: 0 0 0 3px #5b8c5a33; }
.sync-dot.is-offline { background: #c9a227; }

.track-bar {
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
  margin: 8px 0;
}

.track-bar.big { height: 10px; margin: 12px 0 20px; }

.track-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #f0a080);
  border-radius: 99px;
}

.track-card { text-align: left; font: inherit; color: inherit; width: 100%; cursor: pointer; border: none; }

.track-nodes {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
}

.track-nodes li {
  display: flex;
  gap: 12px;
  padding: 0 0 18px;
  position: relative;
}

.track-nodes li:not(:last-child)::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 16px;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.track-nodes li.is-done:not(:last-child)::before { background: var(--accent); }

.node-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
  margin-top: 2px;
  z-index: 1;
}

.track-nodes li.is-done .node-dot {
  border-color: var(--accent);
  background: var(--accent);
}

.node-time {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
}

.track-list { display: flex; flex-direction: column; gap: 10px; }

/* ?? v1.3 rx / comments / legal ?? */
.rx-upload-box { margin-bottom: 14px; }
.rx-file-label { cursor: pointer; }
.rx-thumb {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin: 8px 0;
  background: var(--bg);
}

.comment-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.comment-item {
  display: flex;
  gap: 10px;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}
.comment-item p { margin: 4px 0; font-size: 14px; line-height: 1.5; color: var(--text); }

.comment-form {
  display: flex;
  gap: 8px;
  position: sticky;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 8px);
  padding: 10px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.comment-form input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font: inherit;
  outline: none;
  background: var(--bg);
}
.comment-form input:focus { border-color: var(--accent); }

.legal-body {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow);
  line-height: 1.7;
  font-size: 14px;
  color: var(--text-muted);
}
.legal-body h2 { margin: 0 0 8px; color: var(--text); font-size: 22px; }
.legal-body h3 { margin: 18px 0 8px; color: var(--text); font-size: 16px; }
.legal-body ul { padding-left: 18px; margin: 0; }
.legal-body li { margin-bottom: 6px; }

/* ?? v1.4 sms / cashier ?? */
.code-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.code-row input { flex: 1; }
.code-row .btn { flex-shrink: 0; white-space: nowrap; }

.pay-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  box-shadow: var(--shadow);
  text-align: center;
}

.pay-badge {
  display: inline-block;
  margin: 0 0 12px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.pay-channels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 18px 0;
}

.pay-channel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.pay-channel.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.pay-ch-icon { font-size: 28px; }

.pay-status {
  margin: 12px 0 16px;
  padding: 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.pay-spinner {
  width: 28px;
  height: 28px;
  margin: 0 auto 8px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ?? v1.5 inbox / address / post image ?? */
.msg-list { display: flex; flex-direction: column; gap: 8px; }
.msg-item {
  width: 100%;
  text-align: left;
  border: none;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.msg-item.is-unread { border-left: 3px solid var(--accent); }
.msg-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--text-light);
}
.msg-top strong { color: var(--text); font-size: 14px; }
.msg-item p { margin: 0; font-size: 13px; color: var(--text-muted); line-height: 1.5; }

.post-card-img,
.post-img-preview {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin: 8px 0;
  background: var(--bg);
}

.check-row {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
}






/* ???? 2.3 ops / a11y / timeline ???? */
.home-recent-row { margin: 0 0 16px; }
.home-recent-label {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.order-timeline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--border, #e8e4de);
}
.order-timeline--cancel { color: var(--text-muted); font-size: 12px; }
.ot-step {
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--bg, #f5f2ec);
  color: var(--text-muted);
}
.ot-step.is-done { background: #e6f4ea; color: #1a7f37; font-weight: 600; }
.ot-step.is-current { background: var(--accent); color: #fff; font-weight: 700; }
.ot-sep {
  width: 10px;
  height: 2px;
  background: #ddd;
  flex-shrink: 0;
}
.order-card--focus {
  outline: 2px solid var(--accent);
  box-shadow: 0 0 0 4px rgba(232, 120, 80, 0.15);
}
.settings-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}
.settings-card h3 { margin: 0 0 12px; font-size: 15px; }
.error-log {
  margin-top: 10px;
  max-height: 220px;
  overflow: auto;
  font-size: 11px;
  background: var(--bg);
  padding: 10px;
  border-radius: 8px;
}
.compliance-banner {
  margin-bottom: 12px;
  font-size: 13px;
}
.compliance-banner--strict {
  border-left: 3px solid #c44;
  background: #fff5f5;
}
.offline-queue-hint {
  text-align: center;
  font-size: 12px;
  padding: 6px 12px;
  background: #fff8e6;
  color: #8a5a00;
}
html.a11y-large {
  font-size: 112%;
}
html.a11y-large .pin-label,
html.a11y-large .quick-label,
html.a11y-large .menu-label { font-size: 1.05em; }
html.a11y-contrast {
  --text: #0a0a0a;
  --text-muted: #333;
  --bg: #fff;
  --bg-card: #fff;
  --accent: #0b5fff;
}
html.a11y-contrast .btn-primary { background: #0b5fff; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* ???? 2.4 theme / skeleton / order detail / empty ???? */
html.theme-dark,
html[data-theme="dark"] {
  --bg: #1a1614;
  --bg-card: #2a2420;
  --bg-elevated: #322b26;
  --text: #f3ebe4;
  --text-muted: #b5a89e;
  --text-light: #8a7d74;
  --accent: #f08a62;
  --accent-dark: #e8724a;
  --accent-soft: #3d2a22;
  --border: #3d342e;
  --shadow: 0 2px 12px rgba(0,0,0,0.35);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.45);
  --green-soft: #1e2e1e;
  --blue-soft: #1a2a30;
  --brown-soft: #2e2822;
  --purple-soft: #2c2230;
}
html.theme-dark .topbar,
html[data-theme="dark"] .topbar {
  background: rgba(26, 22, 20, 0.92);
}
html.theme-dark .tabbar,
html[data-theme="dark"] .tabbar {
  background: rgba(26, 22, 20, 0.96);
}
html.build-review [data-demo] { display: none !important; }

.home-skeleton { margin-bottom: 16px; }
.sk-row, .sk-line, .sk-card {
  background: linear-gradient(90deg, var(--border), var(--bg-card), var(--border));
  background-size: 200% 100%;
  animation: sk 1.2s ease-in-out infinite;
  border-radius: 12px;
}
.sk-pins { height: 88px; margin-bottom: 12px; }
.sk-grid { height: 120px; margin-bottom: 12px; }
.sk-line { height: 16px; width: 40%; margin-bottom: 10px; }
.sk-card { height: 100px; }
@keyframes sk {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .sk-row, .sk-line, .sk-card { animation: none; }
}

.empty-state {
  text-align: center;
  padding: 36px 20px;
}
.empty-illus {
  font-size: 48px;
  line-height: 1;
  margin-bottom: 12px;
  filter: grayscale(0.2);
}
.empty-state h3 { margin: 0 0 8px; font-size: 17px; }
.empty-state p { margin: 0 0 16px; color: var(--text-muted); font-size: 14px; }

.order-detail-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.od-timeline {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  border-left: 2px solid var(--border);
}
.od-timeline li {
  position: relative;
  padding: 0 0 14px 16px;
  color: var(--text-muted);
  font-size: 13px;
}
.od-timeline li::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border);
}
.od-timeline li.is-done { color: var(--text); font-weight: 600; }
.od-timeline li.is-done::before { background: var(--accent); }

.field-error {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #c44;
}

/* ???? 2.5 maps / a11y ???? */
.geo-map-host, .geo-map { margin: 0 0 14px; }
.geo-map svg { display: block; border-radius: 12px; color: var(--text-muted); }
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 8px 12px;
  z-index: 9999;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ???? 2.6 UI/UX ???? */
html.ux26 {
  --fs-title: 1.25rem;
  --fs-body: 0.95rem;
  --fs-meta: 0.78rem;
  --tap-min: 44px;
}
html.ux26 h2, html.ux26 .hero-title { font-size: var(--fs-title); }
html.ux26 .menu-label, html.ux26 .order-card h3 { font-size: var(--fs-body); }
html.ux26 .form-note, html.ux26 .order-meta, html.ux26 .empty-hint { font-size: var(--fs-meta); }
html.ux26 .menu-item,
html.ux26 .chip,
html.ux26 .home-shortcut,
html.ux26 .btn {
  min-height: var(--tap-min);
}
html.ux26 .chip { padding: 10px 14px; }

.menu-section {
  margin: 0 0 8px;
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.menu-section > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  margin: 0;
}
.menu-section > summary::-webkit-details-marker { display: none; }
.menu-section .menu-item {
  border-radius: 0;
  box-shadow: none;
  border-top: 1px solid var(--border);
}

.goal-grid {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.goal-card {
  text-align: left;
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 14px;
  padding: 14px 16px;
  font: inherit;
  cursor: pointer;
  display: grid;
  gap: 4px;
}
.goal-card strong { font-size: 15px; color: var(--text); }
.goal-card span { font-size: 12px; color: var(--text-muted); }
.goal-card:active { transform: scale(0.98); border-color: var(--accent); }

.book-steps-host { margin-bottom: 12px; }
.book-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-card);
  box-shadow: var(--shadow);
  font-size: 12px;
}
.book-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
}
.book-step i {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--border);
  font-style: normal;
  font-size: 11px;
}
.book-step.is-current { color: var(--text); font-weight: 700; }
.book-step.is-current i,
.book-step.is-done i { background: var(--accent); color: #fff; }
.book-step-sep {
  flex: 1;
  height: 2px;
  background: var(--border);
  max-width: 28px;
}

.list-skeleton .sk-list-item {
  height: 88px;
  margin-bottom: 10px;
  border-radius: 12px;
}
.empty-hint--card {
  background: var(--bg-card);
  box-shadow: var(--shadow);
  border-radius: 14px;
  padding: 20px 16px;
  text-align: center;
}

.order-sticky-bar {
  position: sticky;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 8px);
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr;
  gap: 8px;
  padding: 10px;
  margin-top: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 20;
}
#viewOrderDetail .order-detail-scroll { padding-bottom: 8px; }

.emergency-focus .module-banner--urgent {
  background: linear-gradient(135deg, #b42318, #e5483b);
  color: #fff;
  border-radius: 16px;
  padding: 20px 16px;
  box-shadow: none;
}
.urgent-kicker {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: 0.04em;
  opacity: 0.9;
}
.btn-urgent {
  background: #b42318 !important;
  border-color: #b42318 !important;
  font-size: 16px !important;
  min-height: 52px;
}

.offline-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  padding: 8px 12px;
}
.offline-bar--warn { background: #fff1f0; color: #a61d24; }
.offline-bar--info { background: #fff8e6; color: #8a5a00; }

.ux-pulse {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.35s ease;
  background: radial-gradient(circle at 50% 40%, rgba(232,114,74,0.18), transparent 55%);
}
.ux-pulse--err {
  background: radial-gradient(circle at 50% 40%, rgba(196,68,68,0.16), transparent 55%);
}
.ux-pulse.is-on { opacity: 1; }

html.theme-dark .topbar,
html[data-theme="dark"] .topbar {
  border-bottom-color: #4a4038;
  background: rgba(22, 18, 16, 0.94);
}
html.theme-dark .bg-card,
html.theme-dark .menu-section,
html.theme-dark .order-card,
html.theme-dark .settings-card,
html[data-theme="dark"] .menu-section,
html[data-theme="dark"] .order-card {
  border: 1px solid var(--border);
}
html.theme-dark .tabbar,
html[data-theme="dark"] .tabbar {
  border-top: 1px solid var(--border);
}

@media (prefers-reduced-motion: reduce) {
  .ux-pulse { display: none; }
  .goal-card:active { transform: none; }
}

/* ???? home cleanup ???? */
.hero--compact {
  padding: 12px 4px 8px;
  margin-bottom: 8px;
}
.hero--compact .hero-title {
  font-size: 1.6rem;
  line-height: 1.25;
  margin: 0 0 4px;
}
.hero--compact .hero-desc {
  margin: 0;
  font-size: 13px;
}
.home-pet-chip {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: none;
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 8px;
  background: var(--bg-card);
  box-shadow: var(--shadow);
  font: inherit;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.home-pet-chip span { color: var(--text-muted); font-size: 13px; }
#homePetHub { display: grid; gap: 0; }

/* offline bar visual hierarchy */
.offline-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 300;
  padding: calc(env(safe-area-inset-top, 0px) + 6px) 12px 6px;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  border-bottom: 1px solid transparent;
}
.offline-bar--soft {
  background: #f3f0ec;
  color: #6b635c;
  border-bottom-color: var(--border);
}
.offline-bar--warn {
  background: #f8ecea;
  color: #8a3b32;
  border-bottom-color: #efd2cc;
}
.offline-bar--info { /* legacy */
  background: #f3f0ec;
  color: #6b635c;
}
.offline-bar-action {
  margin-left: 6px;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.home-lede {
  margin: 0 0 14px;
  font-size: 12px;
  color: var(--text-light);
  letter-spacing: 0.02em;
}

.home-mode-tabs {
  margin-bottom: 8px;
  box-shadow: none;
  border: 1px solid var(--border);
  background: transparent;
}
.home-mode {
  font-weight: 600;
}
.home-mode.is-active {
  background: var(--text);
  color: #fff;
}

.home-block { margin-bottom: 8px; }
.home-block--primary {
  margin-bottom: 22px;
}
.home-block--primary .pin-grid {
  gap: 8px;
  margin-bottom: 0;
}
.home-block--primary .pin-item {
  padding: 14px 4px 12px;
  box-shadow: 0 4px 16px rgba(44, 36, 32, 0.08);
  border: 1px solid transparent;
}
.home-block--primary .pin-icon {
  width: 46px;
  height: 46px;
  font-size: 22px;
  border-radius: 14px;
}
.home-block--primary .pin-label {
  font-size: 12px;
  font-weight: 700;
}

.home-block--secondary {
  margin-bottom: 18px;
  padding: 12px 10px 4px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--border);
}
html.theme-dark .home-block--secondary,
html[data-theme="dark"] .home-block--secondary {
  background: rgba(42, 36, 32, 0.55);
}
.home-block--secondary .section-head {
  margin-bottom: 6px;
  padding: 0 2px;
}
.home-block--secondary .section-head h2 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.home-block--secondary .filter-chips {
  padding-bottom: 8px;
  margin-bottom: 0;
}
.home-block--secondary .chip {
  background: transparent;
  border: 1px solid var(--border);
  box-shadow: none;
  font-weight: 500;
  color: var(--text-muted);
}
.home-block--secondary .chip.is-active {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent-dark);
  font-weight: 700;
}
.home-block--secondary .quick-item,
.home-block--secondary .quick-item--compact {
  background: transparent;
  box-shadow: none;
  border: none;
  padding: 8px 2px;
}
.home-block--secondary .quick-icon {
  width: 36px;
  height: 36px;
  font-size: 16px;
  background: var(--bg) !important;
  border-radius: 10px;
}
.home-block--secondary .quick-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
}
#btnExpandCats {
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.home-block--tertiary {
  margin: 4px 0 20px;
}
.home-block--tertiary .home-shortcut-row {
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 2px 0;
  background: transparent;
  box-shadow: none;
}
.home-block--tertiary .home-shortcut {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  border-right: 1px solid var(--border);
  padding: 12px 4px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}
.home-block--tertiary .home-shortcut:last-child { border-right: none; }
.home-block--tertiary .home-shortcut:active {
  color: var(--text);
  background: var(--bg-card);
}

.link-btn--quiet {
  color: var(--text-light);
  font-weight: 500;
}
.link-btn--quiet:active { color: var(--text-muted); }

.view-home .section-head h2 {
  font-size: 15px;
  font-weight: 700;
}
.view-home .trust-bar {
  box-shadow: none;
  border: 1px solid var(--border);
  background: transparent;
  margin-top: 20px;
}
.view-home .trust-item strong {
  color: var(--text);
  font-size: 16px;
}
.view-home .trust-item span {
  font-size: 11px;
}

html.theme-dark .home-mode.is-active,
html[data-theme="dark"] .home-mode.is-active {
  background: var(--accent);
}

/* Shop 2.7.1 — 排序为次级文字链，分类保持胶囊 */
.sort-chips { margin-top: -4px; margin-bottom: 8px; }
.sort-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 2px 2px 12px;
  margin-bottom: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.sort-row::-webkit-scrollbar { display: none; }
.sort-link {
  flex-shrink: 0;
  border: none;
  background: none;
  padding: 4px 0;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
}
.sort-link.is-active {
  color: var(--accent);
  font-weight: 700;
}
.product-card.is-soldout { opacity: 0.55; }
.product-card .stock-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: #9aa3af;
  vertical-align: middle;
}
.product-card .stock-badge.stock-low { background: #d97706; }
.product-cover {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 8px;
  background: var(--bg-muted, #f0ebe4);
}
.product-card.is-featured .product-cover {
  box-shadow: inset 0 0 0 2px rgba(232, 114, 74, 0.35);
}
.pdp-hero { font-size: 64px; text-align: center; margin-bottom: 12px; }
.pdp-cover {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 16px;
  margin: 0 auto;
  display: block;
}
.home-page-hero {
  padding: 4px 4px 14px;
}
.home-page-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.home-page-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.home-page-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}
.home-page-search {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-light);
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}
.home-page-search svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-muted);
}
.home-page-search:active {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.home-hero-focus {
  padding: 4px 0 12px;
  margin-bottom: 4px;
}
.home-focus-ctas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.home-focus-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 14px 14px;
  border: none;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow, 0 2px 10px rgba(42, 36, 31, 0.06));
  text-align: left;
  cursor: pointer;
}
.home-focus-cta strong { font-size: 16px; color: var(--accent, #e8724a); }
.home-focus-cta span { font-size: 12px; color: var(--text-muted); }
.home-focus-cta:active { transform: scale(0.98); }
.offline-bar .link-btn {
  margin-left: 8px;
  color: inherit;
  text-decoration: underline;
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
}
.variant-row { margin: 12px 0 16px; }
.variant-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.variant-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pdp-specs {
  margin: 8px 0 16px;
  padding: 12px 14px 12px 28px;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 13px;
  color: var(--text);
}
.pdp-specs li { margin: 4px 0; }
.cart-toolbar {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 10px;
  padding: 0 2px;
}
.cart-check { display: flex; align-items: center; }
.cart-item.is-dim { opacity: 0.55; }
.cart-item .rx-badge { margin-left: 4px; font-size: 10px; }
.checkout-body { padding-bottom: 88px; }
.checkout-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 12px;
}
.checkout-card h3 { margin: 0 0 10px; font-size: 15px; }
.checkout-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  font-size: 14px;
}
.checkout-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  padding: 6px 0;
}
.checkout-pay { font-size: 15px; margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--border); }
.checkout-footer { bottom: calc(var(--safe-bottom) + 8px); }

/* 立即购买 / 加购规格弹层 */
.buy-sheet {
  position: fixed;
  inset: auto 0 0 0;
  width: 100%;
  max-width: 100%;
  max-height: 88vh;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  overflow: visible;
  z-index: 300;
}
.buy-sheet::backdrop {
  background: rgba(20, 18, 16, 0.48);
}
.buy-sheet-panel {
  position: relative;
  background: var(--bg-card);
  border-radius: 18px 18px 0 0;
  padding: 18px 16px 0;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.12);
  box-sizing: border-box;
}
.buy-sheet-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--bg);
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 1;
}
.buy-sheet-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding-right: 40px;
  margin-bottom: 14px;
  flex-shrink: 0;
}
.buy-sheet-emoji {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  flex-shrink: 0;
  overflow: hidden;
}
.buy-sheet-emoji img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.buy-sheet-meta h3 {
  margin: 0 0 6px;
  font-size: 16px;
  line-height: 1.3;
}
.buy-sheet-meta .detail-price {
  margin: 0;
  font-size: 20px;
}
.buy-sheet-meta .form-note { margin: 4px 0 0; }
.buy-sheet-body {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}
.buy-sheet-section {
  margin-bottom: 16px;
}
.buy-sheet-section > .variant-label {
  margin-bottom: 8px;
}
.buy-sheet-section .pay-channels {
  margin: 0;
}
.buy-sheet-section .pay-channel {
  padding: 12px 8px;
  flex-direction: row;
  gap: 8px;
}
.buy-sheet-section .pay-ch-icon { font-size: 20px; }
.buy-sheet-qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.buy-sheet-addr {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  font: inherit;
  cursor: pointer;
}
.buy-sheet-addr.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.buy-sheet-addr + .buy-sheet-addr { margin-top: 8px; }
.buy-sheet-addr strong { display: block; margin-bottom: 2px; font-size: 14px; }
.buy-sheet-addr span { font-size: 12px; color: var(--muted); }
.buy-sheet-foot {
  flex-shrink: 0;
  padding: 10px 0 calc(18px + max(var(--safe-bottom), 20px));
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}
html.is-native .buy-sheet-foot {
  padding-bottom: calc(22px + max(var(--safe-bottom), 28px));
}
.buy-sheet-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  font-size: 13px;
  color: var(--muted);
}
.buy-sheet-total strong {
  font-size: 18px;
  color: var(--accent);
}
.chip.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* 新增/编辑地址整页 */
.addr-edit-page {
  padding: 4px 0 24px;
}
.addr-edit-page label {
  display: block;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--muted);
}
.addr-edit-page input,
.addr-edit-page select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-card);
  font: inherit;
  font-size: 15px;
  box-sizing: border-box;
}
.addr-edit-page input:focus,
.addr-edit-page select:focus {
  border-color: var(--accent);
  outline: none;
}
.addr-edit-page .check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 18px;
  color: var(--text);
  font-size: 14px;
}
.addr-edit-page .check-row input {
  width: auto;
  margin: 0;
}
.addr-edit-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.addr-edit-actions .btn { flex: 1; }
