@charset "UTF-8";
/*
 * EdenH2O 官网商城 (/Public/shop/) 全站移动端样式层  v2  2026-11-06
 *
 * 适用范围：手机 / 窄屏 (max-width:767px) + 平板窄屏 (768~1023px 轻兜底)。
 *           中英文是同一套 DOM，语言切换会写 <html lang="zh-CN"|"en">，
 *           本文件对两种语言同时生效，并针对中英文分别做了排版细节。
 * 覆盖页面：/ 首页、/products、/products/:id、/cart、/checkout、/login、
 *           /register、/orders、/orders/:id、/account、/address、/favorites、
 *           /coupons、/my-subscriptions、/my-deposits、/bills、/work-orders、
 *           /notifications、/page/:page_key（DIY 装修页）、/:pageKey、404。
 * 加载要求：必须在 index-*.css 之后引入。本文件为 unlayered 样式，优先级高于
 *           Tailwind 的 @layer 规则；后台配置写成内联 style 的地方用 !important 兜底。
 * 回滚方式：删除 index.html 里本文件的 <link> 一行即可，不动任何打包产物。
 * 与 v1 的关系：本文件整份替换 v1 同名文件（v1 只修了截图里的 5 处）。
 *          同时收敛了 v1 里两个会误伤其它页面的选择器：
 *          1) [class*="fixed"][class*="z-[100]"] 会命中所有 z-[100] 的弹窗遮罩，
 *             现改为只命中「悬浮客服」容器；
 *          2) [class*="grid"] 会命中 DIY 装修页的 diy-footer-grid，
 *             现统一改用完整 token [class~="grid"]。
 */

@media (max-width: 767px) {

  /* ============================================================
   * 0. 全站基础：溢出、字体、折行、表单、触控
   * ============================================================ */
  html { -webkit-text-size-adjust: 100%; }
  /* clip 不创建滚动容器，不会破坏 header 的 sticky 吸顶 */
  #root { overflow-x: clip; }
  #root img, #root video, #root canvas { max-width: 100%; }
  #root table { max-width: 100%; }
  /* v2.2 关键修正：这里原本用 overflow-wrap:anywhere，会把 flex 子项的
     min-content 宽度压到「单个字符」，窄卡片里价格 / 销量 / 面包屑被逐字拆行。
     真实站点 375px 实测：价格 span 被撑到 84px 高（应为 24px）、
     面包屑 "Home" 被压成 "Hom/e" 且整条 60px 高。
     改用 break-word：只在确实溢出时才断长词，不改变 min-content。 */
  #root h1, #root h2, #root h3, #root h4,
  #root p, #root li, #root a, #root span, #root label, #root button {
    overflow-wrap: break-word;
    word-break: normal;
  }
  /* 英文模式下允许长单词按音节断行，中文模式禁用（避免把中文拆开） */
  html[lang="en"] #root h1, html[lang="en"] #root h2,
  html[lang="en"] #root h3, html[lang="en"] #root p,
  html[lang="en"] #root li, html[lang="en"] #root a { hyphens: auto; }
  html[lang^="zh"] #root h1, html[lang^="zh"] #root h2,
  html[lang^="zh"] #root h3, html[lang^="zh"] #root p { hyphens: none; }

  html[lang="en"] #root {
    font-family: "Space Grotesk", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  }
  html[lang^="zh"] #root {
    font-family: "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    letter-spacing: .01em;
  }
  #root [class~="tabular-nums"], #root [class*="font-bold"] { font-variant-numeric: tabular-nums; }

  /* iOS 上 <16px 的输入框会触发自动放大，把焦点时的缩放消掉 */
  #root input:not([type="checkbox"]):not([type="radio"]),
  #root select, #root textarea {
    font-size: 16px !important;
    max-width: 100%;
  }
  #root input, #root select, #root textarea { touch-action: manipulation; }
  #root :focus-visible { outline: 2px solid #00A0E9; outline-offset: 2px; }
  #root [class~="overflow-x-auto"], #root [class~="overflow-auto"],
  #root [class~="overflow-y-auto"] { -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }

  /* 站内所有主容器统一左右留白，避免 375px 下贴边 */
  #root [class~="max-w-[1600px]"],
  #root [class~="max-w-[1200px]"],
  #root [class~="max-w-[900px]"],
  #root [class~="max-w-7xl"] {
    padding-left: 14px !important;
    padding-right: 14px !important;
    max-width: 100%;
  }

  /* 全站字号：桌面大标题在手机上按屏幕收敛，但不改内联配置 */
  #root [class~="text-6xl"] { font-size: 34px !important; line-height: 1.15 !important; }
  #root [class~="text-5xl"] { font-size: 30px !important; line-height: 1.2 !important; }
  #root [class~="text-4xl"] { font-size: 27px !important; line-height: 1.25 !important; }
  #root [class~="text-3xl"] { font-size: 23px !important; line-height: 1.3 !important; }
  #root h1[class~="text-2xl"], #root h2[class~="text-2xl"] {
    font-size: 21px !important; line-height: 1.3 !important;
  }
  #root h1[class~="text-xl"], #root h2[class~="text-xl"] { font-size: 18px !important; }
  /* 只提升正文小字，角标 / 徽章保持原尺寸，避免 18px 圆点被数字撑破 */
  #root [class~="text-[11px]"],
  #root [class~="text-[10px]"]:not([class~="absolute"]):not([class~="rounded-full"]),
  #root p[class~="text-[10px]"], #root span[class~="text-[10px]"] {
    font-size: 11px !important; line-height: 1.4 !important;
  }

  /* 全站留白：桌面 py-16/20、p-6/8、gap-8/10 在手机上过大 */
  #root [class~="py-24"] { padding-top: 40px !important; padding-bottom: 40px !important; }
  #root [class~="py-20"] { padding-top: 36px !important; padding-bottom: 36px !important; }
  #root [class~="py-16"] { padding-top: 32px !important; padding-bottom: 32px !important; }
  #root [class~="py-12"] { padding-top: 28px !important; padding-bottom: 28px !important; }
  #root [class~="py-10"] { padding-top: 24px !important; padding-bottom: 24px !important; }
  #root [class~="py-8"]  { padding-top: 20px !important; padding-bottom: 20px !important; }
  #root [class~="px-6"]  { padding-left: 14px !important; padding-right: 14px !important; }
  #root [class~="px-5"]  { padding-left: 14px !important; padding-right: 14px !important; }
  #root [class~="p-8"]   { padding: 18px !important; }
  #root [class~="p-6"]   { padding: 14px !important; }
  #root [class~="p-5"]   { padding: 14px !important; }
  #root [class~="p-4"]   { padding: 12px !important; }
  #root [class~="gap-10"] { gap: 20px !important; }
  #root [class~="gap-8"]  { gap: 16px !important; }
  #root [class~="gap-6"]  { gap: 12px !important; }
  #root [class~="mt-16"] { margin-top: 28px !important; }
  #root [class~="mb-8"]  { margin-bottom: 16px !important; }
  #root [class~="mb-6"]  { margin-bottom: 14px !important; }

  /* 网格子项不再被长标题撑破列宽；统一只用完整 token，避开 diy-footer-grid。
     只改 min-width，不动 align-self（购物车行的 align-items:center 要保留） */
  #root [class~="grid"] > * { min-width: 0; }

  /* ============================================================
   * 1. 全站页头 header#top（黑条 / 蓝色公告 / Logo / 分类导航 / 搜索）
   * ============================================================ */
  /* 1.1 黑色欢迎条：v3.0 恢复无缝滚动（此前 animation:none 导致手机端不滚）。
        保留高度锁定与语言/货币 shrink-0，不恢复则文字不再滚动。 */
  header#top > div[class~="text-white"][class~="text-xs"] { height: auto !important; }
  header#top > div[class~="text-white"][class~="text-xs"] > div {
    height: 32px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    gap: 8px !important;
  }
  header#top [class~="animate-marquee"] {
    animation-name: marquee !important;
    animation-timing-function: linear !important;
    animation-iteration-count: infinite !important;
    animation-play-state: running !important;
    display: inline-block !important;
    width: max-content !important;
    max-width: none !important;
    overflow: visible !important;
    white-space: nowrap !important;
    text-overflow: clip;
  }
  /* 无缝滚动依赖两份相同文案并排，位移 -50% 才首尾相接，第二份必须显示 */
  header#top [class~="animate-marquee"] > span { margin-right: 4rem !important; }
  header#top [class~="animate-marquee"] > span:nth-child(n+2) { display: inline-block !important; }
  header#top [class~="flex-1"][class~="overflow-hidden"] { min-width: 0; }
  /* v2.2：第一句文案自身做省略号。父级 text-overflow 对 inline-block 子元素无效，
     所以之前黑条 "…| Fre" 是被硬裁、没有 "…"。 */
  header#top > div[class~="text-white"][class~="text-xs"] [class~="animate-marquee"] {
    min-width: max-content;
    flex: 0 0 auto;
  }
  header#top > div[class~="text-white"][class~="text-xs"] [class~="animate-marquee"] > span:first-child {
    display: inline-block !important;
    width: auto !important;
    max-width: none !important;
    margin-right: 4rem !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
  }
  header#top > div[class~="text-white"][class~="text-xs"] [class~="shrink-0"] {
    flex-shrink: 0 !important;
    gap: 6px !important;
  }
  /* 语言 / 货币下拉面板不越出视口 */
  header#top [class~="min-w-[140px]"], header#top [class~="min-w-[160px]"],
  header#top [class~="min-w-[220px]"] {
    min-width: 0 !important;
    max-width: calc(100vw - 24px);
  }

  /* 1.2 蓝色促销公告条：固定单行，禁止多条文案换行后叠字 */
  header#top > div[class~="overflow-hidden"] {
    position: relative;
    z-index: 1;
    height: 34px !important;
    max-height: 34px !important;
    overflow: hidden !important;
    font-size: 12px !important;
    line-height: 34px !important;
    flex-shrink: 0;
  }
  /* v3.0 恢复蓝色公告条滚动：只保留 nowrap 防换行，不再全局禁用 animation/transform。
     内联 style 里的 promoScrollRtl/Ltr 动画即可重新生效。 */
  header#top > div[class~="overflow-hidden"] *,
  header#top > div[class~="overflow-hidden"] *::before,
  header#top > div[class~="overflow-hidden"] *::after {
    white-space: nowrap !important;
  }
  /* 后台配置的 height / fontSize 是内联样式 */
  header#top > div[class~="overflow-hidden"] [style*="height"] { height: 34px !important; }
  header#top > div[class~="overflow-hidden"] [style*="font-size"] { font-size: 12px !important; }
  header#top > div[class~="overflow-hidden"] button { flex-shrink: 0; }
  /* 实测（375px）：公告内容的外层容器会被后台配置撑到 82px，把 34px 的文案行
     往下推 20px，蓝条只剩 34px 高 → 文字上下被切掉一半。这里把外层锁成
     34px 的 flex 居中容器，多条公告时只显示第一条，不再叠字。 */
  header#top > div[class~="overflow-hidden"] > div[class~="max-w-[1600px]"] {
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    display: flex !important;
    align-items: center !important;
    overflow: hidden !important;
  }
  header#top > div[class~="overflow-hidden"] > div[class~="max-w-[1600px]"] > div:nth-child(n+2) {
    display: none !important;
  }
  /* 第一条文案单行省略，不再把公告条撑宽。
     v2.2 曾改为内联文本流想让 "…" 出现，实测会把文案开头 "Buy 2 " 推到
     容器外并露出后台的关闭按钮，已回退。长公告建议在后台缩短文案。 */
  header#top > div[class~="overflow-hidden"] [class~="animate-marquee"] > span:first-child {
    display: block !important;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-right: 0 !important;
    padding-right: 12px;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  /* 1.3 Logo 行：80px 压到 56px，图标按钮给足 40px 触控区 */
  header#top > div[class~="backdrop-blur-md"] { position: relative; z-index: 2; }
  header#top [class~="h-20"] { height: 56px !important; gap: 10px !important; }
  header#top [class~="text-2xl"] { font-size: 21px !important; }
  header#top img { max-width: 100%; height: auto; }
  header#top [class~="xl:hidden"][class~="rounded-full"],
  header#top [class~="rounded-full"][class~="text-slate-500"] {
    min-width: 40px !important;
    min-height: 40px !important;
  }
  /* 桌面导航在手机端本来就隐藏，确保不会被意外撑开 */
  header#top [class~="hidden"][class~="xl:flex"] { display: none !important; }

  /* 1.4 黑条内容行本身就是 h-9 + gap-4（线上实测 DOM 只有三层：
         黑条 / 公告条 / Logo 行），不能再按 h-9+gap-4 去猜「分类导航」，
         否则会和 1.1 的 32px 高度打架，把黑条撑到 40~48px。
         后台若另行开启横排分类导航，用下面这条独立容器规则兜底。 */
  header#top [class~="border-t"][class~="bg-white"] [class~="h-9"],
  header#top nav[class~="h-9"] {
    height: 40px !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  header#top nav[class~="h-9"] > * { flex-shrink: 0; }
  /* hover 才出现的下拉在触屏上不可依赖，隐藏以免遮住页面 */
  header#top [class~="group-hover:visible"][class~="opacity-0"] { display: none !important; }

  /* 1.5 移动端搜索行（xl:hidden + border-t） */
  header#top [class~="xl:hidden"][class~="border-t"] > div { padding-top: 8px !important; padding-bottom: 8px !important; }
  header#top [class~="mb-3"][class~="md:hidden"] { margin-bottom: 8px !important; }
  header#top [class~="pl-10"][class~="pr-24"] { padding-right: 76px !important; height: 40px !important; }
  header#top [class~="right-1"][class~="h-8"] { height: 32px !important; padding-left: 12px !important; padding-right: 12px !important; }
  /* 搜索下拉建议 */
  header#top [class~="calc-search-dropdown"], header#top [class~="absolute"][class~="z-[60]"] {
    max-width: calc(100vw - 28px);
  }

  /* ============================================================
   * 2. 首页：Banner / 轮播 / 服务保障 / 商品卡片 / 板块标题
   * ============================================================ */
  /* 2.1 首屏 Banner：原 aspect-[21/9] + min-h-[360px] 在窄屏会把图拉得过高 */
  #root [class*="aspect-[21/9]"] {
    aspect-ratio: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    height: clamp(260px, 78vw, 360px) !important;
  }
  #root [class*="aspect-[21/9]"] h1 {
    font-size: clamp(20px, 6vw, 26px) !important;
    line-height: 1.25 !important;
  }
  #root [class*="aspect-[21/9]"] p {
    font-size: 13px !important;
    line-height: 1.5 !important;
    margin-top: 10px !important;
    max-width: 92% !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  #root [class*="aspect-[21/9]"] a[class*="rounded-full"] {
    margin-top: 14px !important;
    height: 40px !important;
    padding-left: 20px !important;
    padding-right: 20px !important;
    font-size: 13px !important;
  }
  /* 轮播左右箭头 / 指示点不压住标题 */
  #root [class~="absolute"][class~="left-4"][class~="size-10"],
  #root [class~="absolute"][class~="right-4"][class~="size-10"] {
    width: 34px !important; height: 34px !important;
  }
  #root [class~="left-4"][class*="md:left-8"] { left: 8px !important; }
  #root [class~="right-4"][class*="md:right-8"] { right: 8px !important; }
  #root [class~="bottom-6"][class~="left-1/2"] { bottom: 10px !important; }

  /* 2.1b DIY 首页 Banner（真实线上结构，v2.2 新增）
     section.diy-banner 是后台 DIY 渲染器，高度/字号全是内联样式，
     和上面 aspect-[21/9] 那套静态 banner 不是同一个组件。
     主 CSS 在 <=768px 写了 .diy-renderer .diy-banner button{padding:8px 20px}，
     误伤轮播圆点：8x8 的圆点被撑成 40x16 大白胶囊（真实站点实测），
     左右箭头也一起变形。这里按真实 className 逐类复位。 */
  .diy-renderer .diy-banner [class~="rounded-full"][class~="w-2"] {
    width: 8px !important;
    height: 8px !important;
    min-width: 8px !important;
    min-height: 8px !important;
    padding: 0 !important;
    border-radius: 9999px !important;
  }
  .diy-renderer .diy-banner [class~="rounded-full"][class~="w-2"][class~="w-6"] {
    width: 22px !important;
  }
  .diy-renderer .diy-banner [class~="top-1/2"][class~="w-10"][class~="h-10"] {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    padding: 0 !important;
  }
  .diy-renderer .diy-banner [class~="bottom-4"][class~="left-1/2"] {
    bottom: 8px !important;
    gap: 6px !important;
  }
  /* 内容区：v2.3 起不再为「文A / AI」浏览器翻译插件预留右侧 54px
     （用户确认会自行关闭该插件），左右对称留白，文案可用宽度 +38px，
     英文长标题少折一行，卡片整体更窄更紧凑。 */
  .diy-renderer .diy-banner > div[class~="z-10"] { padding: 0 16px !important; }
  /* 半透明文案底板：玻璃幕墙 / 浅色下半区都能保证白字可读，
     也让 CTA 不再孤零零落在纯色渐变上（用户截图反馈的主要不专业点） */
  .diy-renderer .diy-banner > div[class~="z-10"] > div {
    box-sizing: border-box;
    max-width: 100% !important;
    padding: 10px 12px !important;
    background: rgba(3, 22, 44, .28);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 12px;
  }
  /* 手机端轮播用滑动手势即可，左右箭头会压住副标题，直接隐藏 */
  .diy-renderer .diy-banner > button[class~="top-1/2"] { display: none !important; }
  /* v2.3 字号整体收一档：手机上 26px 的标题偏大，长英文容易占两行半。
     缩小后依然清晰可读，同时把卡片高度压到 220px banner 的安全区内。 */
  .diy-renderer .diy-banner h1 {
    font-size: clamp(19px, 5.4vw, 24px) !important;
    line-height: 1.2 !important;
    margin-bottom: 6px !important;
  }
  .diy-renderer .diy-banner p {
    font-size: 11.5px !important;
    line-height: 1.4 !important;
    margin-bottom: 10px !important;
    max-width: 100% !important;
    text-shadow: 0 1px 6px rgba(0, 0, 0, .8) !important;
  }
  /* CTA 保留但做紧凑：它是横幅唯一的转化入口，隐藏会丢掉点击。
     如果仍决定在手机端彻底隐藏，放开下面这行即可：
     .diy-renderer .diy-banner > div[class~="z-10"] button { display: none !important; } */
  .diy-renderer .diy-banner > div[class~="z-10"] button {
    padding: 6px 14px !important;
    font-size: 11.5px !important;
    border-radius: 8px !important;
  }
  /* 背景玻璃幕墙偏亮，白字对比度不足；叠一层柔和暗罩，不影响标题与按钮层级 */
  .diy-renderer .diy-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 5;
    background: linear-gradient(90deg, rgba(3, 22, 44, .30), rgba(3, 22, 44, .08) 72%, transparent);
    pointer-events: none;
  }

  /* 2.1c / v2.3 根因修复：文案「超出 banner 图」
     主 CSS 有 .diy-renderer img,.diy-renderer video{max-width:100%;height:auto}，
     优先级高于 Tailwind 的 .h-full{height:100%}，于是横幅底图退回原始比例：
     后台 1200x411 / 4897x1341 的宽图在 375px 视口只有 100~130px 高，
     而 .diy-banner 被主 CSS 压到 220px，图片只盖住上半截，
     标题在图上、副标题和按钮却落在下方浅色空白区（用户 2026-11-07 截图）。
     这里让底图绝对定位铺满整个 section，object-fit:cover 保持比例居中裁切，
     这样全部文案都在图片范围内，深色底板也完整压在图上。 */
  .diy-renderer .diy-banner > div[class~="inset-0"] > img {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover !important;
    object-position: center !important;
  }

  /* 2.2 服务保障 / 分类卡 / 任意 3~6 列网格 -> 两列，中文不再竖排 */
  #root section [class~="grid-cols-3"],
  #root section [class~="grid-cols-4"],
  #root section [class~="grid-cols-5"],
  #root section [class~="grid-cols-6"],
  #root [class~="grid"][class~="grid-cols-3"][class~="gap-2"],
  #root [class~="grid"][class~="grid-cols-3"][class~="gap-4"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
  /* DIY 装修动态列数兜底：一个网格里子项 >=5 时一律两列 */
  @supports selector(:has(*)) {
    #root section [class~="grid"]:has(> :nth-child(5)):not([class~="grid-cols-1"]):not([class~="grid-cols-2"]):not(.diy-footer-grid) {
      grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
  }
  #root section [class~="grid"] p,
  #root section [class~="grid"] h3,
  #root section [class~="grid"] h4 {
    white-space: normal !important;
    word-break: keep-all !important;
    overflow-wrap: anywhere !important;
    line-height: 1.45 !important;
  }
  #root section [class~="grid"] h3,
  #root section [class~="grid"] h4,
  #root section [class~="grid"] p[class~="font-semibold"],
  #root section [class~="grid"] p[class~="text-xs"] {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  /* 服务保障 / 信任状卡（线上为 grid-cols-2 md:grid-cols-4）：
     2 列时每列仅 165px，中文描述会掉单字、英文标题被截成 "24/7 Customer…"。
     手机端改单列，图标左文字右，中英文都能完整显示。实测 375px 通过。 */
  #root section [class~="grid-cols-2"][class~="md:grid-cols-4"] {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px !important;
  }
  #root section [class~="grid-cols-2"][class~="md:grid-cols-4"] > div { padding: 10px 12px !important; }
  #root section [class~="grid-cols-2"][class~="md:grid-cols-4"] [class~="size-10"] {
    width: 36px !important; height: 36px !important;
    flex-shrink: 0;
  }

  /* 2.3 DIY 首页「服务保障」条：后台配置为 flex flex-nowrap + N 个 flex-1 子项，
     不是 Tailwind grid。线上实测为 5 项，375px 下每项仅约 60px，
     中文标题掉成单字竖排、英文被截断。手机端改 2 列 + 图标左文字右。 */
  @supports selector(:has(*)) {
    #root section div[class~="flex"][class~="flex-nowrap"]:has(> div[class~="flex-1"]) {
      display: grid !important;
      grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
      gap: 10px !important;
    }
    #root section div[class~="flex-nowrap"]:has(> div[class~="flex-1"]) > div[class~="flex-1"] {
      flex: none !important;
      width: auto !important;
      min-width: 0 !important;
      flex-direction: row !important;
      align-items: center !important;
      justify-content: flex-start !important;
      gap: 10px !important;
      padding: 12px 10px !important;
      text-align: left !important;
    }
    /* 奇数收尾项铺满整行，不留半格空白 */
    #root section div[class~="flex-nowrap"]:has(> div[class~="flex-1"]) > div[class~="flex-1"]:last-child:nth-child(odd) {
      grid-column: 1 / -1;
    }
  }
  #root section div[class~="flex-nowrap"] > div[class~="flex-1"] > div[class~="w-12"] {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    flex-shrink: 0;
  }
  #root section div[class~="flex-nowrap"] > div[class~="flex-1"] img {
    width: 20px !important;
    height: 20px !important;
  }
  #root section div[class~="flex-nowrap"] > div[class~="flex-1"] div[class~="text-sm"],
  #root section div[class~="flex-nowrap"] > div[class~="flex-1"] div[class~="text-xs"] {
    white-space: normal !important;
    word-break: keep-all !important;
    overflow-wrap: anywhere !important;
    text-align: left !important;
  }
  #root section div[class~="flex-nowrap"] > div[class~="flex-1"] div[class~="text-sm"] {
    font-size: 12px !important;
    line-height: 1.35 !important;
  }
  #root section div[class~="flex-nowrap"] > div[class~="flex-1"] div[class~="text-xs"] {
    font-size: 11px !important;
    line-height: 1.35 !important;
    margin-top: 2px !important;
  }

  /* 板块标题 */
  #root section h2[class~="text-2xl"], #root section h2[class~="text-3xl"] {
    font-size: 21px !important;
    line-height: 1.3 !important;
  }

  /* 2.3 商品卡片（首页热门 / 列表 / 推荐位通用） */
  #root [class~="grid-cols-2"][class*="md:grid-cols-3"],
  #root [class~="grid-cols-2"][class*="md:grid-cols-4"],
  #root [class~="grid-cols-2"][class*="lg:grid-cols-4"] {
    gap: 10px !important;
  }
  #root [class~="line-clamp-2"] { line-height: 1.4 !important; }
  #root [class~="min-h-[2.5rem]"] { min-height: 0 !important; }
  #root [class~="w-full"][class~="bg-[#00A0E9]"] { min-height: 38px !important; }

  /* 2.3b 商品卡：价格行 / 星级行（v2.2 新增，真实站点实测修复）
     375px 下商品卡内容区仅 135px：价格行两个 span 被压到逐字换行，
     现价 span 高度 84px（应为 24px），AED 符号与数字分离、原价叠在下面；
     星级行的 "(0)" 与 "Sold 658" 也被拆成两行、括号分家。 */
  #root [class~="aed-symbol"] {
    display: inline !important;
    white-space: nowrap !important;
    overflow-wrap: normal !important;
  }
  @supports selector(:has(*)) {
    #root [class~="flex"]:has(> span > [class~="aed-symbol"]) {
      flex-wrap: wrap !important;   /* 实在放不下时整块换行，绝不压缩 */
      gap: 2px 6px !important;
    }
    #root [class~="flex"]:has(> span > [class~="aed-symbol"]) > span {
      min-width: 0;
      flex-shrink: 0 !important;   /* 价格是关键信息，不能被省略号截成 2,088.… */
      white-space: nowrap !important;
      overflow-wrap: normal !important;
      overflow: visible !important;
      text-overflow: clip !important;
    }
    #root [class~="flex"]:has(> span > [class~="aed-symbol"]) > span[class~="text-lg"],
    #root [class~="flex"]:has(> span > [class~="aed-symbol"]) > span[class~="text-base"] {
      font-size: 13px !important;
    }
    #root [class~="flex"]:has(> span > [class~="aed-symbol"]) > span[class~="line-through"] {
      font-size: 9px !important;
    }
    /* 星级 + 销量行：星星缩到 10px，整行不换行，销量过长时省略 */
    #root [class~="flex"][class~="items-center"][class~="gap-1"]:has(> span[class~="ml-auto"]) {
      flex-wrap: nowrap !important;
      gap: 2px !important;
      overflow: hidden;
    }
    #root [class~="flex"][class~="items-center"][class~="gap-1"]:has(> span[class~="ml-auto"]) > svg {
      width: 10px !important;
      height: 10px !important;
      flex-shrink: 0;
    }
    #root [class~="flex"][class~="items-center"][class~="gap-1"]:has(> span[class~="ml-auto"]) > span {
      font-size: 10px !important;
      line-height: 1.3 !important;
      white-space: nowrap !important;
      overflow-wrap: normal !important;
      flex-shrink: 0;
    }
    #root [class~="flex"][class~="items-center"][class~="gap-1"] > span[class~="ml-auto"] {
      min-width: 0;
      max-width: 58px;
      overflow: hidden;
      text-overflow: ellipsis;
      flex-shrink: 1 !important;
    }
  }

  /* ============================================================
   * 3. 商品列表 /products：面包屑 / 筛选卡 / 排序 / 结果网格
   * ============================================================ */
  #root [class~="max-w-7xl"][class~="py-10"] { padding-top: 20px !important; padding-bottom: 20px !important; }
  #root [class~="flex"][class~="flex-col"][class~="lg:flex-row"] { gap: 16px !important; }
  #root [class~="lg:sticky"] { position: static !important; top: auto !important; }
  #root [class~="lg:sticky"][class~="p-5"] { padding: 14px !important; }
  #root [class~="flex"][class~="flex-wrap"][class~="items-center"][class~="justify-between"] {
    gap: 10px !important;
  }
  /* 排序按钮组在 640~767px 原本会显示，保留功能，只让它可换行 */
  #root [class~="hidden"][class~="sm:flex"] { flex-wrap: wrap; gap: 4px !important; }

  /* 3.1 面包屑（列表页 nav + 详情页 div，v2.2 新增）
     详情页最后一段写死 max-w-[200px]，375px 下把 "Home" 挤到 27px 宽、
     断成 "Hom/e"，"All Products" 变两行，整条面包屑高 60px（实测）。
     前几项固定不收缩，商品名改为自适应 + 单行省略。 */
  @supports selector(:has(*)) {
    #root [class~="flex"][class~="items-center"][class~="gap-2"]:has(> span[class~="max-w-[200px]"]),
    #root nav[class~="flex"][class~="items-center"][class~="gap-2"][class~="text-slate-500"] {
      flex-wrap: nowrap !important;
      white-space: nowrap !important;
      min-width: 0;
    }
    #root [class~="flex"][class~="items-center"][class~="gap-2"]:has(> span[class~="max-w-[200px]"]) > *,
    #root nav[class~="flex"][class~="items-center"][class~="gap-2"][class~="text-slate-500"] > * {
      flex-shrink: 0 !important;
      white-space: nowrap !important;
      overflow-wrap: normal !important;
    }
    #root [class~="flex"][class~="items-center"][class~="gap-2"] > span[class~="max-w-[200px]"] {
      max-width: none !important;
      flex: 1 1 auto !important;
      min-width: 0 !important;
      display: block !important;
      -webkit-line-clamp: unset !important;
      white-space: nowrap !important;
      overflow: hidden !important;
      text-overflow: ellipsis !important;
      overflow-wrap: normal !important;
    }
  }

  /* ============================================================
   * 4. 商品详情 /products/:id：主图 / 缩略图 / 价格 / 加购 / 参数
   * ============================================================ */
  #root [class~="grid"][class~="md:grid-cols-2"][class~="gap-0"] { gap: 0 !important; }
  /* 只改详情页主图；商品卡片 / 收藏弹窗里的方形图仍保持 1:1，避免卡片被拉高 */
  #root [class~="aspect-square"][class~="bg-slate-50"]:not([class~="cursor-pointer"]),
  #root [class~="aspect-square"][class~="rounded-xl"][class~="overflow-hidden"] {
    aspect-ratio: auto !important;
    height: min(88vw, 340px) !important;
  }
  #root [class~="aspect-square"][class~="bg-slate-50"] [class~="object-contain"] { max-height: 100%; }
  /* 缩略图横滑 */
  #root [class~="size-16"][class~="md:size-20"],
  #root [class~="size-20"][class~="md:size-24"] { width: 64px !important; height: 64px !important; }
  #root [class~="flex"][class~="gap-2"][class~="overflow-x-auto"] { scrollbar-width: none; }
  #root [class~="flex"][class~="gap-2"][class~="overflow-x-auto"]::-webkit-scrollbar { display: none; }
  #root [class~="p-6"][class~="md:p-8"], #root [class~="p-6"][class~="md:p-8"][class~="lg:p-16"] {
    padding: 16px !important;
  }
  /* 详情底部两个主按钮 */
  #root [class~="mt-auto"][class~="flex"][class~="gap-3"] > * { min-height: 44px !important; font-size: 14px !important; }
  #root [class~="text-3xl"][class~="font-bold"][class~="text-[#00A0E9]"] { font-size: 25px !important; }
  /* 详情页悬浮「对比」按钮，避开右下角客服 */
  #root [class~="fixed"][class~="bottom-6"][class~="right-6"] {
    bottom: 14px !important; right: 12px !important;
    padding: 9px 14px !important; font-size: 12px !important;
  }

  /* ============================================================
   * 5. 购物车 /cart：行布局 / 数量 / 汇总 / 去结算
   * ============================================================ */
  #root [class~="grid"][class~="grid-cols-[auto_1fr]"] {
    gap: 10px !important;
    padding: 12px 14px !important;
  }
  #root [class~="grid"][class~="grid-cols-[auto_1fr]"] [class~="size-20"] {
    width: 68px !important; height: 68px !important;
  }
  #root [class~="md:hidden"][class~="mt-2"][class~="flex"] { flex-wrap: wrap; gap: 8px; }
  #root [class~="hidden"][class~="md:grid"] { display: none !important; }
  #root [class~="lg:col-span-2"] { min-width: 0; }
  /* 对比弹窗里的 600px 宽表格：允许横向滑动，但不撑破整页 */
  #root [class~="min-w-[600px]"] { min-width: 560px !important; }
  #root [class~="overflow-x-auto"]:has(> [class~="min-w-[600px]"]) { max-width: 100%; }

  /* ============================================================
   * 6. 结算 /checkout：地址 / 配送 / 时间段 / 支付 / 订单汇总 / 提交
   * ============================================================ */
  #root [class~="grid"][class~="lg:grid-cols-3"][class~="gap-8"] { gap: 14px !important; }
  #root [class~="lg:col-span-2"][class~="space-y-6"] > * { min-width: 0; }
  #root [class~="cursor-pointer"][class~="p-4"] { padding: 12px !important; }
  /* 日期 / 时间段 / 支付方式三列 -> 两列 */
  #root [class~="grid"][class~="grid-cols-3"][class~="gap-2"],
  #root [class~="grid"][class~="grid-cols-3"][class~="gap-3"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
  #root [class~="grid"][class~="grid-cols-3"] > button,
  #root [class~="grid"][class~="grid-cols-3"] > label { min-height: 42px !important; }
  #root [class~="min-w-[200px]"], #root [class~="min-w-[180px]"],
  #root [class~="min-w-[120px]"], #root [class~="min-w-[160px]"],
  #root [class~="min-w-[220px]"] { min-width: 0 !important; }
  #root [class~="bg-white"][class~="p-5"][class~="rounded-xl"][class~="lg:sticky"] { padding: 14px !important; }
  /* 提交订单 / 去结算 / 立即付款 等主按钮 */
  #root [class~="w-full"][class~="bg-[#00A0E9]"],
  #root [class~="w-full"][class~="bg-primary"] {
    min-height: 46px !important; font-size: 15px !important;
  }

  /* ============================================================
   * 7. 登录 /login、注册 /register
   * ============================================================ */
  #root [class~="max-w-md"][class~="py-12"] { padding-top: 24px !important; padding-bottom: 24px !important; }
  #root [class~="border-none"][class~="shadow-xl"] > * { padding-left: 18px !important; padding-right: 18px !important; }
  #root [class~="flex"][class~="gap-2"][class~="p-1"] > * { min-height: 40px !important; }
  #root [class~="max-w-md"][class~="p-8"] { padding: 20px !important; }

  /* ============================================================
   * 8. 会员中心 /orders /orders/:id /account /address /favorites
   *    /coupons /my-subscriptions /my-deposits /bills /work-orders
   *    /notifications：页头、Tab、卡片、按钮组
   * ============================================================ */
  #root [class~="mx-auto"][class~="max-w-[1200px]"],
  #root [class~="mx-auto"][class~="max-w-[900px]"],
  #root [class~="mx-auto"][class~="max-w-[1600px]"] { padding-top: 20px !important; padding-bottom: 28px !important; }
  #root [class~="mb-6"][class~="text-2xl"] { font-size: 20px !important; }
  /* Tab 行横向滑动，不再把 "待付款 / 待发货 / 待收货 / 已完成" 挤成两行 */
  #root [class~="flex"][class~="gap-2"][class~="mb-6"][class~="border-b"] {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  #root [class~="flex"][class~="gap-2"][class~="mb-6"][class~="border-b"]::-webkit-scrollbar { display: none; }
  #root [class~="px-6"][class~="py-3"],
  #root [class~="px-5"][class~="py-3"] {
    padding: 10px 12px !important;
    white-space: nowrap;
    flex-shrink: 0;
  }
  #root [class~="p-6"][class~="md:p-8"], #root [class~="p-6"][class~="md:p-8"][class~="space-y-6"] {
    padding: 16px !important;
  }
  #root [class~="flex"][class~="items-center"][class~="justify-between"] { gap: 8px; }
  #root [class~="flex"][class~="flex-wrap"][class~="gap-2"][class~="justify-end"] { justify-content: flex-start !important; }

  /* ============================================================
   * 9. 弹窗 / 抽屉 / 图片灯箱（全站通用）
   * ============================================================ */
  #root [class~="fixed"][class~="inset-0"] { padding: 10px !important; }

  /* ------------------------------------------------------------
   * 9.1 首屏「欢迎来到 EdenH2O」弹窗：桌面 16:9 双栏 -> 手机竖版
   * 原结构 section.diy-welcome-page > div[aspect-ratio:16/9]，
   * 375px 下仅 193px 高，左右两栏内容全部被 overflow-hidden 裁掉
   * （标题断字、按钮与社交图标不可见）。这里只改尺寸，不删任何业务内容。
   * ------------------------------------------------------------ */
  #root [class~="fixed"][class~="inset-0"][class~="z-[90]"] { padding: 16px !important; }
  #root [class~="fixed"][class~="inset-0"][class~="z-[90]"] > div[class~="relative"] {
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  #root .diy-welcome-page { border-radius: 14px !important; }
  #root .diy-welcome-page > div[style*="aspect-ratio"] {
    aspect-ratio: auto !important;
    height: auto !important;
  }
  #root .diy-welcome-page div[class~="h-full"][class~="flex-col"][class~="md:flex-row"] {
    height: auto !important;
  }
  /* 左侧视频/营销区收成顶部横幅，不再与主内容抢高度 */
  #root .diy-welcome-page div[class~="relative"][class~="h-full"][class~="w-full"][class~="overflow-hidden"][class~="md:w-1/2"] {
    height: 190px !important;
    min-height: 190px !important;
    flex: none !important;
    width: 100% !important;
  }
  /* 视频/图片是浅色展厅，白字需更重的遮罩才读得清 */
  #root .diy-welcome-page div[class~="absolute"][class~="inset-0"][class~="bg-black"] { opacity: .5 !important; }
  #root .diy-welcome-page div[class~="items-center"][class~="justify-center"][class~="text-center"][class~="px-8"] {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }
  #root .diy-welcome-page h3[class~="font-bold"] {
    font-size: 16px !important;
    line-height: 1.3 !important;
    word-break: normal !important;
  }
  #root .diy-welcome-page div[class~="flex"][class~="flex-col"][class~="items-center"] p {
    font-size: 11px !important;
    line-height: 1.45 !important;
    margin-top: 4px !important;
  }
  /* flex-col 空间不足时按钮会被压成一条（英文文案更长时必现） */
  #root .diy-welcome-page div[class~="flex"][class~="flex-col"][class~="items-center"] {
    flex-shrink: 0 !important;
    min-width: 0;
  }
  #root .diy-welcome-page button[class~="mt-4"] {
    flex-shrink: 0 !important;
    min-height: 26px !important;
    margin-top: 10px !important;
    padding: 4px 14px !important;
    font-size: 11px !important;
    line-height: 1.3 !important;
    white-space: nowrap;
    overflow: visible;
  }
  /* 后台只配了中文 CTA 文案时，英文模式按钮为空 -> 不留无意义色块；
     日后在后台补上 media_btn_text_en，按钮会自动恢复显示 */
  #root .diy-welcome-page button[class~="mt-4"]:empty { display: none !important; }
  #root .diy-welcome-page div[class~="absolute"][class~="top-3"][class~="left-3"] { transform: scale(.85); transform-origin: top left; }
  /* 右侧主内容区：竖版重排，按钮与社交图标完整可见 */
  #root .diy-welcome-page div[class~="flex-1"][class~="flex-col"] {
    flex: none !important;
    padding: 18px 16px 20px !important;
  }
  #root .diy-welcome-page div[class~="mb-4"] { margin-bottom: 10px !important; }
  #root .diy-welcome-page img[class~="h-12"] { height: 34px !important; }
  #root .diy-welcome-page h2[class~="text-2xl"] {
    font-size: 18px !important;
    line-height: 1.35 !important;
    word-break: normal !important;
  }
  #root .diy-welcome-page p[class~="text-sm"] { font-size: 12px !important; line-height: 1.5 !important; margin-top: 6px !important; }
  #root .diy-welcome-page p[class~="text-xs"] { font-size: 11px !important; line-height: 1.5 !important; margin-top: 6px !important; }
  #root .diy-welcome-page div[class~="mt-6"] { margin-top: 14px !important; }
  #root .diy-welcome-page div[class~="max-w-xs"] button {
    height: 42px !important;
    min-height: 42px !important;
    font-size: 14px !important;
  }
  #root .diy-welcome-page div[class~="items-center"][class~="justify-center"] a {
    width: 20px !important;
    height: 20px !important;
  }
  #root [class~="fixed"][class~="inset-0"][class~="z-[90]"] button[style*="position: absolute"] {
    width: 38px !important;
    height: 38px !important;
  }

  /* 只命中 w-full 的弹窗主体；商品卡 / 筛选卡不含 w-full，不受限高影响 */
  #root [class~="w-full"][class~="rounded-2xl"][class~="bg-white"],
  #root [class~="w-full"][class~="rounded-xl"][class~="bg-white"],
  #root [class~="w-full"][class~="rounded-2xl"][class~="shadow-2xl"] {
    max-width: calc(100vw - 20px) !important;
    max-height: 88vh !important;
    max-height: 88dvh !important;
    margin: 0 auto;
  }
  #root [class~="max-h-[90vh]"], #root [class~="max-h-[85vh]"],
  #root [class~="max-h-[88vh]"], #root [class~="max-h-[80vh]"],
  #root [class~="max-h-[70vh]"] {
    max-height: 86vh !important;
    max-height: 86dvh !important;
  }
  /* 弹窗吸顶头 / 吸底操作区（排除站头 header） */
  #root [class~="sticky"][class~="top-0"]:not(header) { padding-left: 14px !important; padding-right: 14px !important; }
  #root [class~="sticky"][class~="bottom-0"] {
    padding-left: 14px !important; padding-right: 14px !important;
    padding-bottom: calc(12px + env(safe-area-inset-bottom)) !important;
  }
  #root [class~="absolute"][class~="right-4"][class~="top-4"],
  #root [class~="absolute"][class~="right-4"][class~="top-4"][class~="z-10"] {
    min-width: 36px; min-height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
  }
  /* 右侧抽屉占满宽度，顶部留出状态栏安全区 */
  #root [class~="right-0"][class~="top-0"][class~="h-full"][class~="max-w-md"] {
    max-width: 100% !important;
    padding-top: env(safe-area-inset-top);
  }
  /* 图片灯箱 */
  #root [class~="max-h-[85vh]"][class~="object-contain"] {
    max-height: 76vh !important;
    max-height: 76dvh !important;
  }
  #root [class~="left-6"][class~="size-12"], #root [class~="right-6"][class~="size-12"] {
    width: 40px !important; height: 40px !important;
    left: 8px !important;
  }
  #root [class~="right-6"][class~="size-12"] { left: auto !important; right: 8px !important; }
  #root [class~="top-6"][class~="right-6"][class~="size-10"] { top: 10px !important; right: 10px !important; }

  /* ============================================================
   * 10. 页脚
   * ============================================================ */
  #root [class~="bg-slate-900"][class~="pt-16"] {
    padding-top: 32px !important;
    padding-bottom: 20px !important;
    margin-top: 32px !important;
  }
  #root [class~="grid"][class~="lg:grid-cols-4"][class~="gap-10"] {
    gap: 24px !important;
    padding-bottom: 24px !important;
  }
  #root [class~="bg-slate-900"] [class~="text-sm"] { font-size: 12px !important; line-height: 1.6 !important; }
  #root [class~="bg-slate-900"] [class~="h-12"] { height: 32px !important; }

  /* ============================================================
   * 11. 悬浮层：客服按钮 / 底部安全距离
   *     v1 的 [class*="fixed"][class*="z-[100]"] 会误伤 z-[100] 的弹窗遮罩，
   *     这里收紧为「fixed + z-[100] + flex-col + items-end」的客服容器。
   * ============================================================ */
  #root [class~="fixed"][class~="z-[100]"][class~="flex-col"][class~="items-end"] {
    right: 10px !important;
    bottom: 74px !important;   /* 抬高，避开详情页的「对比」悬浮按钮 */
    gap: 8px !important;
    max-width: calc(100vw - 20px);
  }
  #root [class~="fixed"][class~="z-[100]"][class~="flex-col"][class~="items-end"] [class~="w-11"],
  #root [class~="fixed"][class~="z-[100]"][class~="flex-col"][class~="items-end"] [class~="size-11"] {
    width: 40px !important;
    height: 40px !important;
  }
  #root [class~="fixed"][class*="right-"] { max-width: calc(100vw - 20px); }
  #root { padding-bottom: 28px; }
  @supports (padding: env(safe-area-inset-bottom)) {
    #root { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
  }

  /* ============================================================
   * 12. 中英文细节：英文不断词重叠，中文不竖排、不拆字
   * ============================================================ */
  html[lang="en"] #root [class~="text-2xl"], html[lang="en"] #root [class~="text-3xl"] {
    letter-spacing: -.01em;
  }
  html[lang^="zh"] #root h1, html[lang^="zh"] #root h2, html[lang^="zh"] #root h3 {
    letter-spacing: .01em;
    word-break: normal !important;
  }
  /* 所有 nowrap 元素最多占满容器，避免把顶栏 / 按钮挤出屏幕 */
  #root [class~="whitespace-nowrap"] { max-width: 100%; }
  #root header [class~="whitespace-nowrap"] { overflow: hidden; text-overflow: ellipsis; }
  /* 价格、数量等数字统一等宽，中英文切换时不跳动 */
  #root [class~="font-bold"],
  #root [class~="font-semibold"] { font-variant-numeric: tabular-nums; }

  /* ============================================================
   * 13. 横屏 / 减少动效
   * ============================================================ */
  #root [class~="object-cover"] { object-position: center; }
}

@media (max-width: 767px) and (orientation: landscape) {
  #root [class*="aspect-[21/9]"] { height: 240px !important; }
  #root [class~="py-16"], #root [class~="py-20"] { padding-top: 24px !important; padding-bottom: 24px !important; }
}

@media (prefers-reduced-motion: reduce) {
  #root *, #root *::before, #root *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* 平板窄屏轻兜底；>=1024px 桌面端完全不受本文件影响 */
@media (min-width: 768px) and (max-width: 1023px) {
  header#top [class~="animate-marquee"] { animation-duration: 40s !important; }
  #root section [class~="grid-cols-5"],
  #root section [class~="grid-cols-6"] {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
  #root [class~="max-w-[1600px]"], #root [class~="max-w-7xl"] {
    padding-left: 20px !important; padding-right: 20px !important;
  }
}

/* ============================================================
 * v2.4 / 2026-11-07：商品详情富文本长图
 * UEditor 上传的详情图常为 1200x9636 一类的超长图；部分移动浏览器会按
 * 降采样后的固有尺寸渲染，导致图片只占卡片一半宽度。统一撑满容器并等比缩放。
 * 仅 <=767px 生效，桌面端完全不受影响；回滚删除本段即可。
 * ============================================================ */
@media (max-width: 767px) {
  #root .product-detail-content img {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    margin-left: auto !important;
    margin-right: auto !important;
    object-fit: contain !important;
  }
}

/* ============================================================
 * v2.5 / 2026-11-20：订阅页手机端两处修正（置于文件最后，确保覆盖前面所有规则）
 * 1) 带徽章(短期过渡/全家活水等)的套餐卡片：徽章 absolute top-0 会盖住标题，
 *    给内容区顶部让出 44px。前面的 p-6→padding:16px!important 会吃掉 pt-11，
 *    故此处用更高特异性 #root + 3属性选择器覆盖。
 * 2) 订阅推荐按钮纵向堆叠后强制水平居中（覆盖后台 button_align=left 的内联配置）。
 * ============================================================ */
@media (max-width: 767px) {
  #root [class~="p-6"][class~="md:p-8"][class~="pt-11"] {
    padding-top: 44px !important;
  }
  #root .diy-renderer .diy-container .diy-container-item .diy-sub-calc {
    width: 100% !important;
    align-items: center !important;
  }
}

/* ============================================================
 * v2.6 / 2026-11-21：商品详情页手机端按钮越界修正（英文比中文更明显）
 * 原因：三个按钮 size=lg 默认 px-8 + icon + 英文文案，min-content 宽度
 *       远超 375px 视口；flex 不换行导致右侧按钮被裁掉。
 *       保障服务条 inline flexWrap:nowrap 也会把信息列撑宽。
 * 处理：前两个按钮各占一行一半，第三个（订阅）独占一行；
 *       保障服务条允许换行并允许文字折行，信息列 min-width:0。
 * ============================================================ */
@media (max-width: 767px) {
  #root .pdp-buy-btns {
    flex-wrap: wrap !important;
  }
  #root .pdp-buy-btns > button {
    flex: 1 1 calc(50% - 6px) !important;
    min-width: 0 !important;
    white-space: nowrap !important;
  }
  #root .pdp-buy-btns > button:last-child {
    flex-basis: 100% !important;
  }
  #root .pdp-guarantee-bar {
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    overflow: hidden;
  }
  #root .pdp-guarantee-bar > div {
    flex-shrink: 1 !important;
    white-space: normal !important;
  }
  #root .pdp-guarantee-bar span {
    white-space: normal !important;
  }
}

/* ============================================================
 * v2.7 / 2026-11-21：手机端头部补齐收藏 / 对比 / 登录入口
 * 原来收藏对比 hidden sm:inline-flex、登录 hidden md:flex，手机上全没了。
 * 现已改为全尺寸显示，这里只压缩图标和间距，避免 375px 以下挤爆。
 * ============================================================ */
@media (max-width: 767px) {
  #root .header-actions {
    gap: 4px !important;
  }
  #root .header-icon-btn {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    padding: 0 !important;
  }
  #root .header-icon-btn svg {
    width: 18px !important;
    height: 18px !important;
  }
}
@media (max-width: 400px) {
  #root header a[aria-label="edenH2O"] img {
    max-width: 100px !important;
    height: 32px !important;
  }
}

/* ============================================================
 * v2.8 / 2026-11-21：折叠屏 / 大字体缩放兜底
 * 1) Tailwind v4 断点用 rem，华为折叠屏外屏或系统字体放大时
 *    xl:hidden(80rem) 会在错误宽度生效，汉堡菜单消失。
 *    这里用 px 断点和 pointer:coarse 双重保证汉堡始终可点。
 * 2) 登录页手机号区号/手机号/密码输入框在窄屏缩小字号与宽度，
 *    避免占位文字被裁切。
 * ============================================================ */
@media (max-width: 1279px) {
  #root header button[aria-label="menu"] {
    display: inline-flex !important;
  }
}
@media (pointer: coarse) {
  #root header button[aria-label="menu"] {
    display: inline-flex !important;
  }
}
@media (max-width: 767px) {
  #root header button[aria-label="account"] {
    display: inline-flex !important;
  }
  #root header .desktop-login {
    display: none !important;
  }
}
@media (max-width: 767px) {
  #root .login-country-select {
    width: 100px !important;
    min-width: 100px !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
    font-size: 13px !important;
  }
  #root .login-phone-input,
  #root .login-password-input {
    font-size: 14px !important;
  }
  #root .login-phone-input::placeholder,
  #root .login-password-input::placeholder {
    font-size: 13px !important;
  }
}
@media (max-width: 400px) {
  #root .login-country-select {
    width: 92px !important;
    min-width: 92px !important;
    font-size: 12px !important;
  }
  #root .login-phone-input,
  #root .login-password-input {
    font-size: 13px !important;
  }
}

/* ============================================================
 * v2.9 / 2026-11-21：华为 Mate X3 等折叠屏 / 大字体缩放 —— 汉堡彻底修复
 * 之前汉堡按钮用 Tailwind 的 xl:hidden（@media width>=80rem，rem 会随
 * 系统字体缩放变化），在折叠屏外屏上被误判隐藏；表现为刷新时闪一下就没。
 * 现在已从源码移除 xl:hidden，改用自定义类：
 *   - 默认所有尺寸都显示（Button 基线即 inline-flex）；
 *   - 仅在「真·桌面」(宽>=1280px 且是精确指针 fine) 才隐藏；
 *   触屏设备(pointer:coarse)即便报告很宽的 CSS 视口也不会被隐藏。
 * 同时进一步压缩头部图标间距，让 6 个图标在窄屏都能排下。
 * ============================================================ */
/* 触屏设备：无论视口多宽，汉堡与移动面板始终显示 */
@media (pointer: coarse) {
  #root .mobile-menu-btn {
    display: inline-flex !important;
  }
  #root .mobile-menu-panel {
    display: block !important;
  }
}
/* 仅真·桌面隐藏（精确指针 + 足够宽），避免与桌面导航重复 */
@media (min-width: 1280px) and (pointer: fine) {
  #root .mobile-menu-btn {
    display: none !important;
  }
}
/* 进一步压缩图标间距（在 v2.7 的 4px / 32px 基础上再缩） */
@media (max-width: 767px) {
  #root .header-actions {
    gap: 2px !important;
  }
  #root .header-icon-btn {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
  }
  #root .header-icon-btn svg {
    width: 17px !important;
    height: 17px !important;
  }
}

/* ============================================================
 * v3.1 / 2026-11-21：
 * 1) 蓝条文字在色条内垂直居中（实测上边距 2.5px / 下边距 15.5px，
 *    原因是 inline-block + baseline 对齐 + 继承 34px line-height）。
 * 2) 头部图标进一步压缩并让汉堡略向左收：旧的
 *    header#top [class~="rounded-full"][class~="text-slate-500"]
 *    规则特异性更高，把 4 个按钮锁在 40px，导致 v2.9 的 30px 未生效。
 *    这里用两个 id + 两个 class 的选择器覆盖。
 * ============================================================ */
@media (max-width: 767px) {
  /* --- 蓝条垂直居中 --- */
  header#top > div[class~="overflow-hidden"] div[class~="flex-1"][class~="overflow-hidden"][class~="relative"] {
    display: flex !important;
    align-items: center !important;
    height: 34px !important;
  }
  header#top > div[class~="overflow-hidden"] [style*="promoScroll"] {
    display: inline-flex !important;
    align-items: center !important;
    vertical-align: middle !important;
    line-height: 1.2 !important;
    height: 34px !important;
  }
  header#top > div[class~="overflow-hidden"] span[class~="shrink-0"] {
    display: inline-flex !important;
    align-items: center !important;
    vertical-align: middle !important;
    line-height: 1 !important;
    height: 34px !important;
  }

  /* --- 头部图标更紧凑 --- */
  #root header#top .header-actions {
    gap: 1px !important;
    margin-right: 4px !important;
  }
  #root header#top .header-actions .header-icon-btn {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    padding: 0 !important;
  }
  #root header#top .header-actions .header-icon-btn svg {
    width: 16px !important;
    height: 16px !important;
  }
}
