/* 厂家公开店铺 - 首页样式（移动端优先，按旧系统首页结构重做） */
/* 间距约束：除底部导航栏及其安全区外，正文内容区所有 margin/padding/gap/边缘留白统一 6px（docs/02 第 8 节强制规则） */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* 旧系统首页（I:\jiajutuce.cn\home.html）颜色语义：激活/强调 #ff9500，主文字 #333，辅助 #666，默认边框 #ddd */
  --fsf-primary: #ff9500;
  --fsf-primary-dark: #ff9500;
  --fsf-bg: #f8f9fa;
  --fsf-card: #ffffff;
  --fsf-text: #333333;
  --fsf-text-light: #666666;
  --fsf-border: #dddddd;
}

/* 防横向溢出：clip 不产生滚动容器，不会破坏 sticky（hidden 会禁用 sticky） */
html, body {
  overflow-x: clip;
}

@supports not (overflow: clip) {
  html, body { overflow-x: hidden; }
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--fsf-bg);
  color: var(--fsf-text);
  min-height: 100vh;
  font-size: 12px;
  line-height: 1.5;
  /* 底部导航高 52px + 安全区；再预留 6px 使最后一个内容模块距导航固定 6px */
  padding-bottom: calc(52px + var(--paw-safe-bottom, 0px));
}

/* 子账号画册身份标识：固定在页面左上角，游客和已登录状态均可见。 */
.fsf-subaccount-badge {
  position: fixed;
  top: max(6px, env(safe-area-inset-top));
  left: 6px;
  z-index: 40;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid #d97706;
  border-radius: 50%;
  background: #fff7ed;
  color: #b45309;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .14);
  opacity: .15;
  pointer-events: none;
}

/* 类选择器的 display:grid 会覆盖浏览器默认 [hidden] 规则，必须显式兜底。 */
.fsf-subaccount-badge[hidden] {
  display: none;
}

.fsf-main {
  max-width: 720px;
  margin: 0 auto;
  min-height: 0;
  height: auto;
}

.fsf-loading,
.fsf-error {
  padding: 6px;
  text-align: center;
  color: var(--fsf-text-light);
  font-size: 12px;
  font-weight: 500;
}

.fsf-error {
  color: #c0392b;
}

/* ==================== 1. 轮播区（仅图片，固定 4:3） ==================== */
.fsf-carousel {
  position: relative;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  background: #eef0f2;
  overflow: hidden;
}

.fsf-carousel-track {
  display: flex;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  overflow-x: auto;
  scrollbar-width: none;
}

.fsf-carousel-track::-webkit-scrollbar {
  display: none;
}

.fsf-carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  scroll-snap-align: start;
  cursor: pointer;
}

/* 轮播图可键盘进入详情：仅键盘聚焦（非鼠标点击）时显示焦点环 */
.fsf-carousel-slide:focus-visible {
  outline: 2px solid var(--fsf-primary);
  outline-offset: -2px;
}

.fsf-carousel-img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.fsf-carousel-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  display: flex;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
}

.fsf-carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  pointer-events: auto;
  transition: background .2s ease, transform .2s ease;
}

.fsf-carousel-dot.active {
  background: var(--fsf-primary-dark);
  transform: scale(1.15);
}

/* ==================== 2-4. 筛选区（吸顶：参照旧系统"分类自动吸顶、轮播划出"） ==================== */
.fsf-sticky-bar {
  position: -webkit-sticky;
  position: sticky;
  top: var(--paw-safe-top, 0px);
  z-index: 15;
  background: var(--fsf-bg);
  border-bottom: 1px solid var(--fsf-border);
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

/* 三级分类缩略图（参照旧系统：主行固定 6 列，缩略图 50×50、圆角 16、名称 11px） */
.fsf-cat-bar {
  padding-top: 6px;
}

.fsf-cat-scroll {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  padding: 6px;
  box-sizing: border-box;
}

.fsf-cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  min-width: 0;
}

.fsf-cat-thumb {
  width: min(50px, 100%);
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  background: #f5f5f5;
  border: 2px solid #ddd;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.fsf-cat-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fsf-cat-name {
  width: 4em;
  max-width: 100%;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--fsf-text);
  text-align: center;
  overflow-wrap: anywhere;
  word-break: break-all;
  white-space: normal;
}

.fsf-cat-card.active .fsf-cat-thumb {
  border-color: var(--fsf-primary);
}

.fsf-cat-card.active .fsf-cat-name {
  color: var(--fsf-primary-dark);
  font-weight: 600;
}

/* 更多分类：主行下方内联展开，6 列对齐（参照旧系统） */
.fsf-cat-more-expand {
  display: none;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  padding: 0 6px 6px;
  box-sizing: border-box;
}

.fsf-cat-more-expand.open {
  display: grid;
}

.fsf-cat-more-thumb {
  background: #f0f4f8;
  border: 2px dashed #c8d6e5;
}

.fsf-cat-more-icon {
  display: block;
  color: #5a6a7a;
}

/* 搜索栏（矩形圆角，自动搜索） */
.fsf-search-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
}

.fsf-search-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.fsf-search-input {
  width: 100%;
  height: 40px;
  padding: 0 40px 0 6px;
  font-size: 14px;
  color: var(--fsf-text);
  background: var(--fsf-card);
  border: 1px solid var(--fsf-border);
  border-radius: 10px;
  outline: none;
  -webkit-appearance: none;
}

.fsf-search-input:focus {
  border-color: var(--fsf-primary);
}

.fsf-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

/* 子分类文字按钮（横滑不换行） */
.fsf-sub-bar {
  padding-bottom: 6px;
}

.fsf-sub-scroll {
  display: flex;
  gap: 6px;
  padding: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.fsf-sub-scroll::-webkit-scrollbar {
  display: none;
}

.fsf-sub-btn {
  flex: 0 0 auto;
  min-width: 56px;
  padding: 6px;
  font-size: 14px;
  line-height: 1.2;
  color: #666;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s ease;
}

.fsf-sub-btn.active {
  background: var(--fsf-primary);
  border-color: var(--fsf-primary);
  color: #fff;
}

/* ==================== 5. 单列产品列表（图片按原比例自适应） ==================== */
.fsf-product-list {
  padding: 6px 6px 0;
}

.fsf-product-card {
  display: block;
  width: 100%;
  background: var(--fsf-card);
  border: 1px solid var(--fsf-border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 6px;
  cursor: pointer;
  transition: box-shadow .15s ease;
}

.fsf-product-card:last-child {
  margin-bottom: 0;
}

.fsf-product-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--fsf-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
}

.fsf-product-meta {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--fsf-primary-dark);
}

.fsf-product-card:hover {
  box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
}

.fsf-product-img-wrap {
  width: 100%;
  background: #eef0f2;
}

.fsf-product-img {
  display: block;
  width: 100%;
  height: auto;
}

.fsf-product-info {
  padding: 6px;
}

.fsf-product-title-price-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 8px;
}

.fsf-product-title-wrap {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.fsf-product-title {
  min-width: 0;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fsf-product-model {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--fsf-text-light);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-align: right;
}

.fsf-product-attributes {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--fsf-text);
}

.fsf-product-attribute {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.fsf-product-code {
  font-size: 12px;
  font-weight: 500;
  color: var(--fsf-text-light);
  margin-top: 6px;
}

.fsf-product-price {
  flex: 0 0 auto;
  font-size: 16px;
  font-weight: 600;
  color: #c0392b;
  white-space: nowrap;
}

.fsf-product-price .fsf-price-empty {
  color: var(--fsf-text-light);
  font-weight: 400;
}

.fsf-product-stats {
  font-size: 12px;
  font-weight: 500;
  color: var(--fsf-text-light);
  margin-top: 6px;
}

/* ==================== 底部导航（不纳入 6px 约束，保持既定设计） ==================== */
.fsf-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  height: calc(52px + var(--paw-safe-bottom, 0px));
  padding-bottom: var(--paw-safe-bottom, 0px);
  align-items: flex-start;
  background: #D4E4BC;
  border-top: 1px solid #B8CF96;
}

.fsf-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: none;
  background: none;
  padding: 2px;
  cursor: pointer;
  color: #5a7340;
}
.fsf-footer #navLogin, .fsf-footer #navLogout { color: #000; }
.fsf-footer #navLogout { color: #777; }
.fsf-footer #navLogin .fsf-nav-icon, .fsf-footer #navLogout .fsf-nav-icon { filter: none; opacity: 1; }
.fsf-footer #navLogin[data-auth-state="anonymous"] .fsf-nav-icon, .fsf-footer #navLogout[data-auth-state="anonymous"] .fsf-nav-icon { filter: grayscale(1); opacity: .7; }
.fsf-footer #navLogin[data-auth-state="guest"] .fsf-nav-icon, .fsf-footer #navLogout[data-auth-state="guest"] .fsf-nav-icon { filter: none; opacity: 1; }
.fsf-footer #navLogout.is-guest-authenticated { color: #777; }
.fsf-footer #navLogout.is-guest-authenticated .fsf-nav-icon { filter: none; opacity: 1; }
.fsf-footer #navLogout.is-account-authenticated .fsf-nav-icon { filter: none; opacity: 1; }
.fsf-footer #navLogout.is-subaccount-authenticated .fsf-nav-icon { filter: none; opacity: 1; }

.fsf-nav-item:active {
  color: #3d5a24;
}

.fsf-nav-icon {
  font-size: 18px;
  line-height: 1;
  width: 22px;
  height: 22px;
  display: block;
}

.fsf-nav-label {
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}
.fsf-nav-label { color: #000; }

/* ==================== 右下角悬浮按钮组（置顶 + 二维码，导航上方 6px） ==================== */
.fsf-float-group {
  position: fixed;
  /* 宽屏下与正文列（max-width 720px）右侧对齐，窄屏贴右 6px */
  right: max(6px, calc((100vw - 720px) / 2 + 6px));
  /* 导航栏高 52px + 安全区；按钮组底边距导航顶 6px */
  bottom: calc(58px + env(safe-area-inset-bottom, 0px));
  z-index: 21;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.fsf-float-btn {
  width: 40px;
  height: 40px;
  border-radius: 15px;
  border: 1px solid rgba(126, 133, 140, .18);
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 5px 14px rgba(30, 35, 40, .10);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.fsf-float-btn:active {
  transform: scale(.94);
  box-shadow: 0 2px 6px rgba(30, 35, 40, .08);
}

/* 置顶入口使用独立按钮面板和文字，避免火箭图标在页面图片上不明显。 */
#ufoReset {
  height: 40px;
  flex-direction: column;
  gap: 0;
  color: #ff9500;
  background: #ffffff;
  border-color: #ff9500;
  box-shadow: 0 6px 16px rgba(30, 35, 40, .10);
}

#ufoReset:active {
  background: #fff7ef;
}

#ufoReset::after {
  content: "置顶";
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .06em;
}

.fsf-float-icon {
  display: block;
  width: 24px;
  height: 24px;
}

#btnQrcode .fsf-float-icon {
  width: 20px;
  height: 20px;
  opacity: .62;
  filter: grayscale(1) brightness(1.38);
}

/* 火箭图标在深色按钮上保持完整轮廓。 */
#ufoReset .fsf-float-icon {
  width: 22px;
  height: 22px;
}

/* 店铺二维码弹窗：标题居中、四边留白均匀，微信扫一扫直达 */
/* 注意：需比 .fsf-modal 更高特异性，否则其 padding:6px 会覆盖本弹窗留白 */
.fsf-modal.fsf-qrcode-modal {
  padding: 24px;
}

.fsf-qrcode-modal .fsf-modal-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-bottom: 12px;
}

/* 标题占中间列，水平居中；关闭按钮占右侧列，位于右上 */
.fsf-qrcode-modal .fsf-modal-header span {
  grid-column: 2;
  justify-self: center;
}

.fsf-qrcode-modal .fsf-modal-header button {
  grid-column: 3;
  justify-self: end;
  padding: 0;
}

.fsf-qrcode-box {
  display: flex;
  justify-content: center;
  padding: 0;
}

.fsf-qrcode-box canvas,
.fsf-qrcode-box img {
  display: block;
  max-width: 100%;
}

.fsf-qrcode-tip {
  font-size: 12px;
  font-weight: 500;
  color: var(--fsf-text-light);
  text-align: center;
  margin: 12px 0 0;
}

/* ==================== 用户切换弹窗（间距统一 6px） ==================== */
.fsf-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 48px;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}

.fsf-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.fsf-modal {
  width: calc(100% - 12px);
  max-width: 360px;
  background: var(--fsf-card);
  border-radius: 12px;
  padding: 6px;
  transform: scale(.96);
  transition: transform .2s ease;
}

.fsf-modal-overlay.open .fsf-modal {
  transform: scale(1);
}

.fsf-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  color: var(--fsf-text);
  margin-bottom: 6px;
}

.fsf-modal-header button {
  border: none;
  background: none;
  font-size: 22px;
  line-height: 1;
  color: var(--fsf-text-light);
  cursor: pointer;
  padding: 2px;
}

.fsf-modal-desc {
  font-size: 13px;
  color: var(--fsf-text-light);
  margin-bottom: 6px;
}

.fsf-switch-history {
  margin-bottom: 6px;
  min-width: 0;
}

.fsf-switch-history-title {
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--fsf-text-light);
}

.fsf-switch-history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 176px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.fsf-switch-history-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 0 6px 0 10px;
  border: 1px solid var(--fsf-border);
  border-radius: 8px;
  background: var(--fsf-card);
  color: var(--fsf-text);
  cursor: pointer;
  text-align: left;
}

.fsf-switch-history-item:disabled {
  cursor: wait;
  opacity: .65;
}

.fsf-switch-history-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.fsf-switch-history-remove {
  flex: none;
  width: 30px;
  height: 30px;
  margin-left: 6px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--fsf-text-light);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.fsf-switch-history-remove:hover {
  color: #c0392b;
}

@media (max-width: 390px) {
  .fsf-modal-overlay {
    padding-top: min(48px, 6vh);
    padding-bottom: 12px;
    align-items: flex-start;
    overflow-y: auto;
  }

  .fsf-switch-history-list {
    max-height: 152px;
  }
}

.fsf-modal-input {
  width: 100%;
  height: 44px;
  padding: 0 6px;
  font-size: 14px;
  color: var(--fsf-text);
  border: 1px solid var(--fsf-border);
  border-radius: 8px;
  outline: none;
}

.fsf-image-trigger {
  position: absolute;
  top: 50%;
  right: 0;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--fsf-text-light);
  cursor: pointer;
  transform: translateY(-50%);
}

.fsf-image-trigger:active {
  color: var(--fsf-primary-dark);
}

.fsf-image-trigger-icon {
  font-size: 20px;
  line-height: 1;
  width: 22px;
  height: 22px;
  display: block;
}

.fsf-modal-input:focus {
  border-color: var(--fsf-primary);
}

.fsf-modal-msg {
  min-height: 18px;
  margin: 6px 0;
  font-size: 12px;
  font-weight: 500;
  color: #c0392b;
}

.fsf-modal-submit {
  width: 100%;
  height: 44px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--fsf-primary);
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.fsf-modal-submit:disabled {
  opacity: .6;
}

/* ==================== 菜单抽屉（间距统一 6px，安全区除外） ==================== */
.fsf-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: flex-end;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
}

.fsf-menu-overlay.open {
  opacity: 1;
  visibility: visible;
}

.fsf-menu-drawer {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  background: var(--fsf-card);
  border-radius: 16px 16px 0 0;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  max-height: 82vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform .25s ease;
}

.fsf-menu-overlay.open .fsf-menu-drawer {
  transform: translateY(0);
}

.fsf-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 16px;
  font-weight: 600;
  color: var(--fsf-text);
}

.fsf-menu-header button {
  border: none;
  background: none;
  font-size: 22px;
  line-height: 1;
  color: var(--fsf-text-light);
  cursor: pointer;
  padding: 2px;
}

.fsf-menu-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.fsf-menu-entry {
  color: inherit;
  text-decoration: none;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  aspect-ratio: auto;
  border: 1px solid var(--fsf-border);
  border-radius: 10px;
  background: var(--fsf-card);
  cursor: pointer;
  color: var(--fsf-text);
  font-size: 12px;
  padding: 6px;
  min-width: 0;
}

@media (max-width: 768px) {
  .fsf-menu-entry { aspect-ratio: 1 / 1; }
}
.fsf-menu-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  line-height: 1;
  text-align: center;
  box-sizing: border-box;
}

.fsf-menu-entry:active {
  border-color: var(--fsf-primary);
  color: var(--fsf-primary-dark);
  background: #fff8f0;
}

.fsf-menu-icon {
  font-size: 20px;
  line-height: 1;
  width: 22px;
  height: 22px;
  display: block;
}

.fsf-menu-entry span:last-child {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.15;
  max-width: 100%;
  font-size: 11px;
}

/* 游客菜单仅保留三项，固定在右下方并向上单列展开；后台账号继续使用原抽屉。 */
.fsf-menu-overlay.is-guest-menu {
  align-items: flex-end;
  justify-content: flex-end;
  background: transparent;
  pointer-events: none;
}

.fsf-menu-overlay.is-guest-menu.open { pointer-events: auto; }

.fsf-menu-overlay.is-guest-menu .fsf-menu-drawer {
  position: absolute;
  right: 6px;
  bottom: calc(58px + env(safe-area-inset-bottom));
  width: max-content;
  min-width: 108px;
  max-width: calc(100vw - 12px);
  margin: 0;
  padding: 6px;
  max-height: none;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
  transform: translateY(12px);
  pointer-events: auto;
}

.fsf-menu-overlay.is-guest-menu.open .fsf-menu-drawer { transform: translateY(0); }
.fsf-menu-overlay.is-guest-menu .fsf-menu-header { display: none; }
.fsf-menu-overlay.is-guest-menu .fsf-menu-grid { grid-template-columns: 1fr; gap: 6px; }
.fsf-menu-overlay.is-guest-menu .fsf-menu-entry:not(.is-guest-entry) { display: none !important; }
.fsf-menu-overlay.is-guest-menu .fsf-menu-entry.is-guest-entry { display: flex !important; }
.fsf-menu-overlay.is-guest-menu .fsf-menu-entry {
  aspect-ratio: auto;
  min-height: 42px;
  flex-direction: row;
  justify-content: center;
  padding: 6px;
}

/* menu-policy 明确下发 compact-list 时使用子账号顶部单列，不继承五列图标网格。 */
.fsf-menu-overlay.is-compact-menu { align-items: flex-end; justify-content: flex-end; background: transparent; pointer-events: none; }
.fsf-menu-overlay.is-compact-menu.open { pointer-events: auto; }
.fsf-menu-overlay.is-compact-menu .fsf-menu-drawer { position: absolute; right: 6px; bottom: calc(58px + env(safe-area-inset-bottom)); margin: 0; width: max-content; max-width: calc(100vw - 24px); max-height: calc(100vh - 76px); border-radius: 12px; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); transform: translateY(12px); pointer-events: auto; }
.fsf-menu-overlay.is-compact-menu.open .fsf-menu-drawer { transform: translateY(0); }
.fsf-menu-overlay.is-compact-menu .fsf-menu-header { font-size: 12px; }
.fsf-menu-overlay.is-compact-menu .fsf-menu-grid { display: flex; flex-direction: column; align-items: flex-start; width: max-content; max-width: calc(100vw - 24px); }
.fsf-menu-overlay.is-compact-menu .fsf-menu-entry { width: fit-content; max-width: 100%; min-height: 42px; aspect-ratio: auto; flex-direction: row; justify-content: flex-start; }

/* 游客入口使用中性灰个人图标，避免与厂家登录身份色混淆。 */
#navMenu.is-guest-nav .fsf-nav-icon { filter: grayscale(1); opacity: .62; }

/* 子账号只读菜单入口：保留显示但灰色不可点（交互降级，权限仍以后端校验为准；不得隐藏） */
.subaccount-menu-readonly {
  color: #9ca3af;
  border-color: #d1d5db;
  background: #f3f4f6;
  opacity: 0.7;
  cursor: not-allowed;
  pointer-events: auto;
}

.subaccount-menu-readonly .fsf-menu-icon {
  filter: grayscale(1);
}

.subaccount-menu-readonly:active,
.subaccount-menu-readonly:focus {
  border-color: #d1d5db;
  color: #9ca3af;
  background: #f3f4f6;
}

/* ==================== 登入弹窗（复用经销商首页登入弹窗交互，主控指令 2026-08-11） ====================
   说明：按主控明确要求与经销商首页登入弹窗保持一致，弹窗内间距沿用经销商既定设计
   （16px/24px/14px/12px/10px/8px 等），作为 docs/02 第 8 节 6px 规则的记录在案例外。 */
.fsf-login-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 16px;
  background: rgba(31, 36, 48, 0.38);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.fsf-login-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.fsf-login-dialog {
  position: relative;
  width: min(100%, 380px);
  padding: 24px;
  border-radius: 20px;
  background: var(--fsf-card);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
}

.fsf-login-dialog h2 {
  margin-bottom: 8px;
  color: var(--fsf-primary-dark);
  text-align: center;
}

.fsf-login-dialog form {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  column-gap: 8px;
  align-items: center;
}

.fsf-login-dialog p {
  color: var(--fsf-text-light);
  font-size: 16px;
  line-height: 1.6;
}

.fsf-login-label {
  grid-column: 1;
  margin-top: 14px;
  display: flex;
  align-items: center;
  height: 44px;
  color: var(--fsf-text);
  font-size: 13px;
}

.fsf-login-input {
  grid-column: 2;
  display: block;
  width: 100%;
  height: 44px !important;
  min-height: 44px !important;
  margin-top: 14px;
  padding: 0 12px;
  border: 1px solid var(--fsf-border);
  border-radius: 12px;
  background: #fff;
  color: var(--fsf-text);
  /* iOS Safari zooms the page when a focused input is smaller than 16px. */
  font-size: 16px;
  outline: none;
  visibility: visible !important;
  opacity: 1 !important;
}

.fsf-login-input:focus {
  border-color: var(--fsf-primary);
  box-shadow: 0 0 0 3px rgba(255, 149, 0, 0.18);
}

.fsf-password-field {
  grid-column: 2;
  position: relative;
  display: block;
  width: 100%;
  margin-top: 14px;
}

.fsf-password-field .fsf-login-input {
  margin-top: 0;
  padding-right: 44px;
}

.fsf-password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--fsf-text-light);
  cursor: pointer;
  transform: translateY(-50%);
}

.fsf-password-toggle:hover {
  color: var(--fsf-primary-dark);
}

.fsf-login-options {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 12px;
}

.fsf-login-check {
  display: inline-flex !important;
  align-items: center;
  gap: 5px !important;
  margin-top: 0 !important;
  font-size: 12px !important;
  white-space: nowrap;
}

.fsf-login-check input {
  width: 16px;
  height: 16px !important;
  min-height: 16px !important;
  margin: 0;
}

.fsf-forgot-password {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--fsf-primary-dark);
  cursor: pointer;
  font-size: 12px;
}

.fsf-login-close {
  position: absolute;
  top: 12px;
  right: 16px;
  border: 0;
  background: transparent;
  color: var(--fsf-text-light);
  cursor: pointer;
  font-size: 24px;
}

.fsf-login-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.fsf-login-actions button {
  flex: 0 0 auto;
  min-width: 0;
  min-height: 44px;
  padding: 0 28px;
  border: 1px solid var(--fsf-border);
  border-radius: 12px;
  background: #fff;
  color: var(--fsf-text);
  cursor: pointer;
  text-align: center;
}

.fsf-login-actions .is-primary {
  border-color: var(--fsf-primary);
  background: var(--fsf-primary);
  color: #fff;
}

.fsf-login-message {
  grid-column: 1 / -1;
  margin-top: 10px;
}

.fsf-login-message.is-error {
  color: #bf3f31;
}

.fsf-login-message.is-success {
  color: #287a4a;
}

/* ==================== 找回密码（独立模态框：左上角"返回"按钮） ==================== */
.fsf-forgot-back {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 1;
  border: 0;
  background: transparent;
  color: var(--fsf-primary-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
  padding: 2px;
  line-height: 1;
}
.fsf-forgot-back .nav-icon-img { width: 22px; height: 22px; display: block; }

.fsf-forgot-back:hover {
  text-decoration: underline;
}

.fsf-forgot-tip {
  grid-column: 1 / -1;
  text-align: center;
  margin: 4px 0 0;
}

.fsf-code-field {
  grid-column: 2;
  display: flex;
  gap: 8px;
  width: 100%;
  margin-top: 14px;
}

.fsf-code-field .fsf-login-input {
  flex: 1;
  min-width: 0;
  margin-top: 0;
}

.fsf-code-btn {
  flex-shrink: 0;
  min-width: 96px;
  min-height: 44px;
  border: 1px solid var(--fsf-primary);
  border-radius: 12px;
  background: #fff;
  color: var(--fsf-primary-dark);
  font-size: 14px;
  padding: 0 10px;
  cursor: pointer;
}

.fsf-code-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* 底部「首页」选择面板（P-WEB-HOME-01） */
.fsf-home-panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.fsf-home-panel-overlay.open {
  display: flex;
}

.fsf-home-panel {
  width: 100%;
  max-width: 520px;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 10px 16px calc(14px + env(safe-area-inset-bottom));
  animation: fsf-home-panel-up 0.22s ease;
}

@keyframes fsf-home-panel-up {
  from {
    transform: translateY(24px);
    opacity: 0.6;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.fsf-home-panel-handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: #d9d9d9;
  margin: 0 auto 10px;
}

.fsf-home-panel-title {
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin-bottom: 14px;
}

.fsf-home-panel-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.fsf-home-panel-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border: 1px solid #e0e3e6;
  border-radius: 12px;
  padding: 16px 10px;
  background: #fff;
}

.fsf-home-panel-option:active {
  border-color: var(--fsf-primary);
}

.fsf-home-panel-option.current {
  border-color: var(--fsf-primary);
  background: #fff8f0;
}

.fsf-home-panel-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.fsf-home-panel-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--fsf-primary-dark);
}

.fsf-home-panel-desc {
  font-size: 12px;
  color: #999;
}

.fsf-home-panel-cancel {
  width: 100%;
  padding: 12px 0;
  border-radius: 10px;
  background: #f1f2f3;
  color: #666;
  font-size: 15px;
}
.fsf-login-switch{display:flex;gap:8px;margin:0 0 14px;padding:3px;border-radius:8px;background:#f3f5f8}.fsf-login-switch span,.fsf-login-switch a{flex:1;padding:7px;text-align:center;border-radius:6px;text-decoration:none;font-size:13px}.fsf-login-switch span.is-active{background:#ff8a00;color:#fff}.fsf-login-switch a{color:#657184}
.fsf-nav-item{position:relative}
#navContact.has-chat-unread .fsf-nav-icon{animation:chat-contact-icon-pulse 1s ease-in-out infinite}@keyframes chat-contact-icon-pulse{50%{transform:scale(1.14);opacity:.55}}
#desktopContactTop.has-chat-unread .fsf-nav-icon,#desktopContactFloat.has-chat-unread img{animation:chat-contact-icon-pulse 1s ease-in-out infinite}

/* ==================== PC 端工作台布局 ====================
   仅在宽屏启用，移动端继续使用上方的底部导航和菜单抽屉。 */
.fsf-desktop-toggle { display: none; }
.fsf-desktop-contact { display: none; }
.fsf-desktop-contact-top { display: none; }
.fsf-desktop-menu-title { display: none; }
.fsf-desktop-home { display: none; }
.fsf-desktop-album-toggle { display: none; }
.fsf-desktop-expiry { display: none; }

@media (min-width: 769px) {
  body {
    padding: 40px 0 0;
    background: #f5f7fa;
  }

  .fsf-main {
    width: 390px;
    max-width: 390px;
    height: calc(100vh - 40px);
    min-height: calc(100vh - 40px);
    margin: 0 0 0 auto;
    padding: 12px 6px 24px;
    overflow: visible;
    background: var(--fsf-bg);
  }

  body.fsf-desktop-album-hidden .fsf-main { visibility: hidden; }
  body.fsf-desktop-album-hidden .fsf-float-group { visibility: hidden; pointer-events: none; }

  .fsf-section { max-width: 1180px; margin: 0 auto; }
  .fsf-carousel { max-width: none; }

  .fsf-footer {
    top: 0;
    bottom: auto;
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    height: 40px;
    padding: 0 14px;
    z-index: 50;
    justify-content: flex-start;
    gap: 18px;
    background: #dfe8c7;
    border-bottom: 1px solid #c6d2ad;
  }

  .fsf-footer .fsf-nav-item {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    height: 40px;
    flex-direction: row;
    gap: 5px;
    color: #287fc4;
    font-size: 14px;
  }

  .fsf-footer .fsf-nav-icon { width: 18px; height: 18px; }
  .fsf-footer .fsf-nav-label { font-size: 14px; }
  .fsf-desktop-home {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    order: 0;
    width: auto;
    height: 34px;
    margin-left: 6px;
    color: #222;
    text-decoration: none;
  }
  .fsf-desktop-home img { width: 20px; height: 20px; }
  .fsf-desktop-home span { font-size: 14px; white-space: nowrap; }
  .fsf-desktop-menu-title { display: none; }
  .fsf-desktop-toggle {
    order: 0;
    margin-left: 32px;
  }
  .fsf-desktop-album-toggle { display: flex; order: 1; margin-left: auto; color: #222 !important; }
  .fsf-desktop-expiry { display: inline-flex; align-items: center; height: 40px; order: 1; margin-left: 18px; color: #596454; font-size: 13px; line-height: 1.2; white-space: nowrap; }
  body.fsf-desktop-album-hidden .fsf-main { visibility: hidden; }
  .fsf-desktop-contact-top { display: flex; order: 2; margin-left: 0; }
  .fsf-desktop-toggle { display: flex; order: 0; color: #222 !important; }
  .fsf-desktop-toggle .fsf-nav-label { font-size: 0; width: 0; overflow: hidden; }
  .fsf-desktop-menu-icon { display: flex; flex-direction: column; justify-content: center; gap: 3px; width: 24px; height: 24px; }
  .fsf-desktop-menu-icon i { display: block; width: 21px; height: 3px; border-radius: 2px; background: #333; }
  #navSwitchUser { order: 2; }
  #navLogin, #navLogout { order: 3; }
  #userName { order: 4; }
  #navMenu { display: none !important; }
  #navContact { display: none !important; }

  .fsf-desktop-contact { display: none; }

  .fsf-float-group {
    right: 12px;
    bottom: 12px;
    z-index: 60;
  }

  /* 复用菜单策略脚本产生的入口，桌面端固定为左侧导航。 */
  .fsf-menu-overlay {
    top: 40px;
    right: auto;
    bottom: 0;
    width: 180px;
    opacity: 1;
    visibility: visible;
    background: #2f8dce;
    pointer-events: auto;
    align-items: stretch;
    transition: width .2s ease, opacity .2s ease;
  }

  .fsf-menu-overlay.is-desktop-collapsed {
    width: 0;
    opacity: 0;
    pointer-events: none;
  }

  .fsf-menu-drawer {
    width: 180px;
    max-width: none;
    height: 100%;
    max-height: none;
    padding: 12px 6px;
    border-radius: 0;
    background: #2f8dce;
    overflow-y: auto;
    transform: none;
    transition: none;
  }

  .fsf-menu-header {
    padding: 0 6px 10px;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
  }

  .fsf-menu-header { display: none; }
  .fsf-menu-header button { display: none; }

  .fsf-menu-grid[hidden] { display: grid !important; }
  .fsf-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 3px;
  }

  .fsf-menu-entry {
    min-height: 0;
    height: auto;
    aspect-ratio: auto;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 9px 2px;
    border: 1px solid transparent;
    border-radius: 4px;
    color: #f7fbff;
    background: rgba(18, 74, 112, .42);
    text-align: center;
  }

  .fsf-menu-entry[hidden] { display: none !important; }
  .fsf-menu-entry:hover,
  .fsf-menu-entry:focus-visible { background: #266b94; color: #fff; }
  .fsf-menu-entry .fsf-menu-icon { width: 18px; height: 18px; filter: brightness(0) invert(1); }
  .fsf-menu-entry span:last-child { font-size: 12px; font-weight: 600; white-space: nowrap; }

  .fsf-menu-overlay.is-guest-menu,
  .fsf-menu-overlay.is-compact-menu { align-items: stretch; justify-content: flex-start; background: #2f8dce; pointer-events: auto; }
  .fsf-menu-overlay.is-guest-menu .fsf-menu-drawer,
  .fsf-menu-overlay.is-compact-menu .fsf-menu-drawer { position: static; width: 180px; max-width: none; box-shadow: none; }
}

