/* AI扬帆 customer display modes, 2026-10-11.
   Loaded only on customer pages. All overrides require the opt-in root attribute.
   This stylesheet changes layout only; product, session and payment data stay shared. */

html[data-ayf-display] body:not([data-page="admin"]) {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html[data-ayf-display] :is(.site-main, .tutorial-page, .industry-page, .support-shell) {
  min-width: 0;
  box-sizing: border-box;
}
html[data-ayf-display] :is(.purchase-content, .catalog-section, .yf-account-workspace,
  .support-main, .tutorial-content-card, .industry-hero-copy, .oq-workspace) {
  min-width: 0;
}
html[data-ayf-display] :is(.detail-content, .tutorial-rich-text, .yf-orders-delivery-content,
  .agent-program-link, .notification-email, .message-body, .email-recipient) {
  overflow-wrap: anywhere;
}
html[data-ayf-display] :is(.detail-content, .tutorial-rich-text, .industry-page) :is(img, video) {
  max-width: 100%;
}
html[data-ayf-display] :is(.desktop-nav, .category-list, .yf-account-sidebar-nav) {
  -webkit-overflow-scrolling: touch;
}

/* Compact mode deliberately stays compact on a large monitor too. */
html[data-ayf-display="mobile"] {
  --ayf-reading-width: 680px;
  scroll-padding-top: 150px;
}
html[data-ayf-display="mobile"] body[data-page] {
  --site-header-height: 116px;
  padding-top: calc(var(--site-header-height) + var(--site-ticker-height, 0px));
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}
html[data-ayf-display="mobile"] #site-header .site-header {
  height: 116px;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: 58px 52px;
  gap: 0 8px;
  padding: 0 max(12px, calc((100vw - 680px) / 2));
  overflow: hidden;
}
html[data-ayf-display="mobile"] #site-header .site-header > .brand {
  grid-column: 1 / -1;
  grid-row: 1;
  gap: 8px;
  max-width: calc(100% - 154px);
  min-width: 0;
}
html[data-ayf-display="mobile"] #site-header .site-header .brand-mark {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
}
html[data-ayf-display="mobile"] #site-header .site-header .brand strong { font-size: 17px; }
html[data-ayf-display="mobile"] #site-header .site-header .brand small { font-size: 8px; letter-spacing: 0; }
html[data-ayf-display="mobile"] #site-header .site-header .desktop-nav {
  display: flex !important;
  grid-column: 1;
  grid-row: 2;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  justify-content: flex-start;
  gap: 5px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 0 5px;
  scrollbar-width: thin;
}
html[data-ayf-display="mobile"] .desktop-nav :is(a, button) {
  display: inline-flex !important;
  flex: 0 0 auto;
  min-height: 42px;
  padding: 9px 11px;
  font-size: 13px;
  line-height: 1.4;
}
html[data-ayf-display="mobile"] #site-header .site-header .header-actions {
  display: flex !important;
  grid-column: 2;
  grid-row: 2;
  gap: 5px;
}
html[data-ayf-display="mobile"] .header-actions :is(.desktop-message-entry, .desktop-auth-entry) {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 42px;
}
/* These are duplicate entries; their full controls remain in the top navigation. */
html[data-ayf-display="mobile"] .header-actions :is(.growth-entry-mobile, .mobile-announcement-entry, .mobile-account-entry),
html[data-ayf-display="mobile"] .mobile-nav { display: none !important; }
html[data-ayf-display="mobile"] .site-ticker { width: min(680px, calc(100% - 24px)); }
html[data-ayf-display="mobile"] body :is(.site-main, .site-main.inner-main, .tutorial-page, .industry-page) {
  width: min(var(--ayf-reading-width), 100%) !important;
  max-width: var(--ayf-reading-width) !important;
  margin-inline: auto;
  padding: 22px 14px 72px;
}
html[data-ayf-display="mobile"] :is(.home-heading, .page-hero, .industry-hero, .tutorial-index-hero) {
  min-width: 0;
  margin-bottom: 20px;
}
html[data-ayf-display="mobile"] :is(.home-heading, .industry-hero) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}
html[data-ayf-display="mobile"] :is(.home-heading h1, .page-hero h1, .industry-hero h1, .tutorial-index-hero h1, .tutorial-detail-hero h1) {
  font-size: clamp(26px, 6.2vw, 34px);
  line-height: 1.4;
  overflow-wrap: anywhere;
}
html[data-ayf-display="mobile"] :is(.home-heading p, .page-hero p, .tutorial-index-hero p, .industry-hero p) {
  font-size: 14px;
  line-height: 1.75;
}

/* Store: a visible category strip, then one product per row. */
html[data-ayf-display="mobile"] .catalog-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
html[data-ayf-display="mobile"] .category-panel { display: block; position: static; width: 100%; }
html[data-ayf-display="mobile"] .category-panel > header { padding: 12px 15px; }
html[data-ayf-display="mobile"] .category-panel > header h2 { font-size: 19px; }
html[data-ayf-display="mobile"] .category-panel .category-list {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 7px;
  padding: 10px;
}
html[data-ayf-display="mobile"] .category-panel .category-item { flex: 0 0 auto; width: auto; min-height: 46px; }
html[data-ayf-display="mobile"] .category-item > span { font-size: 13px; }
html[data-ayf-display="mobile"] .mobile-category-button { display: none; }
html[data-ayf-display="mobile"] .home-heading-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  width: 100%;
  gap: 8px;
}
html[data-ayf-display="mobile"] .home-heading-actions .search-field { width: 100%; min-width: 0; height: 46px; }
html[data-ayf-display="mobile"] .share-store-button { min-height: 46px; min-width: 0; font-size: 12px; padding-inline: 11px; }
html[data-ayf-display="mobile"] .product-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 15px; }
html[data-ayf-display="mobile"] .product-card { min-height: 230px; padding: 20px; }
html[data-ayf-display="mobile"] .product-card h3 { min-height: 0; font-size: 20px; line-height: 1.5; margin: 14px 0 10px; }
html[data-ayf-display="mobile"] .product-card :is(.product-tags, .product-subtitle) { flex-wrap: wrap; font-size: 12px; }
html[data-ayf-display="mobile"] .product-card footer { gap: 9px; flex-wrap: wrap; }

/* Product: same form and handlers, vertically stacked. */
html[data-ayf-display="mobile"] body[data-page="product"] .yf-product-purchase-card:not(.order-created) {
  display: block !important;
  grid-template-columns: minmax(0, 1fr) !important;
  padding: 0 !important;
}
html[data-ayf-display="mobile"] body[data-page="product"] .yf-product-purchase-card:not(.order-created) > .product-hero-cover {
  display: grid !important;
  place-items: center;
  position: relative !important;
  width: 100% !important;
  height: 158px !important;
  min-height: 158px !important;
  margin: 0 !important;
  padding: 20px !important;
  border: 0 !important;
  border-bottom: 1px solid var(--line) !important;
}
html[data-ayf-display="mobile"] body[data-page="product"] .yf-product-purchase-card:not(.order-created) > .product-hero-cover img {
  position: static !important;
  width: 112px !important;
  height: 112px !important;
  margin: 0 !important;
  object-fit: contain !important;
}
html[data-ayf-display="mobile"] body[data-page="product"] .yf-product-purchase-card > .purchase-content {
  display: block !important;
  width: 100% !important;
  padding: 20px 17px !important;
}
html[data-ayf-display="mobile"] body[data-page="product"] .purchase-content > h1 {
  display: block !important;
  font-size: 24px !important;
  line-height: 1.45 !important;
  margin: 0 0 12px !important;
}
html[data-ayf-display="mobile"] .purchase-offer-row { grid-template-columns: minmax(0, 1fr); gap: 14px; }
html[data-ayf-display="mobile"] .purchase-tags { display: flex !important; flex-wrap: wrap; gap: 7px !important; }
html[data-ayf-display="mobile"] .product-agent-promo { min-width: 0; flex-wrap: wrap; }
html[data-ayf-display="mobile"] .product-agent-promo em { white-space: normal; }
html[data-ayf-display="mobile"] .product-order-form { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; gap: 16px !important; }
html[data-ayf-display="mobile"] .product-order-form > * { min-width: 0; grid-column: 1 !important; }
html[data-ayf-display="mobile"] .product-variant-picker > div { grid-template-columns: minmax(0, 1fr); }
html[data-ayf-display="mobile"] .product-variant-copy { min-width: 0; white-space: normal; }
html[data-ayf-display="mobile"] .product-variant-copy b { font-size: 14px; }
html[data-ayf-display="mobile"] .product-variant-copy small { font-size: 12px; white-space: normal; }
html[data-ayf-display="mobile"] .quantity-stepper { width: 100%; height: 46px !important; }
html[data-ayf-display="mobile"] .product-description-card .detail-content { padding: 22px 17px; }
html[data-ayf-display="mobile"] .product-purchase-card.order-created .checkout-success { width: calc(100% - 24px); padding-inline: 14px; }
html[data-ayf-display="mobile"] :is(.yf-payment-options, .checkout-coupon-selector) { grid-template-columns: minmax(0, 1fr) !important; }

/* Reading, lookup, customer account, and referral pages. */
html[data-ayf-display="mobile"] :is(.tutorial-layout, .tutorial-index-grid, .industry-grid,
  .education-audience-grid, .agent-plan-grid, .agent-program-codes, .yf-commission-levels,
  .yf-referral-rule-grid, .yf-referral-examples, .agent-amount-overview, .yf-commission-amount-grid,
  .yf-account-shell, .yf-account-activity-list, .yf-orders-workspace, .yf-account-profile-rows,
  .yf-account-profile-list, .yf-account-actions, .yf-account-shortcuts) {
  grid-template-columns: minmax(0, 1fr) !important;
  min-width: 0;
}
html[data-ayf-display="mobile"] :is(.agent-plan-card-core, .yf-core-tier) { grid-column: auto; }
html[data-ayf-display="mobile"] :is(.tutorial-index-panel > header, .tutorial-detail-hero, .tutorial-content-card,
  .industry-hero, .industry-card, .agent-program-panel, .yf-account-panel, .oq-workspace) {
  padding: 21px 17px;
}
html[data-ayf-display="mobile"] :is(.tutorial-hero-actions, .industry-hero-actions,
  .agent-program-header, .agent-referral-summary > header, .yf-account-topbar,
  .yf-account-welcome-card, .oq-search-head) {
  display: flex;
  align-items: stretch;
  flex-direction: column;
  gap: 12px;
}
html[data-ayf-display="mobile"] .industry-orbit { margin-inline: auto; max-width: 100%; }
html[data-ayf-display="mobile"] .tutorial-rich-text { font-size: 16px; line-height: 1.85; }
html[data-ayf-display="mobile"] .tutorial-rich-text pre { max-width: 100%; overflow-x: auto; }
html[data-ayf-display="mobile"] .tutorial-rich-text table { display: block; max-width: 100%; overflow-x: auto; }
html[data-ayf-display="mobile"] :is(.agent-program-codes, .agent-program-code) { min-width: 0; width: 100%; text-align: left; }
html[data-ayf-display="mobile"] .agent-program-code button { justify-self: start; }
html[data-ayf-display="mobile"] .yf-account-sidebar { position: static; min-height: 0; padding: 16px 13px; }
html[data-ayf-display="mobile"] .yf-account-sidebar-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
html[data-ayf-display="mobile"] .yf-account-sidebar-nav a { min-height: 44px; }
html[data-ayf-display="mobile"] :is(.yf-account-top-actions, .yf-account-quick-grid,
  .yf-account-stat-grid, .yf-account-stat-grid-three, .yf-account-stat-grid-five,
  .yf-orders-meta-grid, .agent-referral-stats) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html[data-ayf-display="mobile"] :is(.yf-orders-list-panel, .yf-orders-detail-panel) { min-height: 0; padding: 20px 16px; }
html[data-ayf-display="mobile"] .yf-orders-detail-head { flex-wrap: wrap; }
html[data-ayf-display="mobile"] .yf-orders-detail-head h3 { font-size: 27px; }
html[data-ayf-display="mobile"] :is(.oq-search-form, .oq-code-form) { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
html[data-ayf-display="mobile"] .oq-help { display: grid; grid-template-columns: minmax(0, 1fr); }

/* Customer support uses its own shell rather than app-v4's header. */
html[data-ayf-display="mobile"] .support-shell { width: min(680px, 100%); max-width: 680px; margin-inline: auto; padding: 0 12px 28px; }
html[data-ayf-display="mobile"] .support-shell > .site-head { padding-top: 12px; min-height: 110px; display: flex; flex-wrap: wrap; align-content: center; gap: 13px; }
html[data-ayf-display="mobile"] .support-shell > .site-head > .brand { width: 100%; padding-right: 154px; box-sizing: border-box; }
html[data-ayf-display="mobile"] .support-shell > .site-head > nav { display: flex; flex-wrap: wrap; gap: 12px; }
html[data-ayf-display="mobile"] .support-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
html[data-ayf-display="mobile"] .support-sidebar { position: static; padding: 20px 17px; }
html[data-ayf-display="mobile"] .support-main { width: 100%; }
html[data-ayf-display="mobile"] :is(.conversation-head, .notification-settings, .composer, .email-panel) { padding-inline: 15px; }
html[data-ayf-display="mobile"] .notification-footer { flex-wrap: wrap; gap: 9px; }
html[data-ayf-display="mobile"] .composer-tools { display: flex; flex-wrap: wrap; gap: 10px; }
html[data-ayf-display="mobile"] .order-control { display: flex; flex: 1 1 100%; min-width: 0; gap: 7px; }
html[data-ayf-display="mobile"] .order-control select { flex: 1; min-width: 0; }
/* Let the page scroll on short screens or while the keyboard is open: the
   composer must never be clipped by the legacy fixed-height conversation. */
html[data-ayf-display="mobile"] .support-shell .conversation { height: auto; min-height: 0; }
html[data-ayf-display="mobile"] .conversation .messages {
  height: clamp(220px, 45vh, 420px);
  height: clamp(220px, 45dvh, 420px);
  min-height: 220px;
  flex: 0 0 auto;
}
html[data-ayf-display="mobile"] .email-recipient { grid-template-columns: minmax(0, 1fr); }

/* Touch sizing and typing avoid iOS's input zoom. Radio/checkbox layout stays native. */
html[data-ayf-display="mobile"] :is(.site-main, .tutorial-page, .industry-page, .support-shell) :is(button, .primary-button, .secondary-button) { min-height: 44px; }
html[data-ayf-display="mobile"] :is(.site-main, .tutorial-page, .industry-page, .support-shell) :is(input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]), select, textarea) {
  min-width: 0;
  max-width: 100%;
  font-size: 16px !important;
}
html[data-ayf-display="mobile"] .customer-service-launcher { right: max(12px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); }
html[data-ayf-display="mobile"] .site-footer { display: flex; flex-direction: column; align-items: flex-start; gap: 17px; width: min(680px, 100%); margin-inline: auto; padding: 25px 16px 90px; }
html[data-ayf-display="mobile"] .site-footer-nav { flex-wrap: wrap; gap: 15px; }

/* Desktop keeps the wide content but gives display controls their own header row.
   Start at 761px, matching the existing site's layout breakpoint (no tablet gap). */
@media (min-width: 761px) {
  html[data-ayf-display="desktop"] { scroll-padding-top: 150px; }
  html[data-ayf-display="desktop"] body[data-page] {
    --site-header-height: 116px;
    padding-top: calc(var(--site-header-height) + var(--site-ticker-height, 0px));
  }
  html[data-ayf-display="desktop"] #site-header .site-header {
    height: 116px;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 58px 52px;
    gap: 0 12px;
    padding: 0 max(24px, 4vw);
  }
  html[data-ayf-display="desktop"] #site-header .site-header > .brand {
    grid-column: 1 / -1;
    grid-row: 1;
    max-width: calc(100% - 154px);
    min-width: 0;
  }
  html[data-ayf-display="desktop"] #site-header .site-header .desktop-nav {
    display: flex !important;
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 0 5px;
    scrollbar-width: thin;
  }
  html[data-ayf-display="desktop"] .desktop-nav :is(a, button) {
    flex: 0 0 auto;
    min-height: 42px;
    font-size: 13px;
    line-height: 1.4;
  }
  html[data-ayf-display="desktop"] #site-header .site-header .header-actions {
    display: flex !important;
    grid-column: 2;
    grid-row: 2;
    gap: 7px;
  }
  html[data-ayf-display="desktop"] .header-actions :is(.desktop-message-entry, .desktop-auth-entry) {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
  }
  html[data-ayf-display="desktop"] .header-actions :is(.growth-entry-mobile, .mobile-announcement-entry, .mobile-account-entry),
  html[data-ayf-display="desktop"] .mobile-nav { display: none !important; }
  html[data-ayf-display="desktop"] .support-shell > .site-head {
    padding-top: 12px;
    min-height: 110px;
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    gap: 13px;
  }
  html[data-ayf-display="desktop"] .support-shell > .site-head > .brand {
    width: 100%;
    padding-right: 154px;
    box-sizing: border-box;
  }
}

/* A narrow screen remains usable when the visitor chooses desktop mode.
   Preserve responsive content but keep all primary entries in the top row. */
@media (max-width: 760px) {
  html[data-ayf-display="desktop"] { scroll-padding-top: 150px; }
  html[data-ayf-display="desktop"] body[data-page] { --site-header-height: 116px; padding-top: calc(116px + var(--site-ticker-height, 0px)); padding-bottom: 24px; }
  html[data-ayf-display="desktop"] #site-header .site-header { height: 116px; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 58px 52px; gap: 0 8px; padding: 0 12px; }
  html[data-ayf-display="desktop"] #site-header .site-header > .brand { grid-column: 1 / -1; grid-row: 1; max-width: calc(100% - 154px); gap: 8px; }
  html[data-ayf-display="desktop"] #site-header .site-header .brand-mark { width: 36px; height: 36px; flex: 0 0 36px; }
  html[data-ayf-display="desktop"] #site-header .site-header .brand strong { font-size: 17px; }
  html[data-ayf-display="desktop"] #site-header .site-header .brand small { font-size: 8px; letter-spacing: 0; }
  html[data-ayf-display="desktop"] #site-header .site-header .desktop-nav { display: flex !important; grid-column: 1; grid-row: 2; min-width: 0; max-width: 100%; justify-content: flex-start; overflow-x: auto; overflow-y: hidden; gap: 5px; padding: 2px 0 5px; scrollbar-width: thin; }
  html[data-ayf-display="desktop"] .desktop-nav :is(a, button) { display: inline-flex !important; flex: 0 0 auto; min-height: 42px; font-size: 12px; padding: 9px 10px; }
  html[data-ayf-display="desktop"] #site-header .site-header .header-actions { display: flex !important; grid-column: 2; grid-row: 2; gap: 5px; }
  html[data-ayf-display="desktop"] .header-actions :is(.desktop-message-entry, .desktop-auth-entry) { display: inline-flex !important; align-items: center; justify-content: center; width: 40px; height: 42px; }
  html[data-ayf-display="desktop"] .header-actions :is(.growth-entry-mobile, .mobile-announcement-entry, .mobile-account-entry),
  html[data-ayf-display="desktop"] .mobile-nav { display: none !important; }
  html[data-ayf-display="desktop"] .support-shell > .site-head { padding-top: 12px; min-height: 110px; display: flex; flex-wrap: wrap; align-content: center; gap: 13px; }
  html[data-ayf-display="desktop"] .support-shell > .site-head > .brand { width: 100%; padding-right: 154px; box-sizing: border-box; }
  html[data-ayf-display="desktop"] .customer-service-launcher { bottom: max(16px, env(safe-area-inset-bottom)); }
  html[data-ayf-display="desktop"] :is(.site-main, .support-shell) :is(input:not([type="radio"]):not([type="checkbox"]):not([type="hidden"]), select, textarea) { font-size: 16px !important; }
}

/* Do not turn login/register into content-heavy pages. Keep their existing flow. */
html[data-ayf-display] body:is([data-page="login"], [data-page="register"], [data-page="forgot-password"]) #site-header .site-header {
  height: 72px;
  grid-template-rows: 72px;
}
html[data-ayf-display] body:is([data-page="login"], [data-page="register"], [data-page="forgot-password"]) {
  --site-header-height: 72px;
  padding-top: 72px;
}
html[data-ayf-display] body:is([data-page="login"], [data-page="register"], [data-page="forgot-password"]) #site-header .site-header :is(.desktop-nav, .header-actions) { display: none !important; }

/* The FAQ is a separate document: its header is a direct body child and remains
   in normal flow, so it must not receive app-shell fixed-header spacing. */
html[data-ayf-display] body > .site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: auto;
  min-height: 116px;
}
html[data-ayf-display] body > .site-header .nav-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 58px auto;
  min-height: 116px;
  gap: 0;
  padding-bottom: 8px;
}
html[data-ayf-display] body > .site-header .nav-inner > .brand {
  max-width: calc(100% - 154px);
  min-width: 0;
  gap: 8px;
}
html[data-ayf-display] body > .site-header .nav-inner > .brand img { flex: 0 0 32px; width: 32px; height: 32px; }
html[data-ayf-display] body > .site-header .nav-inner > .brand span { font-size: 19px; }
html[data-ayf-display] body > .site-header .nav-inner > .brand small { font-size: 8px; letter-spacing: 0; line-height: 1.4; }
html[data-ayf-display] body > .site-header .nav-inner > nav { width: 100%; min-width: 0; overflow-x: auto; justify-content: flex-start; flex-wrap: nowrap; gap: 18px; padding-bottom: 3px; }
html[data-ayf-display] body > .site-header .nav-inner > nav :is(a, span) { display: inline-flex; flex-shrink: 0; white-space: nowrap; }
html[data-ayf-display] body > .site-header .nav-inner > nav a { min-height: 42px; align-items: center; font-size: 13px; }
html[data-ayf-display="mobile"] body > .site-header .nav-inner { width: min(652px, calc(100% - 28px)); }
html[data-ayf-display="mobile"] body > .site-header + .page { width: min(652px, calc(100% - 28px)); }
html[data-ayf-display="mobile"] body > .site-header + .page .hero { display: block; padding: 25px 20px; }
html[data-ayf-display="mobile"] body > .site-header + .page .hero h1 { font-size: 35px; }
html[data-ayf-display="mobile"] body > .site-header + .page .hero-side { width: auto; margin-top: 20px; }
html[data-ayf-display="mobile"] body > .site-header + .page .center-top { display: block; }
html[data-ayf-display="mobile"] body > .site-header + .page .search-box { width: 100%; max-width: none; margin-top: 16px; }
html[data-ayf-display="mobile"] body > .site-header + .page .filters { flex-wrap: nowrap; overflow-x: auto; }
html[data-ayf-display="mobile"] body > .site-header + .page .filter { flex-shrink: 0; white-space: nowrap; min-height: 42px; }
html[data-ayf-display="mobile"] body > .site-header + .page .help-layout { display: block; }
html[data-ayf-display="mobile"] body > .site-header + .page .detail { display: none; }
html[data-ayf-display="mobile"] body > .site-header + .page .help-center.show-detail .question-panel { display: none; }
html[data-ayf-display="mobile"] body > .site-header + .page .help-center.show-detail .detail { display: block; padding: 17px; }
html[data-ayf-display="mobile"] body > .site-header + .page .back-to-list { display: inline-flex; align-items: center; min-height: 44px; }
html[data-ayf-display="mobile"] body > .site-header + .page .quick-grid { grid-template-columns: minmax(0, 1fr); }
html[data-ayf-display="mobile"] body > .site-header + .page .port-row { align-items: flex-start; flex-direction: column; }

@media (prefers-reduced-motion: reduce) {
  html[data-ayf-display] .desktop-nav { scroll-behavior: auto; }
}

/* 2026-10-24: automatic phone layout, compact catalog and bottom navigation.
   These last rules replace the former manually selected single-column mode. */
html[data-ayf-display="mobile"]{--ayf-reading-width:760px;--ayf-bottom-clearance:calc(82px + env(safe-area-inset-bottom));scroll-padding-top:100px;scroll-padding-bottom:var(--ayf-bottom-clearance)}
html[data-ayf-display="mobile"] body[data-page]{--site-header-height:64px;padding-top:calc(64px + var(--site-ticker-height,0px));padding-bottom:0}
html[data-ayf-display="mobile"] body.ayf-has-mobile-nav{padding-bottom:var(--ayf-bottom-clearance)}
html[data-ayf-display="mobile"] #site-header .site-header{height:64px;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:64px;gap:8px;padding:0 max(12px,env(safe-area-inset-right)) 0 max(12px,env(safe-area-inset-left));overflow:visible}
html[data-ayf-display="mobile"] #site-header .site-header>.brand{grid-column:1;grid-row:1;max-width:none;width:auto;gap:8px}
html[data-ayf-display="mobile"] #site-header .site-header .brand-mark{width:35px;height:35px;flex:0 0 35px}
html[data-ayf-display="mobile"] #site-header .site-header .brand strong{font-size:18px;line-height:1.4;white-space:nowrap}
html[data-ayf-display="mobile"] #site-header .site-header .brand small{font:9px/1.5 system-ui,sans-serif;letter-spacing:.04em;white-space:nowrap}
html[data-ayf-display="mobile"] #site-header .site-header .desktop-nav{display:none!important}
html[data-ayf-display="mobile"] #site-header .site-header .header-actions{grid-column:2;grid-row:1;display:flex!important;align-items:center;gap:6px;max-width:100%}
html[data-ayf-display="mobile"] #site-header .header-actions :is(.desktop-message-entry,.desktop-auth-entry,.mobile-announcement-entry,.mobile-account-entry){display:none!important}
html[data-ayf-display="mobile"] #site-header .header-actions .growth-entry-mobile{display:inline-flex!important;max-width:102px;min-width:0;min-height:40px;padding:6px 8px;gap:4px;font:700 10px/1.4 system-ui,sans-serif}
html[data-ayf-display="mobile"] #site-header .growth-entry-mobile img{width:18px;height:18px}
html[data-ayf-display="mobile"] #site-header .growth-entry-mobile span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
html[data-ayf-display="mobile"] .mobile-nav{display:none!important}
html[data-ayf-display="mobile"] body :is(.site-main,.site-main.inner-main,.tutorial-page,.industry-page){padding:18px 12px 28px}
html[data-ayf-display="mobile"] .home-heading{display:block;margin:0 0 12px;padding:0;border:0;border-radius:0;background:none;box-shadow:none;overflow:visible}
html[data-ayf-display="mobile"] .home-heading::after{display:none}
html[data-ayf-display="mobile"] .home-heading-copy{display:none}
html[data-ayf-display="mobile"] .home-heading .mobile-home-shortlink{display:block;margin:0 0 12px;color:#5b4c7b;font:700 15px/1.5 system-ui,-apple-system,"Microsoft YaHei",sans-serif;letter-spacing:0}
html[data-ayf-display="mobile"] .home-heading-actions{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px}
html[data-ayf-display="mobile"] .home-heading-actions .search-field{height:44px;min-height:44px;padding:0 12px;border-radius:14px;background:rgba(255,255,255,.9)}
html[data-ayf-display="mobile"] .home-heading-actions .search-field input{font-size:14px!important}
html[data-ayf-display="mobile"] .home-heading-actions .search-field svg{width:18px;height:18px;flex:none}
html[data-ayf-display="mobile"] .home-heading-actions .share-store-button{min-height:44px;min-width:84px;padding:0 10px;gap:5px;border-radius:14px;font-size:11px}
html[data-ayf-display="mobile"] .share-store-button svg{width:16px;height:16px}
html[data-ayf-display="mobile"] .catalog-layout{display:block}
html[data-ayf-display="mobile"] .category-panel{display:none}
html[data-ayf-display="mobile"] .mobile-category-button{display:flex;width:100%;align-items:center;gap:10px;min-height:44px;margin:0 0 16px;padding:10px 14px;border:1px solid rgba(119,96,214,.2);border-radius:14px;background:rgba(255,255,255,.87);color:#4c405f;font:500 13px/1.4 system-ui,sans-serif;box-shadow:0 6px 20px #49346c06}
html[data-ayf-display="mobile"] .mobile-category-button svg{width:20px;height:20px;flex:none}
html[data-ayf-display="mobile"] .mobile-category-button svg:last-child{margin-left:auto;width:16px;height:16px}
html[data-ayf-display="mobile"] .section-heading{margin-bottom:12px}
html[data-ayf-display="mobile"] .section-heading h2{font:700 20px/1.4 system-ui,sans-serif;margin-top:3px}
html[data-ayf-display="mobile"] .section-heading .eyebrow{font-size:10px;letter-spacing:.14em}
html[data-ayf-display="mobile"] .section-heading>span{font-size:11px}
html[data-ayf-display="mobile"] .product-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px;align-items:stretch}
html[data-ayf-display="mobile"] .product-grid>.product-card{min-width:0;min-height:236px;padding:12px;border-radius:17px;overflow:hidden;background-image:linear-gradient(135deg,rgba(255,255,255,.96),rgba(255,252,255,.85)),url('/assets/ai-yangfan-watercolor-bg.png');background-size:auto,400px auto;box-shadow:0 8px 22px #503c7510}
html[data-ayf-display="mobile"] .product-grid>.product-card::before,html[data-ayf-display="mobile"] .product-grid>.product-card::after{opacity:.12}
html[data-ayf-display="mobile"] .product-card .product-top{min-width:0;gap:5px;align-items:flex-start}
html[data-ayf-display="mobile"] .product-card .product-icon{width:42px;height:42px;flex:0 0 42px;border-radius:11px;font-size:16px}
html[data-ayf-display="mobile"] .product-card .product-icon img{max-width:100%;max-height:100%}
html[data-ayf-display="mobile"] .product-card .product-badge{max-width:calc(100% - 47px);padding:3px 6px;font:600 9px/1.4 system-ui,sans-serif;white-space:normal;text-align:center;overflow-wrap:anywhere}
html[data-ayf-display="mobile"] .product-grid>.product-card h3{min-height:0;margin:13px 0 10px;font:650 13px/1.55 system-ui,-apple-system,"Microsoft YaHei",sans-serif;overflow-wrap:anywhere;white-space:normal}
html[data-ayf-display="mobile"] .product-card .product-subtitles{display:flex;flex-wrap:wrap;align-items:flex-start;gap:4px;min-height:0;margin-bottom:11px}
html[data-ayf-display="mobile"] .product-card .product-subtitles>span{max-width:100%;min-height:0;padding:3px 6px;font:600 9px/1.4 system-ui,sans-serif;white-space:normal;overflow-wrap:anywhere}
html[data-ayf-display="mobile"] .product-card .product-bottom{display:flex;flex-direction:column;align-items:stretch;gap:6px;margin-top:auto;padding-top:10px}
html[data-ayf-display="mobile"] .product-card .product-price{display:flex;align-items:baseline;flex-wrap:wrap;gap:0 4px;min-width:0}
html[data-ayf-display="mobile"] .product-card .product-price small{display:block;flex:1 0 100%;font:10px/1.6 system-ui,sans-serif}
html[data-ayf-display="mobile"] .product-card .product-price strong{font:750 20px/1.3 system-ui,sans-serif;letter-spacing:-.6px;white-space:normal;overflow-wrap:anywhere}
html[data-ayf-display="mobile"] .product-card .product-price del{display:inline;font-size:9px;color:#9289a1}
html[data-ayf-display="mobile"] .product-card .stock-text{display:block!important;align-self:flex-start;max-width:100%;min-height:0;padding:3px 6px;border-radius:7px;font:600 9px/1.4 system-ui,sans-serif;white-space:normal;overflow-wrap:anywhere;text-align:left}
html[data-ayf-display="mobile"] .product-card.lottery-card .lottery-card-meta{display:flex;flex-wrap:wrap;gap:3px;font-size:10px}
html[data-ayf-display="mobile"] .product-card.lottery-card .lottery-card-title{font-size:10px;min-height:0;margin:0 0 8px}
html[data-ayf-display="mobile"] .product-card.lottery-card .lottery-card-bottom{flex-direction:row;align-items:flex-end;flex-wrap:wrap}
html[data-ayf-display="mobile"] .product-card .lottery-clock strong{font-size:17px}
html[data-ayf-display="mobile"] .product-card .lottery-card-action{font-size:10px}
html[data-ayf-display="mobile"] .customer-service-launcher{right:max(12px,env(safe-area-inset-right));bottom:calc(88px + env(safe-area-inset-bottom));width:42px;height:42px;min-height:42px;border-radius:15px;z-index:59}
html[data-ayf-display="mobile"] .customer-service-launcher svg{width:24px;height:24px}
html[data-ayf-display="mobile"] .customer-service-launcher span{display:none}
html[data-ayf-display="mobile"] .qq-group-launcher{right:max(12px,env(safe-area-inset-right))!important;bottom:calc(140px + env(safe-area-inset-bottom))!important;width:42px!important;height:48px!important;min-height:48px;border-radius:15px!important;z-index:59!important;padding:5px!important}
html[data-ayf-display="mobile"] .qq-group-launcher img{width:25px!important;height:25px!important}
html[data-ayf-display="mobile"] .qq-group-launcher span{font-size:8px!important;line-height:1.2}
html[data-ayf-display="mobile"] .site-pet{left:7px!important;right:auto!important;top:auto!important;bottom:calc(84px + env(safe-area-inset-bottom))!important;width:90px;height:102px;z-index:58;transform-origin:bottom left;transform:scale(.58)}
html[data-ayf-display="mobile"] .site-pet-recall{right:66px;bottom:calc(90px + env(safe-area-inset-bottom));min-height:34px;max-width:105px;padding:0 10px;font-size:10px;z-index:58}
html[data-ayf-display="mobile"].ayf-purchase-in-view :is(.customer-service-launcher,.qq-group-launcher,.site-pet,.site-pet-recall){visibility:hidden!important;pointer-events:none!important}
html[data-ayf-display="mobile"] .site-footer{width:100%;padding:22px 14px 18px;margin-bottom:0}
/* Toasts are informational: never cover links or form controls with an invisible hit area. */
html[data-ayf-display] .toast-stack{pointer-events:none}
html[data-ayf-display="mobile"] .toast-stack{top:auto;bottom:calc(90px + env(safe-area-inset-bottom))}
html[data-ayf-display="mobile"] body:is([data-page="login"],[data-page="register"],[data-page="forgot-password"]){--site-header-height:64px;padding-top:64px;padding-bottom:0}
html[data-ayf-display="mobile"] body:is([data-page="login"],[data-page="register"],[data-page="forgot-password"]) #site-header .site-header{height:64px;grid-template-columns:minmax(0,1fr)}
@media(max-width:350px){html[data-ayf-display="mobile"] #site-header .site-header{padding-inline:9px;gap:5px}html[data-ayf-display="mobile"] #site-header .site-header .brand strong{font-size:16px}html[data-ayf-display="mobile"] #site-header .site-header .brand-mark{width:31px;height:31px;flex-basis:31px}html[data-ayf-display="mobile"] #site-header .site-header>.brand{gap:6px}html[data-ayf-display="mobile"] #site-header .header-actions .growth-entry-mobile{max-width:90px;font-size:9px;padding:6px}html[data-ayf-display="mobile"] .product-grid{gap:8px}html[data-ayf-display="mobile"] .product-grid>.product-card{padding:10px}html[data-ayf-display="mobile"] .product-grid>.product-card h3{font-size:12px}html[data-ayf-display="mobile"] .product-card .product-price strong{font-size:18px}}

/* Inventory badges have a more specific catalog rule in stock-badge.css.
   Keep the amount and the complete live stock text on separate bounded rows. */
html[data-ayf-display="mobile"] body[data-page="home"] #product-grid.product-grid>.product-card .product-bottom{display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-auto-flow:row!important;align-items:start!important;justify-content:stretch!important;gap:7px!important;width:100%!important;min-width:0!important;max-width:100%!important;box-sizing:border-box!important}
html[data-ayf-display="mobile"] body[data-page="home"] #product-grid.product-grid>.product-card .product-bottom>.product-price{display:flex!important;flex-wrap:wrap!important;align-items:baseline!important;gap:1px 4px!important;grid-column:1!important;grid-row:auto!important;width:100%!important;min-width:0!important;max-width:100%!important;box-sizing:border-box!important}
html[data-ayf-display="mobile"] body[data-page="home"] #product-grid.product-grid>.product-card .product-bottom>.stock-text{display:block!important;grid-column:1!important;grid-row:auto!important;width:100%!important;min-width:0!important;max-width:100%!important;box-sizing:border-box!important;flex:none!important;margin:0!important;padding:5px 6px!important;font:600 10px/1.5 system-ui,-apple-system,"Microsoft YaHei",sans-serif!important;white-space:normal!important;overflow-wrap:anywhere!important;word-break:normal!important;text-align:left!important}
html[data-ayf-display="mobile"] body[data-page="home"] #product-grid.product-grid>.product-card .product-bottom>:is(.product-price,.stock-text){position:static!important;inset:auto!important;transform:none!important;float:none!important;align-self:stretch!important}
