/* ⚠️ 本文件 = 【手机端】首页专属，改这里不影响另一端
   另一端在：src/app/home-1to1.css + src/components/home/Home{Hero,Engines,Ai,Library,Tools,LifeMap,Trust}.tsx
   共用层见 docs/PLATFORM-MAP.md（改共用层必须两端各自验证：PC 1440×900 + 手机 390×844）
   禁：在此文件里引用另一端的类名/组件 · 闸门：node scripts/check-home-isolation.mjs */

/* ═══════════════════════════════════════════════════════════════════════════════
   九宫首页 · 手机端专属样式（手机方案 v4 · **逐项对齐用户设计图 + 用户代码包**）
   ═══════════════════════════════════════════════════════════════════════════════

   用户报障 2026-09-18：「太极完全被你变样了，距离也不对 —— 严格按照我提供的一比一复刻」
   → 本轮重做：① 仪盘改用**用户代码包的分层结构 + 设计图画形**（v3 复用站内 TaijiWheel
     classic 几何 = 偏橙粗环 + 近黑实心太极，与设计图的「暖金细线浅色罗盘」不符 → 已弃用）；
     ② 全部间距改为设计图实测值（v3 的 hero 72vh 造成 442px 死区 = 用户说的「距离不对」）。

   唯一视觉标准 = 设计图 C:\Users\4513\Desktop\手机端\4776b953-….png（853×1844 = 390×844
                 屏的 2.1872 倍稿；本文件写的 px = 实测 png px ÷ 2.1872）
   结构/文案/动画 = 用户代码包（index.html + styles/mobile-home.css + scripts/mobile-home.js）
                 + HERMES_MOBILE_PROMPT.md

   ── 设计图实测总表（css px @390；本轮以此逐条落地）────────────────────────
     页边距 21.5 · 四格卡 167.3×77.3（row2 75.0）· 卡横距 12.3 / 纵距 6.8
     卡内：图标 52（左内缩 2.3）· 标题 12px（字面 40.7×11.0）· 副标题 9px（字面 45.7×7.3）
           箭头 10×6.5（右 11.6 / 底 22.4）
     仪盘：外径 164 · top 26（y26..190，圆心 (195,108)）· 中心太极 36 · 顶针 x=195 y0→108
     文案：h1 字面 y174.2..207.6 · h2 219.0..233.6 · 短语 246.0..255.6 · 胶囊 147×34 y273..307
     区块：hero 0..336 · 入口 339.7..498.8 · 易学书馆 505..611.3 · 九宫文库 621.4..730.6
           · 页脚盒 740.3..787 · 花形纹横线 792 · 底部山水带 800..843（整页 843 = 单屏稿）

   ── 与用户代码包的 5 处「集成适配」（都不改设计图视觉，逐条列明）──────────
     ① 作用域：用户样式是独立 demo（html/body 级裸选择器）→ 全部规则加 `.jgm-home`
        前缀、整份包在 `@media (max-width:842px)` 内 → 结构上不可能命中 PC 视口；
     ② `.mountains` 由「div + background(cover)」改为「<img> + width:100%」= 只缩放不裁切；
     ③ 站内 PC 版式（固定导航 / PC 页脚 / 旧长图页）在本页让位；
     ④ 繁/简 与 昼/夜 两个站内开关保留在抽屉里（用户 2026-09-17 明确要求）；
     ⑤ 仪盘：用户包 assets/taiji-wheel.svg **实际不存在**（zip 只有 5 个文件）→ 按设计图
        逐环实测还原为手机端内联 SVG（分层结构照用户 mobile-home.css 的 .orbit/.bagua/
        .grid/.glow/.taiji 五层），分层参数照用户指令。

   ── 素材来源（**一份也不重绘**）────────────────────────────────────────────
     · 顶部山水 /home/mobile-hero.webp = 站内既有九宫宣纸山水原稿（只缩放）
     · 书脊照片 /home/mobile-books.webp = public/home/sec-library.webp 的书脊局部（只缩放）
     · 底部山水带 /home/mobile-foot.webp = public/home/footer-bg.webp 的下部（只缩放、贴底）
     · 仪盘 / 徽章 / 统计图标 / 页脚图标 / 角饰 / 云纹带 = 按设计图形状内联 SVG 描线
       （交付包无 assets/；颜色走令牌 → 昼夜两套都能跟随）

   ── P3-A 新增（2026-09-19 · 方案A 插入式）────────────────────────────────────
     在 Hero 与四格入口之间插入两块：① AI 入口按钮（金色胶囊「问 AI 一句话 →」）
     ② 人生场景（标题 + 副题 + 一张大卡四行）。样式见本文件「══ 3c.」段，
     结构见 HomeMobilePage.tsx 的 <section className="jgm-scene">（唯一 AI 入口区，2026-10-01 三块合一）。
     **既有 5 个区块（hero/entries/book/library/foot）尺寸一字未改**，只整体下移
     341.9px@390（文档高 846 → 1188）。图稿与令牌出处：
     docs/v2phase1-20260919/P3-DESIGN-NOTES.md + P3-mockup-mobile-ai.html（业主选定方案A）。
   ═══════════════════════════════════════════════════════════════════════════════ */

@media (max-width: 842px) {
  /* ══ 0. 集成适配（只让站内 PC 版式让位；不动设计图任何视觉值） ══════════ */

  body:has(main > .jh-home) .jh-m-page,
  html.jg-home-page .jh-m-page {
    padding-top: 0 !important;
    min-height: 100dvh;
  }

  /* 站内固定导航（6 胶囊工具条 / 繁简 / 昼夜 / 汉堡）：整条让位给本页 .jg-header */
  body:has(main > .jh-home) nav.fixed,
  html.jg-home-page nav.fixed {
    display: none !important;
  }

  /* 站内 PC 页脚：本页不渲染（本页自带设计图那条页脚） */
  main:has(> .jh-home) ~ footer,
  html.jg-home-page main ~ footer {
    display: none;
  }

  /* 页面底色跟随本页令牌（压过 BRAND 组的暗底；PC 断点下的规则不受影响） */
  html:has(main > .jh-home) {
    background-color: #f4f0e7;
  }
  html:has(main > .jh-home) body {
    background-color: #f4f0e7;
    color: #24231f;
  }
  html:has(main > .jh-home):has(.jgm-home[data-jgm-theme='ink']) {
    background-color: #080b0c;
  }
  html:has(main > .jh-home):has(.jgm-home[data-jgm-theme='ink']) body {
    background-color: #080b0c;
    color: #f0e9da;
  }

  /* ══ 1. 页面令牌（昼夜两套值逐字取自用户方案）══════════════════════════ */
  .jh-m-page.jgm-home {
    --jgm-bg: #f4f0e7;
    --jgm-surface: #faf8f2;
    --jgm-soft: #ece7dc;
    --jgm-ink: #24231f;
    --jgm-muted: #6f695d;
    --jgm-gold: #b08a3c;
    --jgm-line: rgba(80, 65, 40, 0.14);
    /* 设计图卡片/环线描边：实测 (210,186,150) = #b08a3c 于 #faf8f2 上 α≈0.5 */
    --jgm-cardline: rgba(176, 138, 60, 0.5);
    /* 仪盘细线（设计图：暖金发丝线，最外圈最淡） */
    --jgm-wline: rgba(176, 138, 60, 0.55);
    --jgm-wline-soft: rgba(176, 138, 60, 0.34);
    /* 仪盘中心太极（设计图实测色）：底 奶米黄 / 半瓣 暖褐 / 点 暖褐 & 奶白 */
    --jgm-tj-bg: #fbe7bc;
    --jgm-tj-tan: #c79a5c;
    --jgm-tj-deep: #a9783c;
    --jgm-tj-light: #fef6df;
    /* 用户 .hero:after 渐变里的暖白色（按主题换成墨色，只换颜色、不动构图） */
    --jgm-haze: 250, 248, 242;

    display: block;
    position: relative;
    width: 100%;
    margin: 0;
    padding-bottom: 0;
    background: var(--jgm-bg);
    color: var(--jgm-ink);
    font-family: 'Noto Serif SC', 'Songti SC', serif;
    line-height: 1.5;
    overflow-x: clip;
  }

  .jh-m-page.jgm-home[data-jgm-theme='ink'] {
    --jgm-bg: #080b0c;
    --jgm-surface: #111517;
    --jgm-soft: #171b1d;
    --jgm-ink: #f0e9da;
    --jgm-muted: #aaa292;
    --jgm-gold: #c6a060;
    --jgm-line: rgba(198, 160, 96, 0.18);
    --jgm-cardline: rgba(198, 160, 96, 0.42);
    --jgm-wline: rgba(198, 160, 96, 0.6);
    --jgm-wline-soft: rgba(198, 160, 96, 0.36);
    --jgm-tj-bg: #e8d3a6;
    --jgm-tj-tan: #a9814a;
    --jgm-tj-deep: #8d6934;
    --jgm-tj-light: #f2e3c0;
    --jgm-haze: 8, 11, 12;
  }

  .jh-m-page.jgm-home a {
    color: inherit;
    text-decoration: none;
  }
  .jh-m-page.jgm-home img {
    max-width: 100%;
  }

  /* ══ 2. 顶部导航（设计图：透明、浮在山水上；印 26 / 字标 18 / 汉堡 14×11 / 右距 24）
        顶距：设计图实测印顶 y8.7，用户书面指令「顶部约 20~28px」→ 取 20（+安全区）══ */
  .jh-m-page.jgm-home .jg-header {
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
    right: 0;
    padding: calc(20px + env(safe-area-inset-top, 0px)) 24px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: 0.25s;
    box-shadow: none !important;
  }
  .jh-m-page.jgm-home .jg-header.scrolled {
    background: color-mix(in srgb, var(--jgm-surface) 88%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom-color: var(--jgm-cardline);
  }
  .jh-m-page.jgm-home .jg-logo {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.06em;
    color: #24231f;
  }
  .jh-m-page.jgm-home .jg-header.scrolled .jg-logo,
  .jh-m-page.jgm-home .jg-header.scrolled .menu {
    color: var(--jgm-ink);
  }
  /* 太极印：设计图实测直径 26 */
  .jh-m-page.jgm-home .mark {
    width: 26px;
    height: 26px;
    border: 1.2px solid currentColor;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 17px;
    line-height: 1;
  }
  /* 汉堡：设计图实测线长 14、线粗 1、线距 4；点击区 ≥44×34 不可见（无障碍） */
  .jh-m-page.jgm-home .menu {
    width: 44px;
    height: 34px;
    border: 0;
    background: transparent;
    color: #24231f;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    padding: 0;
  }
  .jh-m-page.jgm-home .menu i {
    display: block;
    width: 14px;
    height: 1px;
    background: currentColor;
  }

  /* ══ 3. Hero（设计图实测：hero 区 0..336 = 336/390 = 86.15vw；山水只缩放不裁切）
        v3 用的是 72vh(=608) → 山水(260) 与文案(442) 之间 182px 死区 = 「距离不对」主因
        → 本轮整条按设计图重排：文案贴山水下缘，h1 字面落在 y174.2（设计图实测）══ */
  .jh-m-page.jgm-home .hero {
    position: relative;
    height: 86.15vw;
    min-height: 0;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: var(--jgm-bg);
  }
  /* 山水：只缩放（宽高比由文件 1200×800 决定 → 390 宽出 260 高）；下缘羽化融进纸面。
     羽化 = 只做 alpha 渐隐，不加滤镜/不改色/不裁切、不动构图。 */
  .jh-m-page.jgm-home .mountains {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    display: block;
    opacity: 0.98;
    -webkit-mask-image: linear-gradient(180deg, #000 0 74%, transparent 100%);
    mask-image: linear-gradient(180deg, #000 0 74%, transparent 100%);
    -webkit-user-drag: none;
    user-select: none;
    pointer-events: none;
  }
  /* 用户原 .hero:after 渐变（暖白 → 透明 → 暖白 78%）：把山水带下缘融进纸面/墨面。
     只把暖白换成主题令牌（--jgm-haze），角度/停靠点/透明度一字未改。 */
  .jh-m-page.jgm-home .hero:after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
      to bottom,
      rgba(var(--jgm-haze), 0.08),
      transparent 38%,
      rgba(var(--jgm-haze), 0.78)
    );
    pointer-events: none;
  }
  /* 设计图 hero 下缘那道「云纹双细线 + 中心花饰」装饰带（实测 y320~336，页宽贯通）。
     交付包无此素材 → 按设计图形状内联 SVG 描线（只做装饰线，不占布局高度）。 */
  .jh-m-page.jgm-home .hero-band {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4.1vw;
    background: var(--jgm-band);
    background-repeat: no-repeat;
    background-position: center bottom;
    background-size: 100% 100%;
    opacity: 0.95;
    pointer-events: none;
    z-index: 4;
  }

  /* ── 3a. 仪盘（设计图实测：外径 164、top 26、圆心 (195,108)；顶针 x=195 y0→108）
        分层结构照用户 mobile-home.css 的 .orbit / .bagua / .grid / .glow / .taiji 五层；
        分层旋转照用户指令（见下 .jgm-w-* 各条）。**不旋转整张图**，山水/建筑静止。── */
  .jh-m-page.jgm-home .wheel {
    position: absolute;
    z-index: 2;
    top: 6.67vw; /* 设计图实测 26/390 */
    left: 50%;
    width: 42.05vw; /* 设计图实测 164/390 */
    aspect-ratio: 1;
    transform: translateX(-50%);
    pointer-events: none;
  }
  /* 顶部竖针：设计图实测一条发丝金线，从页面最顶(y0)垂到仪盘圆心(y108)，
     中部一枚菱形花饰。放在仪盘外层（**不参与任何旋转**）。 */
  .jh-m-page.jgm-home .wheel .needle {
    position: absolute;
    left: 50%;
    bottom: 50%; /* 圆心高度 */
    width: 1px;
    /* 设计图实测：针从页面最顶 y0 垂到圆心 y108 → 高 108/390 = 27.7vw */
    height: 27.7vw;
    transform: translateX(-50%);
    background: linear-gradient(180deg, transparent 0, var(--jgm-wline) 30%, var(--jgm-wline) 100%);
  }
  .jh-m-page.jgm-home .wheel .needle i {
    position: absolute;
    top: 44%; /* 设计图菱形花饰 ≈ y47 */
    left: 50%;
    width: 4px;
    height: 4px;
    margin-left: -2px;
    border: 1px solid var(--jgm-wline);
    transform: rotate(45deg);
  }
  .jh-m-page.jgm-home .wheel .needle i:last-child {
    top: 76%; /* 设计图：针与仪盘外环相交处 y26 一枚细环 */
    width: 7px;
    height: 7px;
    margin-left: -3.5px;
    border-radius: 50%;
    transform: none;
  }
  /* 分层：每层各一块 <svg>，各自 transform-origin:center，各转各的 */
  .jh-m-page.jgm-home .wheel .layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    transform-origin: 50% 50%;
    fill: none;
    stroke: var(--jgm-wline);
    stroke-width: 0.7;
  }
  /* 用户指令分层参数（一字未动）：外轨 70s ↻ / 八卦 42s ↺反向 / 刻度 58s ↻ / 太极 22s ↻
     / 暖金光晕 5s 呼吸；全部 linear（光晕 ease-in-out），transform-origin:center。 */
  .jh-m-page.jgm-home .wheel .w-orbit {
    animation: jgm-spin 70s linear infinite;
  }
  .jh-m-page.jgm-home .wheel .w-bagua {
    animation: jgm-spin-rev 42s linear infinite;
  }
  .jh-m-page.jgm-home .wheel .w-scale {
    animation: jgm-spin 58s linear infinite;
  }
  .jh-m-page.jgm-home .wheel .w-taiji {
    animation: jgm-spin 22s linear infinite;
  }
  .jh-m-page.jgm-home .wheel .w-glow {
    animation: jgm-breath 5s ease-in-out infinite alternate;
  }
  .jh-m-page.jgm-home .wheel .w-fixed {
    animation: none; /* 内环组静止 */
  }
  /* 细线/淡环分级（设计图：最外圈最淡、密齿带最亮） */
  .jh-m-page.jgm-home .wheel .soft {
    stroke: var(--jgm-wline-soft);
  }
  .jh-m-page.jgm-home .wheel .dash {
    stroke-dasharray: 1.6 5.4;
  }
  .jh-m-page.jgm-home .wheel .ticks {
    stroke: var(--jgm-wline);
    stroke-width: 0.75;
  }
  .jh-m-page.jgm-home .wheel .dots {
    fill: var(--jgm-wline);
    stroke: none;
  }
  .jh-m-page.jgm-home .wheel .cal-chars {
    fill: var(--jgm-gold);
    stroke: none;
    font-family: var(--h-serif, 'Noto Serif SC', serif);
    font-size: 9px;
    text-anchor: middle;
    opacity: 0.88;
  }
  .jh-m-page.jgm-home .wheel .yao {
    stroke: var(--jgm-gold);
    stroke-width: 0.9;
    stroke-linecap: round;
    opacity: 0.9;
  }
  .jh-m-page.jgm-home .wheel .w-glow {
    fill: none;
    stroke: none;
    filter: blur(3px);
  }
  .jh-m-page.jgm-home .wheel .w-glow circle {
    fill: rgba(224, 185, 104, 0.3);
  }
  /* 中心太极：设计图实测 d≈36（= 42.05vw × 0.22）· 奶米黄底 + 暖褐半瓣 + 双点 ·
     外加一道细金环。整体明度与设计图一致（**浅色为主**，不是 v3 那个近黑实心） */
  .jh-m-page.jgm-home .wheel .tj-ring {
    fill: none;
    stroke: var(--jgm-wline);
    stroke-width: 0.7;
  }
  .jh-m-page.jgm-home .wheel .tj-bg {
    fill: var(--jgm-tj-bg);
    stroke: none;
  }
  .jh-m-page.jgm-home .wheel .tj-tan {
    fill: var(--jgm-tj-tan);
    stroke: none;
  }
  .jh-m-page.jgm-home .wheel .tj-deep {
    fill: var(--jgm-tj-deep);
    stroke: none;
  }
  .jh-m-page.jgm-home .wheel .tj-light {
    fill: var(--jgm-tj-light);
    stroke: none;
  }

  /* ── 3b. Hero 文案（设计图实测：h1 字面 y174.2 / h2 219.0 / 短语 246.0 / 胶囊 147×34
        y273..307；h1 上方**没有**小字眉）────────────────────────────────── */
  .jh-m-page.jgm-home .copy {
    position: relative;
    z-index: 5;
    width: 88%;
    max-width: 520px;
    text-align: center;
    /* 设计图：胶囊下缘 307 → hero 底 336，差 29 → 29/390 = 7.44vw */
    padding: 0 16px calc(7.44vw + env(safe-area-inset-bottom, 0px));
  }
  .jh-m-page.jgm-home .copy .jg-mobile-title {
    margin: 0;
    font-size: clamp(34px, 9.5vw, 46px);
    line-height: 1.12;
    letter-spacing: 0.02em;
    font-weight: 600;
    color: var(--jgm-ink);
  }
  .jh-m-page.jgm-home .copy h2 {
    margin: 3px 0 0;
    font-size: 18px;
    line-height: 1.3;
    letter-spacing: 0.04em;
    font-weight: 500;
    color: var(--jgm-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
  }
  /* 设计图：h2 两侧各一条 20px 细线（1px） */
  .jh-m-page.jgm-home .copy h2:before,
  .jh-m-page.jgm-home .copy h2:after {
    content: '';
    width: 20px;
    height: 1px;
    flex: none;
    background: currentColor;
    opacity: 0.8;
  }
  .jh-m-page.jgm-home .copy p {
    margin: 4px 0 13px;
    color: var(--jgm-muted);
    font-size: 13px;
    line-height: 1.4;
    letter-spacing: 0.01em;
  }
  /* 暖金胶囊：设计图实测 147×34（填充色实测 #FFF1D0 → #D3AE71） */
  .jh-m-page.jgm-home .cta {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-width: 147px;
    min-height: 34px;
    padding: 0 7px;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid rgba(176, 138, 60, 0.55);
    background: linear-gradient(180deg, #fff1d0, #d3ae71);
    color: #2a1c08;
    box-shadow: 0 4px 14px rgba(112, 76, 25, 0.16);
    font-size: 13px;
    letter-spacing: 0.04em;
  }
  .jh-m-page.jgm-home .cta svg {
    width: 15px;
    height: 11px;
  }
  .jh-m-page.jgm-home .cta:after {
    content: '';
    position: absolute;
    inset: -5px -6px;
  }

  /* ══ 3c. 手机端唯一 AI 入口区（2026-10-01 业主指令：三块合一）
         「问 AI 一句话」独立按钮、Hero 的「开始我的人生推演」按钮均【已删除】；
         本区 = 四个高频场景（.jgm-scard）+ 底部自由提问（.jgm-free）
        位置：Hero 与四格入口之间（本文件里排在 .hero 之后、.entries 之前）。
        意义：手机端首页**原本没有任何 AI 区块**（.jh-ai 只存在于 PC 侧），这两块把
              「AI 入口」与「人生场景」搬进手机首页，且**不动任何既有区块**——
              下面 5 个既有区块（hero/entries/book/library/foot）的尺寸一字未改，
              只被整体下移一个常量（= 本两块的总高 341.9px @390）。
        令牌：全部沿用站内现有值，未新增任何色值/字体/圆角/阴影（逐条出处见下）；
              四行文案逐字取自 PC 端 src/components/home/HomeLifeQuestions.tsx。 */

  /* ── 唯一 AI 入口区（原「人生场景」；2026-10-01 三块合一 + 方案1 压缩）
        为什么是「一张卡四行」而不是「2×2 四张小卡」：2×2 会和下面现有的四格工具入口长得
        一模一样（两排八张同款卡分不清哪排是新增的）。改用它：大卡母题 = .card（底/描边/圆角 14），
        行内分隔线母题 = .foot-grid a+a:before 那条内缩细线（转 90°）→ 形状上立刻与 9px 圆角
        + 四角花饰的小卡区分开，却**没有一个新令牌**。 */
  .jh-m-page.jgm-home .jgm-scene {
    margin: 1.6vw 21.5px 0; /* 上距 Hero（原「上距 AI 按钮 16px」，AI 按钮已删 ⇒
                               改用 Hero 下第一块同一令牌 1.6vw，视觉间距不变） */
    position: relative;
    z-index: 3;
  }
  /* 标题「人生场景」：17px（.card h2）+ 两侧各一条 20px 细线（.copy h2:before/after 母题） */
  .jh-m-page.jgm-home .jgm-scene h2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 0;
    font-size: 17px;
    line-height: 1.2;
    letter-spacing: 0.02em;
    font-weight: 600;
    color: var(--jgm-ink);
  }
  .jh-m-page.jgm-home .jgm-scene h2:before,
  .jh-m-page.jgm-home .jgm-scene h2:after {
    content: '';
    width: 20px;
    height: 1px;
    flex: none;
    background: currentColor;
    opacity: 0.8;
  }
  /* 副题：11px / var(--jgm-muted)（.card p 同值） */
  .jh-m-page.jgm-home .jgm-scene p {
    margin: 6.8px 0 0;
    text-align: center;
    font-size: 11px;
    line-height: 1.35;
    color: var(--jgm-muted);
  }
  /* 自由提问入口（2026-10-01 业主指令新增）：一行文字链 → /ai 自由对话 */
  .jh-m-page.jgm-home .jgm-free {
    margin-top: 10px;
    text-align: center;
  }
  .jh-m-page.jgm-home .jgm-free a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding-bottom: 1px;
    font-size: 12px;
    line-height: 1.4;
    letter-spacing: 0.02em;
    color: var(--jgm-muted);
    border-bottom: 1px solid rgba(176, 138, 60, 0.35);
  }
  .jh-m-page.jgm-home .jgm-free a svg {
    width: 13px;
    height: 10px;
  }
  /* 卡：底 var(--jgm-surface) + 描边 var(--jgm-cardline) + 圆角 14px（.card 三条） */
  .jh-m-page.jgm-home .jgm-scard {
    margin-top: 6.8px; /* 卡纵距令牌（四格卡 gap 的纵向值） */
    background: var(--jgm-surface);
    border: 1px solid var(--jgm-cardline);
    border-radius: 14px;
    overflow: hidden;
  }
  .jh-m-page.jgm-home .jgm-scard a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12.3px; /* 四格卡横距 */
    /* 2026-10-01 下午（业主方案1）：每行 56 → 42px ⇒ 卡高 226 → 170px（= 3/4）；
       四行各自的箭头已删除 ⇒ 右内距收回箭头那 11.6px（37.6 → 26），
       但【26px 安全边距必须保留】：站内全局浮标「专家解析」
       （FloatingExpertButton.tsx = fixed right-0 top-1/2，390 宽实测矩形 x 352..390）
       正好落在本卡右缘，收窄到 16px 会让问句文字被浮标压住。 */
    min-height: 42px;
    padding: 0 26px 0 16px;
  }
  /* 行间分隔线：内缩细线（.foot-grid a + a:before 母题，转 90°） */
  .jh-m-page.jgm-home .jgm-scard a + a:before {
    content: '';
    position: absolute;
    left: 16px;
    right: 16px;
    top: 0;
    height: 1px;
    background: var(--jgm-cardline);
  }
  .jh-m-page.jgm-home .jgm-scard b {
    flex: none;
    font-size: 12px;
    line-height: 1;
    letter-spacing: 0.04em;
    font-weight: 600;
    color: var(--jgm-ink); /* .entries b */
  }
  /* 问句：11px（.card p）；nowrap + 省略号 → 任何字体回退/系统字号放大都不会把行撑高 */
  .jh-m-page.jgm-home .jgm-scard span {
    flex: 1;
    min-width: 0;
    font-size: 11px;
    line-height: 1.35;
    color: var(--jgm-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* ══ 4. 四格入口（设计图实测：4 张独立卡 167.3×77.3、横距 12.3 纵距 6.8、页边距 21.5、
        1px 暖金描边 + 四角花饰、图标 52 在左（左内缩 2.3）、标题 12 / 副标题 9、
        箭头 10×6.5 在右下（右 11.6 / 底 22.4））════════════════════════════ */
  .jh-m-page.jgm-home .entries {
    margin: 0.95vw 21.5px 0;
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.74vw 12.3px;
  }
  .jh-m-page.jgm-home .entries a {
    position: relative;
    min-height: 19.82vw; /* 设计图 77.3/390 */
    /* 底 8：设计图卡内内容整体比几何中心高 ~8（底部让给箭头） */
    padding: 0 11.6px 8px 2.3px;
    display: flex;
    align-items: center;
    background: var(--jgm-surface);
    border: 1px solid var(--jgm-cardline);
    border-radius: 9px;
  }
  .jh-m-page.jgm-home .entries .med {
    flex: none;
    width: 52px;
    height: 52px;
    color: var(--jgm-gold);
  }
  .jh-m-page.jgm-home .entries .med svg {
    display: block;
    width: 100%;
    height: 100%;
  }
  .jh-m-page.jgm-home .entries .tx {
    margin-left: 20.5px;
    /* 设计图：文字块中心比图标中心再高 ~6 */
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    min-width: 0;
  }
  .jh-m-page.jgm-home .entries b {
    font-size: 12px;
    line-height: 1;
    letter-spacing: 0.04em;
    font-weight: 600;
    color: var(--jgm-ink);
  }
  .jh-m-page.jgm-home .entries small {
    font-size: 9px;
    line-height: 1;
    color: var(--jgm-muted);
    white-space: nowrap;
  }
  /* 箭头：设计图在文字下方偏右下（右 11.6 / 底 22.4），不占文字宽度 */
  .jh-m-page.jgm-home .entries em {
    position: absolute;
    right: 11.6px;
    bottom: 22.4px;
    width: 11px;
    height: 8px;
    color: var(--jgm-gold);
  }
  .jh-m-page.jgm-home .entries em svg {
    display: block;
    width: 100%;
    height: 100%;
  }
  /* 四角花饰（设计图：卡角上的金线「弧 + 叶」小花饰，约 13×13，贴在框角内侧） */
  .jh-m-page.jgm-home .entries .co {
    position: absolute;
    width: 13px;
    height: 13px;
    background: var(--jgm-gold);
    opacity: 0.85;
    -webkit-mask-image: var(--jgm-corner);
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    -webkit-mask-size: contain;
    mask-image: var(--jgm-corner);
    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: contain;
    pointer-events: none;
  }
  .jh-m-page.jgm-home .entries .co.tl {
    top: 2px;
    left: 2px;
  }
  .jh-m-page.jgm-home .entries .co.tr {
    top: 2px;
    right: 2px;
    transform: rotate(90deg);
  }
  .jh-m-page.jgm-home .entries .co.br {
    bottom: 2px;
    right: 2px;
    transform: rotate(180deg);
  }
  .jh-m-page.jgm-home .entries .co.bl {
    bottom: 2px;
    left: 2px;
    transform: rotate(270deg);
  }

  /* ══ 5. 卡片（设计图：易学书馆 = 左书脊照 + 右文案；九宫文库 = 标题 + 4 带图标统计）
        区块间距实测：入口→书馆 6.2（1.6vw）· 书馆→文库 10.1（2.6vw）· 文库→页脚 9.7（2.5vw）═ */
  .jh-m-page.jgm-home .card {
    position: relative;
    margin: 0 21.5px;
    background: var(--jgm-surface);
    border: 1px solid var(--jgm-cardline);
    border-radius: 14px;
    overflow: hidden;
  }
  /* 易学书馆：设计图实测 342×106.3，左图占 46%（书脊照片，只缩放不裁切） */
  .jh-m-page.jgm-home .book {
    margin-top: 1.6vw;
    display: grid;
    grid-template-columns: 46% 1fr;
    min-height: 27.26vw; /* 106.3/390 */
  }
  .jh-m-page.jgm-home .books {
    display: block;
    width: 100%;
    height: auto;
    align-self: stretch;
    object-fit: contain;
    -webkit-user-drag: none;
    user-select: none;
  }
  /* 九宫传习配图取景（2026-10-01 业主选定方案一）
     缘由：业主原图 传习图1.png 是「横向山水 + 左侧书脊点缀」，整张塞进 159×105 图槽后
     书脊只占左 1/3、右侧一片留白，观感「空、松、弱」，与易学书馆（原图本身就是书脊特写、
     铺满整格）不一致。故仅对本块用取景框对准左侧书脊段：
       · 源文件【一个像素不动】——不裁切、不调色、不加滤镜 ✓
       · 与易学书馆用的是同一套做法（object-fit: cover 取局部）⇒ 风格统一 ✓
     清晰度核算：书脊段在原图约 513×1021px，显示 159×105 高清屏 @3x 需 477×315px ⇒ 有余量 ✓ */
  .jh-m-page.jgm-home .chuanxi .slot {
    overflow: hidden; /* ★ 关键：裁掉放大后溢出的部分，否则会压住右侧文字 */
    align-self: stretch;
  }
  .jh-m-page.jgm-home .chuanxi .slot .books {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* 取景值由业主可视比对确定（9 组参数网格，业主/助手共同选定 0% · 2.8）：
       五本书脊完整入镜、铺满整格、无过度裁切、文字清晰，最接近易学书馆的满构图。 */
    object-position: 0% 50%;
    transform: scale(2.8);
    transform-origin: 0% 50%;
  }
  .jh-m-page.jgm-home .book-tx {
    padding: 17px 16px 14px 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .jh-m-page.jgm-home .card h2 {
    margin: 0 0 2px;
    font-size: 17px;
    line-height: 1.2;
    letter-spacing: 0.02em;
    font-weight: 600;
    color: var(--jgm-ink);
  }
  .jh-m-page.jgm-home .card p {
    margin: 0 0 8px;
    color: var(--jgm-muted);
    font-size: 11px;
    line-height: 1.35;
  }
  .jh-m-page.jgm-home .card a {
    color: var(--jgm-gold);
    font-size: 13px;
    line-height: 1.35;
    letter-spacing: 0.02em;
  }
  /* 九宫文库：设计图实测 342×109.2；卡内行位（相对卡顶）标题 12.3 / 副题 34.2 /
     统计 50.7 / 进入文库 78.6 / 卡底 109.2 */
  .jh-m-page.jgm-home .library {
    margin-top: 2.6vw;
    padding: 8px 21px 8px;
    min-height: 28vw; /* 109.2/390 */
    /* 卡内最后一行是裸 <a>（inline）→ 行盒由父级 strut 决定；锁 1.2 才与设计图行高一致 */
    line-height: 1.2;
  }
  .jh-m-page.jgm-home .library h2 {
    margin: 0 0 2px;
  }
  .jh-m-page.jgm-home .library p {
    margin: 0 0 2px;
  }
  /* 4 个统计：各自图标在上、数字与单位同一行在下，项间一条细竖线（设计图） */
  .jh-m-page.jgm-home .stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin: 0;
  }
  .jh-m-page.jgm-home .stats > span {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    text-align: center;
    color: var(--jgm-muted);
    font-size: 11px;
    line-height: 1;
  }
  .jh-m-page.jgm-home .stats > span + span {
    border-left: 1px solid var(--jgm-cardline);
  }
  .jh-m-page.jgm-home .stats .st-ic {
    width: 15px;
    height: 15px;
    color: var(--jgm-gold);
  }
  .jh-m-page.jgm-home .stats .st-ic svg {
    display: block;
    width: 100%;
    height: 100%;
  }
  .jh-m-page.jgm-home .stats em {
    font-style: normal;
    display: inline-flex;
    align-items: baseline;
    gap: 0;
    color: var(--jgm-muted);
  }
  .jh-m-page.jgm-home .stats b {
    color: var(--jgm-ink);
    font-size: 13px;
    font-weight: 500;
  }

  /* ══ 6. 页脚（设计图：四格盒子 46.7 高、项间细竖线；其下「花形纹 + 细横线 + 底部山水带」
        —— 由 .jgm-bottom-art 承载，横线与花饰就在该素材原位）════════════════ */
  .jh-m-page.jgm-home .foot {
    margin: 2.5vw 21.5px 0;
    /* 设计图：页脚盒下缘 787 → 页面底 843 = 56 */
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  }
  .jh-m-page.jgm-home .foot-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    background: var(--jgm-surface);
    border: 1px solid var(--jgm-cardline);
    border-radius: 14px;
  }
  .jh-m-page.jgm-home .foot-grid a {
    position: relative;
    /* 设计图页脚盒外高 46.7（含 1px 上下描边）→ 单元格 44.7 */
    min-height: 44.7px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--jgm-ink);
    font-size: 10px;
    line-height: 1;
  }
  /* 设计图：项间是一条**内缩**的细竖线（上下各留 ~5px），不是通高分隔线 */
  .jh-m-page.jgm-home .foot-grid a + a {
    border-left: 0;
  }
  .jh-m-page.jgm-home .foot-grid a + a:before {
    content: '';
    position: absolute;
    left: 0;
    top: 5px;
    bottom: 5px;
    width: 1px;
    background: var(--jgm-cardline);
  }
  .jh-m-page.jgm-home .foot-grid a svg {
    color: var(--jgm-gold);
    width: 16px;
    height: 16px;
    display: block;
  }

  /* ══ 6b. 底部山水带（设计图最底部那条祥云山水 + 花形纹）：站内既有真实素材，
        只缩放、贴底、无滤镜；上缘羽化让它在昼夜两套底色下都不出现硬边。 */
  .jh-m-page.jgm-home .jgm-main {
    position: relative;
    z-index: 0;
  }
  .jh-m-page.jgm-home .jgm-bottom-art {
    position: absolute;
    z-index: -1;
    left: 0;
    right: 0;
    bottom: 0;
    /* 390 宽 → 110 高（素材 1533×434，只等比缩放，不裁切） */
    height: 28.2vw;
    background: url('/home/mobile-foot.webp') center bottom / 100% auto no-repeat;
    -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 32%);
    mask-image: linear-gradient(180deg, transparent 0, #000 32%);
    pointer-events: none;
  }

  /* ══ 7. 抽屉 + 遮罩（用户 .overlay / .drawer 原值）═════════════════════ */
  .jh-m-page.jgm-home .overlay {
    position: fixed;
    z-index: 1100;
    inset: 0;
    background: rgba(20, 18, 14, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: 0.25s;
  }
  .jh-m-page.jgm-home .overlay.open {
    opacity: 1;
    pointer-events: auto;
  }
  .jh-m-page.jgm-home .drawer {
    position: fixed;
    z-index: 1200;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(82vw, 360px);
    padding: calc(24px + env(safe-area-inset-top, 0px)) 25px calc(24px + env(safe-area-inset-bottom, 0px));
    background: color-mix(in srgb, var(--jgm-surface) 97%, transparent);
    border-left: 1px solid var(--jgm-cardline);
    box-shadow: -12px 0 40px rgba(30, 25, 18, 0.12);
    transform: translateX(105%);
    transition: transform 0.3s cubic-bezier(0.22, 0.61, 0.36, 1);
    overflow: auto;
    color: var(--jgm-ink);
  }
  .jh-m-page.jgm-home .drawer.open {
    transform: translateX(0);
  }
  .jh-m-page.jgm-home .drawer-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--jgm-cardline);
    color: var(--jgm-gold);
    font-size: 20px;
    letter-spacing: 0.1em;
  }
  .jh-m-page.jgm-home .drawer-head button {
    border: 0;
    background: transparent;
    color: var(--jgm-ink);
    font-size: 30px;
    line-height: 1;
    padding: 0 4px;
    cursor: pointer;
  }
  /* ⚠ 功能必须项：本元素是 <nav>，会命中 PC 侧 home-1to1.css 的 `html.jg-home-top nav` /
     `html.jg-home-scrolled nav { background: rgba(8,11,12,.94)!important }`（首页滚动后
     HomeClient 会给 html 挂 jg-home-scrolled）→ 整块抽屉会被染成暗底。本选择器特异性更高，
     同为 !important 时本文件胜出。 */
  .jh-m-page.jgm-home .drawer nav {
    display: block;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0;
    margin: 0;
  }
  .jh-m-page.jgm-home .drawer nav a,
  .jh-m-page.jgm-home .drawer > a,
  .jh-m-page.jgm-home .drawer > button {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    min-height: 56px;
    border: 0;
    border-bottom: 1px solid var(--jgm-cardline);
    background: transparent;
    color: var(--jgm-ink) !important;
    font: inherit;
    font-size: 16px;
    text-align: left;
    cursor: pointer;
    padding: 0;
  }
  .jh-m-page.jgm-home .drawer nav span {
    color: var(--jgm-gold);
    font-size: 22px;
  }
  .jh-m-page.jgm-home .drawer hr {
    border: 0;
    border-top: 1px solid var(--jgm-cardline);
    margin: 24px 0;
  }
  .jh-m-page.jgm-home .drawer-lang {
    justify-content: flex-start !important;
  }
  .jh-m-page.jgm-home .drawer-lang,
  .jh-m-page.jgm-home .drawer-theme {
    width: auto !important;
    min-width: 84px;
    display: inline-flex !important;
    justify-content: center !important;
    margin: 0 10px 14px 0;
    padding: 0 16px !important;
    border: 1px solid var(--jgm-cardline) !important;
    border-radius: 999px;
    min-height: 40px !important;
    letter-spacing: 0.1em;
  }

  /* ══ 8. 窄屏微调（设计图是 390 稿；375/360 下按比例收，文字不掉行）══════ */
  @media (max-width: 370px) {
    .jh-m-page.jgm-home .jg-header {
      padding-left: 21px;
      padding-right: 21px;
    }
    .jh-m-page.jgm-home .entries,
    .jh-m-page.jgm-home .card,
    .jh-m-page.jgm-home .foot,
    .jh-m-page.jgm-home .jgm-scene {
      margin-left: 19px;
      margin-right: 19px;
    }
    .jh-m-page.jgm-home .entries .med {
      width: 48px;
      height: 48px;
    }
    .jh-m-page.jgm-home .entries .tx {
      margin-left: 16px;
    }
    .jh-m-page.jgm-home .library {
      padding-left: 19px;
      padding-right: 19px;
    }
  }

  /* ══ 9. 动效降级（用户 @media(prefers-reduced-motion) 原值）═════════════ */
  @media (prefers-reduced-motion: reduce) {
    .jh-m-page.jgm-home .wheel .w-orbit,
    .jh-m-page.jgm-home .wheel .w-bagua,
    .jh-m-page.jgm-home .wheel .w-scale,
    .jh-m-page.jgm-home .wheel .w-taiji,
    .jh-m-page.jgm-home .wheel .w-glow {
      animation: none;
    }
    .jh-m-page.jgm-home .jg-header,
    .jh-m-page.jgm-home .drawer,
    .jh-m-page.jgm-home .overlay {
      transition: none;
    }
  }

  /* ══ 10. 关键帧（用户指令：分层各自 linear/infinite，transform-origin:center）══ */
  @keyframes jgm-spin {
    to {
      transform: rotate(360deg);
    }
  }
  @keyframes jgm-spin-rev {
    to {
      transform: rotate(-360deg);
    }
  }
  @keyframes jgm-breath {
    to {
      opacity: 0.82;
      transform: scale(1.06);
    }
  }
}

/* ── 设计图装饰形状（本体放 :root 以免被 media 包裹后在 .jgm-home 之外的层叠里丢失；
      只作 mask/background，颜色由令牌决定）────────────────────────────────────
   · --jgm-corner：四格卡四角「弧 + 叶」花饰（金线，13×13）
   · --jgm-band  ：hero 下缘「云纹双细线 + 中心花饰」装饰带（页宽贯通，4.1vw 高） */
:root {
  --jgm-corner: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='white' stroke-width='1.25' stroke-linecap='round'%3E%3Cpath d='M2.4 16.6A14.2 14.2 0 0 1 16.6 2.4'/%3E%3Cpath d='M3.2 3.2c5.4.7 9 3.7 10.1 9.2C7.9 11.7 3.9 8.6 3.2 3.2Z'/%3E%3Ccircle cx='6.6' cy='6.6' r='1.3'/%3E%3C/g%3E%3C/svg%3E");
  --jgm-band: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 390 16' preserveAspectRatio='none'%3E%3Cg fill='none' stroke='%23b08a3c' stroke-opacity='.34' stroke-width='.6'%3E%3Cpath d='M0 4c24-4 40 4 62 1s36-7 58-3 38 7 60 4 36-7 58-4 38 8 60 5 36-6 58-4 34 5 54 3'/%3E%3Cpath d='M0 12c26-3 42 4 64 1s34-6 56-3 40 7 62 4 34-7 56-4 38 8 60 5 34-6 56-4 30 4 46 2'/%3E%3C/g%3E%3Cg stroke='%23b08a3c' stroke-opacity='.5' stroke-width='.7' fill='none'%3E%3Cpath d='M195 2.4c3.4 2 5 4.6 5 7.6 0-3 1.6-5.6 5-7.6-3.4-2-5-4.6-5-7.6 0 3-1.6 5.6-5 7.6Z'/%3E%3Ccircle cx='195' cy='7.8' r='1.1'/%3E%3C/g%3E%3C/svg%3E");
}

