:root {
  --bg-warm-white: #f8f5f0;
  --text-dark: #222222;
  --text-muted: #555555;
  --primary-orange: #ff7a28;
  --primary-orange-light: #ff9d5c;
  --card-bg: #ffffff;
  --border-soft: #e8e4dc;
  --accent-blue: #6b9bd1;
  --shadow-soft: 0 4px 14px rgba(0, 0, 0, 0.06);
  --radius-lg: 12px;
  --radius-pill: 50px;
  --font-base: 18px;
  --font-btn: 18px;
  --line-height: 1.65;
  --topnav-h: 56px;
  --content-max: 1200px;
}

:root.is-font-xl {
  --font-base: 20px;
  --font-btn: 20px;
  --line-height: 1.75;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: var(--font-base);
  overflow-x: hidden;
  max-width: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-warm-white);
  color: var(--text-dark);
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  line-height: var(--line-height);
  overflow-x: hidden;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  vertical-align: middle;
}

/* —— 顶部导航（电脑端） —— */
.site-topnav {
  position: sticky;
  top: 0;
  z-index: 300;
  height: var(--topnav-h);
  background: #fff;
  border-bottom: 1px solid var(--border-soft);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
}

.site-topnav__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-width: 0;
}

.site-brand {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary-orange);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: center;
  flex-wrap: wrap;
}

.site-nav a {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s;
}

.site-nav a:hover {
  background: rgba(255, 122, 40, 0.08);
  color: var(--primary-orange);
}

.site-nav a.is-active {
  color: var(--primary-orange);
  background: rgba(255, 122, 40, 0.12);
}

.site-topnav__user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1rem;
  white-space: nowrap;
  min-width: 0;
  flex-shrink: 1;
}

.site-topnav__role {
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid var(--primary-orange);
  color: var(--primary-orange);
}

.site-topnav__name {
  color: var(--text-dark);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-topnav__link {
  color: var(--text-muted);
}

.site-topnav__link:hover {
  color: var(--primary-orange);
}

.site-topnav__register {
  padding: 6px 14px;
  border-radius: 8px;
  background: linear-gradient(to bottom, var(--primary-orange-light), var(--primary-orange));
  color: #fff !important;
  font-weight: 600;
  font-size: 1rem;
}

.site-main {
  min-height: calc(100vh - var(--topnav-h));
  overflow-x: hidden;
  max-width: 100%;
}

.page-wrap {
  padding: 24px 32px 40px;
  max-width: var(--content-max);
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.page-wrap--narrow {
  max-width: 640px;
}

.login-role-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* 内页标题栏（电脑端） */
.page-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-soft);
}

.page-head__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: var(--text-muted);
  border: 1px solid var(--border-soft);
  background: #fff;
}

.page-head__back:hover {
  border-color: var(--primary-orange);
  color: var(--primary-orange);
}

.page-head__title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.page-head--solo {
  justify-content: flex-start;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
}

.app-header__title {
  flex: 1;
  text-align: left;
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0;
}

.app-header__back {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  color: var(--text-dark);
  background: #fff;
}

.app-header__placeholder {
  width: 40px;
  height: 40px;
}

.search-shell {
  background: var(--text-muted);
  border-radius: var(--radius-lg);
  padding: 8px 10px;
  margin-bottom: 24px;
  max-width: min(520px, 100%);
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
}

.search-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border-radius: var(--radius-pill);
  padding: 10px 16px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.search-inner > i {
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1;
}

.search-inner input {
  flex: 1 1 0;
  border: 0;
  font-size: 1rem;
  outline: none;
  background: transparent;
  min-height: 24px;
  min-width: 0;
  width: 0;
  max-width: 100%;
}

.search-inner input[type="search"] {
  -webkit-appearance: none;
  appearance: none;
}

.search-submit {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  min-height: 34px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  color: #fff;
  background: linear-gradient(to bottom, var(--primary-orange-light), var(--primary-orange));
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(255, 122, 40, 0.28);
}

.search-submit:hover {
  filter: brightness(0.98);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  min-width: 40px;
  padding: 10px 20px;
  border: 0;
  border-radius: 8px;
  font-size: var(--font-btn);
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(to bottom, var(--primary-orange-light), var(--primary-orange));
  box-shadow: var(--shadow-soft);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  background: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-dark);
}

.btn-ghost:hover {
  border-color: var(--primary-orange);
  color: var(--primary-orange);
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

@media (max-width: 900px) {
  .cat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.cat-pill {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: var(--radius-pill);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  background: linear-gradient(to bottom, var(--primary-orange-light), var(--primary-orange));
  box-shadow: var(--shadow-soft);
}

.cat-pill:hover {
  filter: brightness(1.03);
}

/* 商品网格（电脑端） */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  align-items: stretch;
}

.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}

.product-card:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.product-card__img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #eee;
}

.product-card__body {
  padding: 14px 16px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.product-card__title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.4;
}

.product-card__meta {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.card {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  margin-bottom: 0;
}

/* 列表行（购物车等） */
.product-row {
  display: flex;
  gap: 16px;
  padding: 16px;
  align-items: stretch;
}

.product-row__img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  flex-shrink: 0;
  background: #eee;
}

.product-row__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.product-row__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
}

.product-row__meta {
  font-size: 1rem;
  color: var(--text-muted);
}

.price {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary-orange);
}

/* 商品详情：双栏 */
.product-detail {
  display: grid;
  grid-template-columns: minmax(280px, 440px) 1fr;
  gap: 32px;
  align-items: start;
}

@media (max-width: 768px) {
  .product-detail {
    grid-template-columns: 1fr;
  }
}

.product-detail__media img {
  width: 100%;
  border-radius: 12px;
  display: block;
}

.badge-role {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 700;
  background: #fff;
  border: 2px solid var(--primary-orange);
  color: var(--primary-orange);
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"] {
  width: 100%;
  max-width: 420px;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  font-size: 1rem;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  min-height: 36px;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
}

.msg {
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 1.05rem;
}

.msg-error {
  background: #ffe8e0;
  color: #8a2c0d;
}

.msg-ok {
  background: #e8f5e9;
  color: #1b5e20;
}

.speech-fab {
  position: fixed;
  top: calc(var(--topnav-h) + 12px);
  right: 24px;
  z-index: 150;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 0;
  background: linear-gradient(to bottom, var(--primary-orange-light), var(--primary-orange));
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}

.speech-fab.is-paused {
  opacity: 0.85;
}

/* 竖排 + 固定宽度：避免 html 超大字后 rem 变大把按钮撑出屏外 */
.font-fab {
  position: fixed;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 155;
  box-sizing: border-box;
  width: 48px;
  min-width: 48px;
  max-width: 48px;
  min-height: 88px;
  padding: 10px 6px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(to bottom, #5ea2ff, #2f75d8);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.08em;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  writing-mode: vertical-rl;
  text-orientation: upright;
  display: flex;
  align-items: center;
  justify-content: center;
}

.font-fab.is-on {
  background: linear-gradient(to bottom, var(--primary-orange-light), var(--primary-orange));
}

/* 首页右下角：后台入口 */
.admin-corner-link {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 140;
  padding: 10px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  transition: color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.admin-corner-link:hover {
  color: var(--primary-orange);
  border-color: rgba(255, 122, 40, 0.45);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.list-plain {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list-plain li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
}

.empty-tip {
  text-align: center;
  color: var(--text-muted);
  padding: 32px 16px;
}

.section-title {
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0 0 18px;
}

.home-frequent-wrap {
  margin: 8px 0 26px;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid #ffe2c8;
  background: linear-gradient(180deg, #fff5eb 0%, #fff1e4 100%);
}

.home-frequent-wrap .section-title {
  color: #b85f18;
}

.tag-mini {
  display: inline-block;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 6px;
  background: #eef3f8;
  color: var(--text-muted);
  margin-right: 6px;
}

.site-footer {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 24px 32px 32px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-soft);
}

/* 隐藏旧版底部 Tab（已弃用） */
.tabbar {
  display: none !important;
}

.mobile-tabbar {
  display: none;
}

.btn-primary--lg {
  padding: 12px 32px;
  font-size: 1.05rem;
  min-height: 44px;
}

.btn-primary--sm {
  padding: 6px 14px;
  min-height: 36px;
  font-size: 0.9rem;
}

/* —— 购物车（电脑端表格） —— */
.page-wrap--cart {
  max-width: var(--content-max);
}

.cart-empty {
  text-align: center;
  padding: 56px 32px;
}

.cart-empty__text {
  margin: 0 0 20px;
  font-size: 1.1rem;
  color: var(--text-muted);
}

.cart-table-card {
  overflow-x: auto;
  padding: 0;
}

.cart-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.cart-table thead {
  background: #f0ebe3;
  border-bottom: 1px solid var(--border-soft);
}

.cart-table th {
  text-align: left;
  padding: 14px 16px;
  font-weight: 700;
  color: var(--text-dark);
  white-space: nowrap;
}

.cart-table td {
  padding: 16px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-soft);
}

.cart-table tbody tr:hover {
  background: rgba(255, 122, 40, 0.04);
}

.cart-table__price,
.cart-table__sub {
  white-space: nowrap;
  font-weight: 600;
}

.cart-table__qty {
  width: 120px;
}

.cart-table__act {
  width: 72px;
}

.cart-goods {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 420px;
}

.cart-goods__img-wrap {
  flex-shrink: 0;
}

.cart-goods__img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  background: #eee;
}

.cart-goods__name {
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.4;
  color: var(--text-dark);
}

.cart-goods__name:hover {
  color: var(--primary-orange);
}

.cart-qty-input {
  width: 72px;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  font-size: 1rem;
  text-align: center;
}

.cart-remove-link {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-decoration: underline;
}

.cart-remove-link:hover {
  color: #c62828;
}

.cart-toolbar {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 0 4px;
}

.cart-toolbar__hint {
  font-size: 0.88rem;
  color: var(--text-muted);
  flex: 1;
  min-width: 200px;
}

.cart-summary {
  margin-top: 20px;
  padding: 20px 24px;
}

.cart-summary__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.cart-summary__total {
  margin: 0;
  font-size: 1.05rem;
}

.cart-summary__tip {
  margin: 6px 0 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* —— 个人中心（侧栏 + 主区） —— */
.page-wrap--profile {
  max-width: var(--content-max);
}

.profile-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

@media (max-width: 960px) {
  .profile-layout {
    grid-template-columns: 1fr;
  }
}

.profile-sidebar {
  padding: 0;
  overflow: hidden;
}

.profile-sidebar__user {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  border-bottom: 1px solid var(--border-soft);
  background: linear-gradient(135deg, #fffaf5 0%, #fff 100%);
}

.profile-sidebar__avatar {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: linear-gradient(to bottom, var(--primary-orange-light), var(--primary-orange));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.profile-sidebar__name {
  font-weight: 800;
  font-size: 1.05rem;
  margin-bottom: 6px;
}

.profile-side-nav {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
}

.profile-side-nav__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dark);
  border-left: 3px solid transparent;
}

.profile-side-nav__link:hover {
  background: rgba(255, 122, 40, 0.06);
  color: var(--primary-orange);
}

.profile-side-nav__link--muted {
  color: var(--text-muted);
  margin-top: 8px;
  border-top: 1px solid var(--border-soft);
  padding-top: 16px;
}

.profile-main {
  min-width: 0;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

@media (max-width: 900px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }
}

.profile-panel {
  padding: 22px 24px;
}

.profile-panel--wide {
  grid-column: 1 / -1;
}

.profile-panel__title {
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-weight: 800;
}

.profile-panel__desc {
  margin: 0 0 16px;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.profile-panel__status {
  margin: 0 0 12px;
  font-size: 0.95rem;
}

.profile-panel__actions {
  margin-top: 16px;
}

.profile-panel__actions--health {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.profile-health-tip {
  margin: 0 0 18px;
  padding: 12px 14px;
  font-size: 0.86rem;
  line-height: 1.55;
  color: #5d4e3a;
  background: rgba(255, 157, 92, 0.1);
  border-radius: 10px;
  border: 1px solid rgba(255, 122, 40, 0.18);
}

.profile-health-subtitle {
  margin: 20px 0 8px;
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-dark);
}

.profile-health-subtitle:first-of-type {
  margin-top: 0;
}

.profile-health-hint {
  margin: 0 0 12px;
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.profile-health-hint--tight {
  margin-top: -4px;
  margin-bottom: 14px;
}

.profile-health-label {
  display: block;
  margin: 0 0 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dark);
}

.profile-health-textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-soft);
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  min-height: 72px;
  margin-bottom: 4px;
}

.profile-health-link {
  text-decoration: none;
}

.profile-form-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}

.profile-form-inline__label {
  font-weight: 600;
  white-space: nowrap;
}

.profile-form-inline__input {
  min-width: 160px;
  max-width: 220px;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
  font-size: 1rem;
}

.profile-form-inline--bind .profile-form-inline__input {
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}

.child-threshold-table-wrap {
  overflow-x: auto;
}

.child-threshold-table,
.bind-list-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.child-threshold-table th,
.child-threshold-table td,
.bind-list-table th,
.bind-list-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
}

.child-threshold-table thead,
.bind-list-table thead {
  background: #f0ebe3;
}

.child-threshold-table th,
.bind-list-table th {
  font-weight: 700;
}

.child-threshold-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.child-threshold-form__input {
  width: 140px;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-soft);
}

/* 首页轮播 */
.home-carousel {
  position: relative;
  margin-bottom: 24px;
  border-radius: 12px;
  overflow: hidden;
  background: #e8e4dc;
  max-width: 100%;
  min-width: 0;
}

.home-carousel__viewport {
  overflow: hidden;
  max-width: 100%;
  min-width: 0;
}

.home-carousel__track {
  display: flex;
  transition: transform 0.45s ease;
}

.home-carousel__slide {
  flex: 0 0 100%;
  min-width: 100%;
  box-sizing: border-box;
}

.home-carousel__slide img {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  object-fit: cover;
  display: block;
  vertical-align: middle;
}

.home-carousel__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-dark);
  box-shadow: var(--shadow-soft);
  z-index: 2;
}

.home-carousel__btn--prev {
  left: 12px;
}

.home-carousel__btn--next {
  right: 12px;
}

.home-carousel__dots {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 2;
}

.home-carousel__dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
}

.home-carousel__dots span.on {
  background: var(--primary-orange);
}

.cat-pill--has-icon {
  flex-direction: column;
  gap: 8px;
  min-height: 72px;
}

.cat-pill__icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.cat-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 1.08rem;
}

.cat-filter-btn__icon {
  width: 120px;
  height: 120px;
  object-fit: contain;
}

.category-mobile-list {
  display: none;
}

.category-mobile-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  margin-bottom: 14px;
}

.category-mobile-card__img-wrap {
  width: 120px;
  height: 88px;
}

.category-mobile-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  background: #f1efe9;
}

.category-mobile-card__img--ph {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9a958a;
  font-size: 1.8rem;
}

.category-mobile-card__name {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.35;
}

.circle-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 8px;
}

.circle-card {
  padding: 14px 16px;
}

/* 左图右文：有图时左侧方图缩略，右侧用户与正文 */
.circle-card__row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.circle-card__body {
  flex: 1;
  min-width: 0;
}

.circle-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.circle-card__user {
  font-weight: 800;
  color: var(--text-dark);
}

.circle-card__time {
  font-size: 0.88rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.circle-card__content {
  margin: 0 0 10px;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text-dark);
}

.circle-card__content:last-child {
  margin-bottom: 0;
}

.circle-card__product {
  margin: 0;
  font-size: 0.98rem;
  color: var(--text-muted);
}

.circle-card__product a {
  margin-left: 8px;
  color: var(--primary-orange);
  font-weight: 600;
}

.circle-card__img-wrap {
  flex-shrink: 0;
  width: 104px;
  height: 104px;
  border-radius: 12px;
  background: #f0eeea;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.circle-card__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media (min-width: 769px) {
  .circle-card__img-wrap {
    width: 120px;
    height: 120px;
  }
}

/* 兴趣圈 · 入驻店铺：左图右文列表 */
.shop-landing-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 8px;
}

.shop-landing-card {
  padding: 0;
  overflow: hidden;
}

.shop-landing-card__link {
  display: flex;
  align-items: stretch;
  min-height: 92px;
  color: inherit;
  text-decoration: none;
}

.shop-landing-card__link:hover .shop-landing-card__title {
  color: var(--primary-orange);
}

.shop-landing-card__logo {
  flex: 0 0 104px;
  width: 104px;
  max-width: 28vw;
  min-width: 88px;
  background: #fff;
  border-right: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  box-sizing: border-box;
}

.shop-landing-card__logo img {
  max-width: 100%;
  max-height: 72px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.shop-landing-card__logo-ph {
  font-size: 1.85rem;
  color: #bbb;
}

.shop-landing-card__body {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.shop-landing-card__title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.35;
}

.shop-landing-card__intro {
  margin: 0;
  font-size: 0.94rem;
  color: var(--text-muted);
  line-height: 1.5;
}

@media (min-width: 769px) {
  .shop-landing-card__logo {
    flex-basis: 120px;
    width: 120px;
    max-width: 120px;
  }

  .shop-landing-card__logo img {
    max-height: 80px;
  }
}

.shop-banner {
  margin-bottom: 20px;
}

.shop-banner img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.shop-head {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 24px;
  padding: 20px;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
}

.shop-head__logo {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 12px;
  flex-shrink: 0;
}

.shop-head__logo--ph {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eee;
  color: #999;
  font-size: 2rem;
}

.shop-head__title {
  margin: 0 0 8px;
  font-size: 1.35rem;
}

.shop-head__intro {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.5;
}

/* —— 科普天地 —— */
.science-hub {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}

.science-hub--compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 600px) {
  .science-hub--compact {
    grid-template-columns: 1fr;
  }
}

.science-hub__card {
  display: block;
  padding: 18px 16px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.science-hub__card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.science-hub__card-title {
  font-weight: 800;
  font-size: 1.05rem;
  margin-bottom: 6px;
  color: var(--text-dark);
}

.science-hub__card-meta {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.science-tab--on {
  background: rgba(255, 122, 40, 0.15);
  color: var(--primary-orange);
  border-color: var(--primary-orange-light);
}

.science-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.science-list--home {
  gap: 10px;
}

.science-list__item {
  overflow: hidden;
}

.science-list__link {
  display: block;
  color: inherit;
}

.science-list__row {
  display: flex;
  gap: 14px;
  align-items: stretch;
  min-height: 88px;
}

.science-list__thumb-wrap {
  flex: 0 0 100px;
  width: 100px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--border-soft);
}

.science-list__thumb-wrap--ph {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.5rem;
}

.science-list__thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 88px;
}

.science-list__body {
  flex: 1;
  min-width: 0;
  padding: 10px 16px 10px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.science-list__badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary-orange);
  background: rgba(255, 122, 40, 0.12);
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: 6px;
  width: fit-content;
}

.science-list__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
}

.science-list__meta {
  margin: 6px 0 0;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.home-science-wrap {
  margin: 28px 0 32px;
}

@media (max-width: 768px) {
  /* 首页科普：三块入口卡 + 最新文章列表仅桌面显示；手机保留标题与「进入科普」 */
  .home-science-hub-only-desktop {
    display: none !important;
  }

  /* 手机首页不展示「我的常买」 */
  .home-frequent-wrap {
    display: none !important;
  }

  /* 登录页：手机不显示商家入口，用户登录占满宽 */
  .login-role-tabs {
    grid-template-columns: 1fr;
  }

  .login-role-tabs__merchant {
    display: none !important;
  }

  .cat-filter-btn {
    gap: 8px;
    font-size: inherit;
  }

  .cat-filter-btn__icon {
    width: 28px;
    height: 28px;
  }

  .site-nav {
    display: none;
  }

  .site-topnav__inner {
    justify-content: space-between;
    gap: 8px;
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
  }

  .site-topnav__user {
    white-space: normal;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px 8px;
    max-width: min(220px, 52vw);
  }

  .site-brand {
    flex-shrink: 0;
  }

  .search-shell {
    padding: 6px 8px;
  }

  .search-inner {
    gap: 8px;
    padding: 8px 10px;
  }

  .search-submit {
    padding: 8px 10px;
    min-height: 40px;
  }

  .category-filter-row.is-mobile-landing {
    display: none !important;
  }

  .category-mobile-list {
    display: block;
  }

  .category-products-block--all {
    display: none;
  }

  .font-fab {
    right: max(8px, env(safe-area-inset-right, 0px));
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    min-height: 78px;
    padding: 8px 5px;
    border-radius: 12px;
    font-size: 14px;
  }

  /* 朗读按钮：避开顶栏与底栏 tabbar，避免被遮挡或误以为“没有按钮” */
  .speech-fab {
    top: auto;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    right: max(10px, env(safe-area-inset-right, 0px));
    z-index: 400;
    font-size: 1.1rem;
  }

  .mobile-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 350;
    height: calc(64px + env(safe-area-inset-bottom));
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    background: #fff;
    border-top: 1px solid var(--border-soft);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
  }

  .mobile-tabbar a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--text-muted);
    border-radius: 8px;
    font-size: 0.86rem;
    line-height: 1.1;
    min-height: 44px;
  }

  .mobile-tabbar a i {
    font-size: 2rem;
  }

  .mobile-tabbar a.is-active {
    color: var(--primary-orange);
    background: rgba(255, 122, 40, 0.1);
  }

  .site-main,
  .site-footer,
  .page-wrap {
    padding-bottom: calc(88px + env(safe-area-inset-bottom));
  }

  .page-wrap {
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
    max-width: 100%;
  }

  /* 超大字时根字号变大，240px 列最小值易把整页撑出横向滚动 */
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  }
}
