:root {
  --sf-ink: #1f2430;
  --sf-muted: #6d7484;
  --sf-line: #e8ddcd;
  --sf-paper: #fffdf9;
  --sf-sand: #f3ede2;
  --sf-accent: #b66a2d;
  --sf-accent-deep: #8a4a19;
  --sf-wine: #7d2d25;
  --sf-shadow: 0 16px 40px rgba(73, 48, 22, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html,
body {
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  color: var(--sf-ink);
  background:
    radial-gradient(circle at top left, rgba(182, 106, 45, 0.16), transparent 28%),
    linear-gradient(180deg, #f8f3ea 0%, #f4efe7 38%, #f7f4ef 100%);
}

button,
input {
  font: inherit;
}

.sf-header {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
  pointer-events: none;
}

.sf-header.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.sf-store-pill {
  position: fixed;
  top: 8px;
  left: 50%;
  pointer-events: auto;
  transform: translateX(-50%);
  transition: transform 0.2s ease;
}

.sf-back {
  border: 1px solid rgba(182, 106, 45, 0.18);
  background: rgba(255, 255, 255, 0.82);
  color: var(--sf-accent-deep);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
}

.sf-store-pill,
.sf-header-lang {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 4px 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 4px 14px rgba(73, 48, 22, 0.08);
  backdrop-filter: blur(16px);
}

/* 经销商首页顶部工具模块保持无边框，与页面内容连成一体。 */
.sf-sticky-search {
  border: 0;
  box-shadow: none;
}

.sf-store-pill {
  min-width: 0;
  max-width: min(62vw, 300px);
  white-space: nowrap;
}

.sf-header-lang {
  position: fixed;
  top: 8px;
  right: 10px;
  flex: 0 0 auto;
  padding: 4px 8px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.sf-header:not(.is-top) .sf-header-lang {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.sf-header-lang .i18n-switch {
  width: 32px !important;
  min-width: 32px !important;
  max-width: 32px !important;
  height: 32px;
  min-height: 32px;
  padding: 0 0 0 26px !important;
  border: 0 !important;
  border-radius: 50% !important;
  appearance: none;
  color: transparent !important;
  background: transparent !important;
  cursor: pointer;
}

.sf-lang-inline .i18n-lang-btn {
  width: 36px !important;
  min-width: 36px !important;
  height: 36px !important;
  min-height: 36px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: transparent url('/assets/icons/yuyan.png') center / 24px 24px no-repeat !important;
  box-shadow: none !important;
  color: transparent !important;
  font-size: 0 !important;
  text-indent: -9999px;
  overflow: hidden;
  cursor: pointer;
}

.sf-lang-inline .i18n-lang-btn:hover,
.sf-lang-inline .i18n-lang-btn:focus-visible {
  box-shadow: none !important;
  outline: 2px solid rgba(182, 106, 45, 0.28);
  outline-offset: 2px;
}

/* 语言展开栏按选项文字宽度收缩，不占用多余横向空间。 */
.sf-lang-inline .i18n-lang-menu {
  left: auto !important;
  right: -12px !important;
  min-width: 0 !important;
  width: max-content !important;
  max-width: calc(100vw - 16px);
  display: none;
}

.sf-lang-inline .i18n-lang-option {
  display: block !important;
  width: auto !important;
  min-width: 0;
  white-space: nowrap;
}

.sf-header-lang::before {
  content: "\1F310";
  position: absolute;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(182, 106, 45, 0.2);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--sf-accent-deep);
  font-size: 18px;
  pointer-events: none;
}

.sf-header-kicker {
  display: none;
}

.sf-section-kicker,
.sf-hero-eyebrow {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sf-muted);
}

.sf-store-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--sf-accent-deep);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sf-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 56px 10px 58px;
}

.sf-cover-wrap {
  width: calc(100% + 20px);
  aspect-ratio: 21 / 9;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  margin-left: -10px;
  margin-bottom: 12px;
  background: var(--sf-sand);
  box-shadow: none;
}

.sf-cover-img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 0;
  object-fit: cover;
}

.sf-loading,
.sf-error {
  padding: 48px 16px;
  text-align: center;
  color: var(--sf-muted);
}

.sf-error { color: #bf3f31; }

.sf-section {
  display: grid;
  gap: 0;
}

.sf-hero-card,
.sf-section-block {
  border: 1px solid rgba(182, 106, 45, 0.12);
  border-radius: 24px;
  background: rgba(255, 253, 249, 0.9);
  box-shadow: var(--sf-shadow);
}

.sf-hero-card {
  display: none;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(122, 53, 24, 0.94), rgba(182, 106, 45, 0.9)),
    linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0));
  color: #fff;
}

.sf-hero-title {
  font-size: clamp(28px, 5vw, 42px);
  margin-top: 8px;
}

.sf-hero-desc {
  max-width: 640px;
  margin-top: 12px;
  line-height: 1.7;
  color: rgba(255,255,255,0.88);
}

.sf-retail-link {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.28);
  color: #fff;
  text-decoration: none;
}

.sf-carousel-shell,
.sf-search-panel,
.sf-activity-section {
  padding: 0;
}

.sf-section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 2px;
}

.sf-section-title {
  font-size: 14px;
  font-weight: 600;
  margin-top: 4px;
}

.sf-product-recommend-title {
  display: inline-block;
  margin: 0 0 0 4px;
  padding: 2px 12px;
  color: var(--sf-accent-deep);
  font-size: 14px;
  font-weight: 700;
}

.sf-carousel-shell {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: linear-gradient(180deg, rgba(248, 243, 234, 0.98) 0%, rgba(248, 243, 234, 0.92) 82%, rgba(248, 243, 234, 0) 100%);
}

.sf-carousel-controls {
  display: none;
}

.sf-carousel-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--sf-line);
  background: #fff;
  color: var(--sf-accent-deep);
  cursor: pointer;
}

.sf-carousel {
  overflow: hidden;
}

.sf-legacy-carousel {
  display: none;
}

.sf-carousel-track {
  display: flex;
  transition: transform 0.28s ease;
  will-change: transform;
}

.sf-carousel-page {
  min-width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.sf-carousel-dots {
  display: none;
}

.sf-carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background: rgba(182, 106, 45, 0.22);
  cursor: pointer;
}

.sf-carousel-dot.is-active {
  background: var(--sf-accent);
}

.sf-search-panel {
  display: grid;
  gap: 8px;
}

.sf-search-form,
.sf-image-search {
  display: grid;
  gap: 6px;
}

.sf-search-label {
  font-size: 14px;
  font-weight: 600;
}

.sf-search-row,
.sf-image-actions {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
}

.sf-search-row .sf-search-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.sf-search-input {
  flex: 1 1 auto;
  min-height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--sf-line);
  background: #fff;
}

.sf-search-row .sf-search-wrap .sf-search-input {
  width: 100%;
  padding: 0 44px 0 14px;
}

.sf-search-submit,
.sf-image-trigger,
.sf-image-submit {
  min-height: 46px;
  padding: 0 18px;
  border: none;
  border-radius: 12px;
  background: var(--sf-accent);
  color: #fff;
  cursor: pointer;
}

.sf-image-submit {
  display: none;
}

.sf-search-submit {
  display: none;
}

.sf-image-trigger {
  flex: 0 0 46px;
  padding: 0;
  font-size: 20px;
  background: var(--sf-accent-deep);
}

/* 相机按钮：位于搜索输入框内部右侧，无外框 */
.sf-search-row .sf-image-trigger {
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--sf-muted);
}

.sf-image-input {
  display: none;
}

.sf-image-search {
  display: none;
}

.sf-image-hint,
.sf-image-status {
  font-size: 12px;
  font-weight: 500;
  color: var(--sf-muted);
}

.sf-image-results,
.sf-campaign-list,
.sf-product-grid {
  display: grid;
  gap: 6px;
}

.sf-image-results {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

#imageSearchStatus:empty,
#imageSearchResults:empty {
  display: none;
}

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

.sf-category-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sf-category-chip,
.sf-all-link {
  text-decoration: none;
}

.sf-category-chip {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--sf-line);
  color: var(--sf-ink);
  background: #fff;
}

.sf-all-link {
  color: var(--sf-accent-deep);
}

.sf-product-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.sf-product-card,
.sf-campaign-card,
.sf-image-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid rgba(182, 106, 45, 0.14);
  background: #fff;
  cursor: pointer;
  position: relative;
}

.sf-card-a11y {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sf-image-only-card .sf-product-info {
  display: none;
}

.sf-secondary-section {
  display: none;
}

.sf-product-img-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--sf-sand);
}

.sf-product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sf-product-info {
  padding: 9px;
}

.sf-product-title,
.sf-campaign-title {
  font-size: 15px;
  line-height: 1.5;
}

.sf-product-code,
.sf-product-meta,
.sf-product-stats,
.sf-campaign-meta,
.sf-image-meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--sf-muted);
}

.sf-product-price,
.sf-campaign-price,
.sf-image-price {
  margin-top: 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--sf-wine);
}

.sf-product-price .sf-price-empty { color: var(--sf-muted); font-weight: 400; }

.sf-campaign-badge,
.sf-image-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--sf-accent-deep);
  background: rgba(182, 106, 45, 0.12);
}

.sf-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  height: calc(52px + env(safe-area-inset-bottom, 0px));
  align-items: flex-start;
  display: flex;
  background: #D4E4BC;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
  border-top: 1px solid #B8CF96;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.sf-footer #btnLogout { color: #777; }
.sf-footer #btnLogin .nav-icon-img, .sf-footer #btnLogout .nav-icon-img { filter: none; opacity: 1; }
.sf-footer #btnLogin:not([data-auth-state="account"]) .nav-icon-img, .sf-footer #btnLogout:not([data-auth-state="account"]) .nav-icon-img { filter: grayscale(1); opacity: .7; }
.sf-footer #btnLogin[data-auth-state="guest"] .nav-icon-img, .sf-footer #btnLogout[data-auth-state="guest"] .nav-icon-img { filter: none; opacity: 1; }
.sf-footer #btnLogout.is-guest-authenticated { color: #777; }
.sf-footer #btnLogout.is-guest-authenticated .nav-icon-img { filter: none; opacity: 1; }
.sf-footer #btnLogout.is-account-authenticated .nav-icon-img { filter: none; opacity: 1; }

.sf-foot-btn {
  min-width: 88px;
  min-height: 42px;
  border-radius: 999px;
  border: 1px solid var(--sf-line);
  background: #fff;
  color: var(--sf-accent-deep);
  cursor: pointer;
}

@media (max-width: 900px) {
  .sf-carousel-page {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .sf-main {
    padding-inline: 6px;
  }

  .sf-hero-card,
  .sf-section-block {
    border-radius: 14px;
  }

  .sf-hero-card,
  .sf-section-head {
    flex-direction: column;
    align-items: stretch;
  }

  .sf-carousel-page,
  .sf-product-grid,
  .sf-image-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .sf-product-title,
  .sf-campaign-title {
    font-size: 13px;
  }

  .sf-product-price,
  .sf-campaign-price,
  .sf-image-price {
    font-size: 15px;
  }

  .sf-search-row,
  .sf-image-actions {
    gap: 6px;
  }

  .sf-search-input {
    min-width: 0;
    flex-basis: 0;
  }

  .sf-search-submit,
  .sf-image-trigger,
  .sf-image-submit {
    min-height: 42px;
    padding-inline: 12px;
  }
}

.dealer-user-area,
.dealer-nav-item {
  min-width: 0;
}

.dealer-user-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dealer-nav-item {
  flex: 1;
  height: 52px;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2px;
  gap: 0;
  border: 0;
  background: transparent;
  color: #5a7340;
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
}

.dealer-nav-item.is-active,
.dealer-nav-item:focus-visible,
.dealer-nav-item:hover {
  color: #5a7340;
}

.dealer-nav-icon {
  font-size: 18px;
  margin-bottom: 1px;
  line-height: 1;
}

.dealer-nav-label {
  font-size: 12px;
}
.dealer-nav-label { color: #000; }

.dealer-user-name {
  display: none !important;
}

.dealer-login-overlay,
.dealer-menu-overlay,
.dealer-qrcode-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(31, 36, 48, 0.38);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.dealer-login-overlay.is-open,
.dealer-menu-overlay.is-open,
.dealer-qrcode-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* 登录弹窗贴近顶部，使顶部间距与左右两侧的 16px 保持一致 */
.dealer-login-overlay {
  align-items: flex-start;
}

.dealer-login-dialog {
  position: relative;
  width: min(100%, 380px);
  padding: 24px;
  border-radius: 20px;
  background: var(--sf-paper);
  box-shadow: var(--sf-shadow);
}

.dealer-login-dialog h2 {
  margin-bottom: 8px;
  color: var(--sf-accent-deep);
  text-align: center;
}

.dealer-login-dialog form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
}

.dealer-login-dialog p {
  color: var(--sf-muted);
  font-size: 13px;
  line-height: 1.6;
}

.dealer-login-label {
  grid-column: 1;
  margin-top: 12px;
  margin-bottom: 4px;
  display: block;
  height: auto;
  text-align: left;
  color: var(--sf-ink);
  font-size: 13px;
}

.dealer-login-input {
  grid-column: 1;
  display: block;
  width: 92%;
  justify-self: center;
  height: 44px !important;
  min-height: 44px !important;
  margin-top: 0;
  padding: 0 12px;
  border: 1px solid var(--sf-line);
  border-radius: 12px;
  background: #fff;
  color: var(--sf-ink);
  /* iOS Safari zooms the page when a focused input is smaller than 16px. */
  font-size: 16px;
  outline: none;
  visibility: visible !important;
  opacity: 1 !important;
}

.dealer-login-input:focus {
  border-color: var(--sf-accent);
  box-shadow: 0 0 0 3px rgba(182, 106, 45, 0.12);
}

.dealer-password-field {
  grid-column: 1;
  position: relative;
  display: block;
  width: 92%;
  justify-self: center;
  margin-top: 0;
}

.dealer-password-field .dealer-login-input {
  margin-top: 0;
  padding-right: 44px;
  width: 100%;
}

.dealer-password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--sf-muted);
  cursor: pointer;
  transform: translateY(-50%);
}

.dealer-password-toggle:hover {
  color: var(--sf-accent-deep);
}

.dealer-login-options {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 12px;
}

.dealer-login-check {
  display: inline-flex !important;
  align-items: center;
  gap: 5px !important;
  margin-top: 0 !important;
  font-size: 12px !important;
  white-space: nowrap;
}

.dealer-login-check input {
  width: 16px;
  height: 16px !important;
  min-height: 16px !important;
  margin: 0;
}

.dealer-forgot-password {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--sf-accent-deep);
  cursor: pointer;
  font-size: 12px;
}

.dealer-login-close,
.dealer-menu-header button {
  border: 0;
  background: transparent;
  color: var(--sf-muted);
  cursor: pointer;
  font-size: 24px;
}

.dealer-login-close {
  position: absolute;
  top: 12px;
  right: 16px;
}

.dealer-login-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}

.dealer-login-actions button,
.dealer-menu-grid button,
.dealer-menu-link {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--sf-line);
  border-radius: 12px;
  background: #fff;
  color: var(--sf-ink);
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.dealer-login-actions button {
  flex: 0 0 auto;
  min-width: 0;
  padding: 0 28px;
}

.dealer-login-actions .is-primary {
  border-color: var(--sf-accent);
  background: var(--sf-accent);
  color: #fff;
}

.dealer-login-message {
  margin-top: 10px;
}

.dealer-login-message.is-error {
  color: #bf3f31;
}

.dealer-login-message.is-success {
  color: #287a4a;
}

/* ==================== 找回密码（独立模态框：左上角"返回"按钮） ==================== */
.dealer-forgot-back {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 1;
  border: 0;
  background: transparent;
  color: var(--sf-accent-deep);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  padding: 2px;
  line-height: 1;
}

.dealer-forgot-back:hover {
  text-decoration: underline;
}

.dealer-forgot-tip {
  text-align: center;
}

.dealer-code-field {
  grid-column: 1;
  display: flex;
  gap: 8px;
  width: 92%;
  justify-self: center;
}

.dealer-code-field .dealer-login-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  margin-top: 0;
}

.dealer-code-btn {
  flex-shrink: 0;
  min-width: 96px;
  min-height: 44px;
  border: 1px solid var(--sf-accent);
  border-radius: 12px;
  background: #fff;
  color: var(--sf-accent-deep);
  font-size: 13px;
  padding: 0 10px;
  cursor: pointer;
}

.dealer-code-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.dealer-menu-overlay {
  align-items: flex-end;
  padding: 0;
}

.dealer-menu-drawer {
  width: 100%;
  max-width: none;
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  border-radius: 20px 20px 0 0;
  background: var(--sf-paper);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
  transform: translateY(100%);
  transition: transform 0.14s ease;
  will-change: transform;
}

.dealer-menu-overlay.is-guest-drawer .dealer-menu-drawer {
  position: absolute;
  right: 6px;
  bottom: calc(58px + env(safe-area-inset-bottom));
  margin: 0;
  width: max-content;
  max-width: calc(100vw - 24px);
  align-self: flex-end;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}

.dealer-menu-overlay.is-guest-drawer {
  justify-content: flex-end;
}

.dealer-menu-overlay.is-open .dealer-menu-drawer {
  transform: translateY(0);
}

.dealer-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--sf-line);
  color: var(--sf-accent-deep);
  font-weight: 700;
}

.dealer-menu-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding-top: 6px;
}

/* 退出登录后的游客菜单：单列按钮展示；经销商登录态保持五列网格。 */
.dealer-menu-grid.is-guest-menu {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: max-content;
  max-width: calc(100vw - 24px);
}

.dealer-menu-grid.is-guest-menu .guest-menu-entry {
  width: fit-content;
  min-width: 0;
  max-width: 100%;
  min-height: 42px;
  aspect-ratio: auto;
  flex-direction: row;
  justify-content: flex-start;
  gap: 10px;
  padding: 8px 12px;
  text-align: left;
}

.dealer-menu-grid.is-guest-menu .guest-menu-entry .nav-icon-img {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
}

.dealer-menu-entry {
  display: flex;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 1 / 1;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--sf-line);
  border-radius: 12px;
  background: #fff;
  color: var(--sf-ink);
  cursor: pointer;
  text-align: center;
  font-size: 12px;
  line-height: 1.2;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.dealer-menu-entry span:last-child {
  overflow-wrap: anywhere;
  line-height: 1.15;
}

.dealer-menu-entry[hidden] {
  display: none;
}

/* Override the legacy generic button padding so the five-column home drawer
   uses the same available label width as the product-detail drawer. */
.dealer-menu-grid .dealer-menu-entry {
  min-height: 0;
  padding: 6px;
}

.dealer-menu-icon {
  display: block;
  font-size: 28px;
  line-height: 1;
}

#menuOrders,
#navProductManage {
  display: none !important;
}

@media (max-width: 768px) {
  .dealer-menu-entry,
  .dealer-menu-drawer,
  .dealer-menu-overlay {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
  .dealer-menu-entry {
    box-shadow: none !important;
    transition: none !important;
  }
}

@media (max-width: 390px) {
  .sf-footer {
    gap: 0;
    padding-inline: 0;
  }

  .dealer-nav-label {
    font-size: 12px;
  }

  .dealer-nav-icon {
    font-size: 18px;
  }

  .sf-search-submit,
  .sf-image-trigger,
  .sf-image-submit {
    padding-inline: 9px;
  }

  .dealer-menu-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
  }

  .dealer-menu-entry {
    min-height: 0;
    font-size: 12px;
  }

  .dealer-menu-grid .dealer-menu-entry {
    padding: 6px;
  }

  .dealer-menu-icon {
    font-size: 26px;
  }
}

/* ==================== 右下角悬浮按钮组（置顶 + 二维码，导航上方 6px） ==================== */
.sf-float-group {
  position: fixed;
  /* 宽屏下与正文列（max-width 1100px）右侧对齐，窄屏贴右 6px */
  right: max(6px, calc((100vw - 1100px) / 2 + 6px));
  /* 导航栏高 52px + 安全区；按钮组底边距导航顶 6px */
  bottom: calc(58px + env(safe-area-inset-bottom));
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.sf-float-btn {
  width: 40px;
  height: 40px;
  border-radius: 15px;
  border: 1px solid rgba(46, 101, 89, .18);
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 5px 14px rgba(31, 67, 59, .18);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.sf-float-btn:active {
  transform: scale(.94);
  box-shadow: 0 2px 6px rgba(31, 67, 59, .16);
}

/* 置顶入口使用独立按钮面板和文字，避免火箭图标在页面图片上不明显。 */
#ufoReset {
  flex-direction: column;
  gap: 0;
  color: #fff;
  background: linear-gradient(145deg, #438f7e, #2e6559);
  border-color: #2e6559;
  box-shadow: 0 6px 16px rgba(46, 101, 89, .34);
}

#ufoReset:active {
  background: linear-gradient(145deg, #397967, #28594f);
}

#ufoReset .sf-float-label {
  font-size: 9px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .06em;
}

.sf-float-icon {
  display: block;
  width: 24px;
  height: 24px;
}

#btnQrcode .sf-float-icon {
  width: 20px;
  height: 20px;
  opacity: .62;
  filter: grayscale(1) brightness(1.38);
}

/* 火箭图标在深色按钮上保持完整轮廓。 */
#ufoReset .sf-float-icon {
  width: 22px;
  height: 22px;
}

/* ==================== 店铺二维码弹窗（标题居中、四边留白均匀，微信扫一扫直达） ==================== */
.dealer-qrcode-overlay {
  align-items: center;
}

.dealer-qrcode-dialog {
  position: relative;
  width: min(100%, 380px);
  padding: 24px;
  border-radius: 20px;
  background: var(--sf-paper);
  box-shadow: var(--sf-shadow);
}

.dealer-qrcode-dialog .dealer-qrcode-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-bottom: 12px;
}

/* 标题占中间列，水平居中；关闭按钮占右侧列，位于右上 */
.dealer-qrcode-dialog .dealer-qrcode-header span {
  grid-column: 2;
  justify-self: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--sf-accent-deep);
  text-align: center;
}

.dealer-qrcode-dialog .dealer-qrcode-header button {
  grid-column: 3;
  justify-self: end;
  border: none;
  background: none;
  font-size: 22px;
  line-height: 1;
  color: var(--sf-muted);
  cursor: pointer;
  padding: 0;
}

.dealer-qrcode-box {
  display: flex;
  justify-content: center;
  padding: 0;
}

.dealer-qrcode-box canvas,
.dealer-qrcode-box img {
  display: block;
  max-width: 100%;
}

.dealer-qrcode-tip {
  font-size: 13px;
  color: var(--sf-muted);
  text-align: center;
  margin: 12px 0 0;
}

/* G-20 unified nav icon */
.nav-icon-img { width: 22px; height: 22px; display: block; }
.btn-back, .dpm-back, .r-back, .rm-back, .dl-btn-back, .preview-back, .dealer-forgot-back, .sf-image-trigger { display: flex; align-items: center; justify-content: center; }

/* 底部「首页」选择面板（P-WEB-HOME-01） */
.dl-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;
}

.dl-home-panel-overlay.open {
  display: flex;
}

.dl-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: dl-home-panel-up 0.22s ease;
}

@keyframes dl-home-panel-up {
  from {
    transform: translateY(24px);
    opacity: 0.6;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.dl-home-panel-handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: #d9d9d9;
  margin: 0 auto 10px;
}

.dl-home-panel-title {
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: #333;
  margin-bottom: 14px;
}

.dl-home-panel-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.dl-home-panel-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  border: 1px solid #e3ebe8;
  border-radius: 12px;
  padding: 16px 10px;
  background: #fff;
}

.dl-home-panel-option:active {
  border-color: #3a7d6e;
}

.dl-home-panel-option.current {
  border-color: #3a7d6e;
  background: #f0f7f4;
}

.dl-home-panel-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.dl-home-panel-name {
  font-size: 14px;
  font-weight: 600;
  color: #2e6559;
}

.dl-home-panel-desc {
  font-size: 12px;
  color: #999;
}

.dl-home-panel-cancel {
  width: 100%;
  padding: 12px 0;
  border-radius: 10px;
  background: #f2f5f4;
  color: #666;
  font-size: 15px;
}
.dealer-login-switch{display:flex;gap:8px;margin:0 0 14px;padding:3px;border-radius:8px;background:#f3f5f8}.dealer-login-switch span,.dealer-login-switch a{flex:1;padding:7px;text-align:center;border-radius:6px;text-decoration:none;font-size:13px}.dealer-login-switch span.is-active{background:#bd6b2d;color:#fff}.dealer-login-switch a{color:#657184}
.dealer-nav-item{position:relative}
#navContact.has-chat-unread .nav-icon-img{animation:chat-contact-icon-pulse 1s ease-in-out infinite}@keyframes chat-contact-icon-pulse{50%{transform:scale(1.14);opacity:.55}}
