﻿/* =====================================================================
   金橡树官网 —— 按设计稿 1920 x 15764 逐像素还原
   坐标系：设计稿像素（px）。1u = 1 设计像素，--u = clientWidth / 1920。
   ===================================================================== */

/* ================= 字体 =================
   设计稿中文的等效墨量约为 Noto Sans SC 130（Adobe 思源黑体字重虽相同，
   但 Chrome 的灰度抗锯齿光晕比 Illustrator 宽约 1px，需用更轻的字重补偿）。
   --cw-l / --cw-r / --cw-m 为调试用的字重覆盖。 */
@font-face { font-family: 'Noto Sans SC'; src: url('../fonts/NotoSansSC-100.woff2') format('woff2'); font-weight: 100; font-style: normal; font-display: swap; }
/* Adobe 思源黑体（由 AI 设计源内嵌子集转换）：眉标的拉丁步进与 Adobe 原版一致 */
@font-face { font-family: 'Adobe SHSC'; src: url('../fonts/AdobeSHSC-Light.woff2') format('woff2'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Adobe SHSC'; src: url('../fonts/AdobeSHSC-Normal.woff2') format('woff2'); font-weight: 350; font-style: normal; font-display: swap; }
@font-face { font-family: 'Adobe SHSC'; src: url('../fonts/AdobeSHSC-Regular.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Adobe SHSC'; src: url('../fonts/AdobeSHSC-Medium.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Noto Sans SC'; src: url('../fonts/NotoSansSC-150.woff2') format('woff2'); font-weight: 150; font-style: normal; font-display: swap; }
@font-face { font-family: 'Noto Sans SC'; src: url('../fonts/NotoSansSC-200.woff2') format('woff2'); font-weight: 200; font-style: normal; font-display: swap; }
@font-face { font-family: 'Noto Sans SC'; src: url('../fonts/NotoSansSC-250.woff2') format('woff2'); font-weight: 250; font-style: normal; font-display: swap; }
@font-face { font-family: 'Noto Sans SC'; src: url('../fonts/NotoSansSC-300.woff2') format('woff2'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Noto Sans SC'; src: url('../fonts/NotoSansSC-350.woff2') format('woff2'); font-weight: 350; font-style: normal; font-display: swap; }
@font-face { font-family: 'Noto Sans SC'; src: url('../fonts/NotoSansSC-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Noto Sans SC'; src: url('../fonts/NotoSansSC-450.woff2') format('woff2'); font-weight: 450; font-style: normal; font-display: swap; }
@font-face { font-family: 'Noto Sans SC'; src: url('../fonts/NotoSansSC-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Noto Sans SC'; src: url('../fonts/NotoSansSC-550.woff2') format('woff2'); font-weight: 550; font-style: normal; font-display: swap; }
@font-face { font-family: 'Noto Sans SC'; src: url('../fonts/NotoSansSC-600.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Noto Sans SC'; src: url('../fonts/NotoSansSC-650.woff2') format('woff2'); font-weight: 650; font-style: normal; font-display: swap; }
@font-face { font-family: 'Outfit Thin Web'; src: url('../fonts/Outfit-100.ttf') format('truetype'); font-weight: 100; font-style: normal; font-display: swap; }
@font-face { font-family: 'Outfit Thin Web'; src: url('../fonts/Outfit-150.ttf') format('truetype'); font-weight: 150; font-style: normal; font-display: swap; }
@font-face { font-family: 'Outfit Thin Web'; src: url('../fonts/Outfit-200.ttf') format('truetype'); font-weight: 200; font-style: normal; font-display: swap; }
@font-face { font-family: 'Outfit Thin Web'; src: url('../fonts/Outfit-250.ttf') format('truetype'); font-weight: 250; font-style: normal; font-display: swap; }
@font-face { font-family: 'Outfit Thin Web'; src: url('../fonts/Outfit-300.ttf') format('truetype'); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: 'Outfit Thin Web'; src: url('../fonts/Outfit-400.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: swap; }

/* ================= 基础 ================= */
:root {
  --u: calc(100vw / 1920);
  --nav-h: calc(var(--u) * 121);
  --gold: #dba40e;
  --gold-bright: #f6c01f;
  --olive: #717051;
  --olive-sub: #776e5c;
  --cream: #eeece0;
  --green-black: #12130d;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Noto Sans SC', 'Source Han Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--olive);
  background: var(--cream);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ================= 导航 =================
   设计稿基准 1920 宽（AI 源权威值）：
   logo x64.06–297.46 / y48.23–93.84；
   菜单 SourceHanSansCN-Regular 20.17px，字距 2.017(0.1em)，基线 y=69.34，
   7 项起点 878.60 / 1013.11 / 1147.61 / 1304.31 / 1461.00 / 1595.50 / 1752.23；
   项间距 45.765（= 步进差 - 字距尾距）；分割线 y=120。--u = clientWidth / 1920。 */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: calc(var(--u) * 121);
  background: transparent;
  transition: background-color .3s ease;
}
.nav.is-scrolled { background: rgba(18,19,13,.94); }
.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--u) * 22) calc(var(--u) * 56.22) 0 calc(var(--u) * 64.06);
  /* 首屏 hero 底图已包含设计稿的分隔线（y=119..120），
     这里再画一次会叠加变亮 → 与设计稿不符 */
  border-bottom: 0 solid transparent;
}
.nav .brand { display: flex; align-items: center; gap: 0; }
.brand-logo {
  width: calc(var(--u) * 233.4);
  height: auto;
  display: block;
}
.nav-menu {
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 45.765);
  /* CSS 字距会在末字后多留一份，需回退 2.017+0.61 使末项与 AI 右边界对齐 */
  margin-right: calc(var(--u) * -0.61);
  transform: translateY(calc(var(--u) * var(--nm-ty, -7.6)));
}
/* 导航右侧容器：菜单 + 中英文切换（对齐线上 goldentree-home.com 的 CMS 语言入口） */
.nav-right {
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 30);
}
/* nav-panel 仅是结构包装：桌面端展开为 contents，.nav-menu/.nav-lang 仍直接参与
   .nav-right 的 flex 排布（几何与之前完全一致）；移动端才变成汉堡下拉面板。 */
.nav-panel { display: contents; }
.nav-lang {
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 16);
  transform: translateY(calc(var(--u) * var(--nm-ty, -7.6)));
}
.nav-lang a {
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 6);
  color: #ffffff;
  font-family: 'Noto Sans SC', 'Source Han Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: calc(var(--u) * 14);
  font-weight: 400;
  line-height: 1;
  letter-spacing: calc(var(--u) * .4);
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s;
}
.nav-lang a.on { color: var(--gold-bright, #f6c01f); }
.nav-lang a:hover { color: var(--gold-bright, #f6c01f); }
.nav-lang img {
  width: calc(var(--u) * 18);
  height: calc(var(--u) * 18);
  display: block;
}
.nav-menu a {
  /* 设计稿实测：导航笔画核心为纯白 255（AI 源 PDF 文字为 fill + 白描边），
     非 #f9f8f1（其核心只有 246）。 */
  color: #ffffff;
  font-family: 'Noto Sans SC', 'Source Han Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: calc(var(--u) * var(--nm-fs, 20.17));
  line-height: 1;
  letter-spacing: calc(var(--u) * var(--nm-ls, 2.017));
  /* 字重定档：设计稿导航文字 = SourceHanSansCN-Regular + 白描边加粗渲染。
     实测导航文字区亮像素：设计稿 2948；实现 200→2422 / 250→2680 / 300→2938 /
     350→3717 / 400→4067。fw=300 与设计稿墨量只差 0.3%，为物理匹配最佳值
     （200 过瘦、400 过肥）。 */
  font-weight: var(--nm-fw, 300);
  white-space: nowrap;
  padding: 6px 0;
  position: relative;
  transition: color .2s;
}
.nav-menu a::after {
  content: "";
  position: absolute;
  left: 0; right: 100%; bottom: 0;
  height: 2px;
  background: var(--gold-bright);
  transition: right .25s;
}
.nav-menu a:hover { color: var(--gold-bright); }
.nav-menu a:hover::after { right: 0; }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { display: block; width: 24px; height: 2px; background: #fff; margin: 5px 0; transition: .3s; }
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ================= 画布 ================= */
.canvas {
  position: relative;
  width: 100%;
  height: calc(15764 * var(--u));
  overflow: hidden;
  background: var(--cream);
}

/* 底色块 */
.bg {
  position: absolute;
  left: calc(var(--x) * var(--u));
  top: calc(var(--y) * var(--u));
  width: calc(var(--w) * var(--u));
  height: calc(var(--h) * var(--u));
  background: var(--c);
}
.bg.rb { border-radius: calc(9 * var(--u)); }
.bg.img-bg {
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: 0 0;
}
.bg.supply {
  background-image: url('../img/ai/supply-full.png');
}
/* WebP 优先（体积 2.47MB → 0.29MB），PNG 兜底；
   image-set 不被支持的老浏览器直接沿用上面那条 PNG 规则。 */
@supports (background-image: image-set(url('data:,') 1x type('image/webp'))) {
  .bg.supply {
    background-image: image-set(url('../img/ai/supply-full.webp') 1x type('image/webp'));
  }
}
.bg.foot {
  /* 原引用 ../img/ai/footer-full.png（1.27MB）+ 同名 .webp，
     但页面里没有任何元素带 .bg.foot 类（页脚底图实际是 .bg.img-bg.foot-on
     → footer-online-bg.png），属于死规则 + 死资源，已移除。 */
}

/* 图片 */
.im {
  position: absolute;
  left: calc(var(--x) * var(--u));
  top: calc(var(--y) * var(--u));
  width: calc(var(--w) * var(--u));
  height: calc(var(--h) * var(--u));
  object-fit: fill;
}

/* 文字 */
.tx {
  position: absolute;
  left: calc(var(--x, 0) * var(--u));
  top: calc((var(--y) + var(--dy, 0) * var(--fs)) * var(--u));
  font-size: calc(var(--fs) * var(--u));
  line-height: 1;
  white-space: nowrap;
  margin: 0;
  color: var(--c, #717051);
  letter-spacing: var(--ls, 0);
  font-family: 'Noto Sans SC', 'Source Han Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-weight: 400;
  /* 墨量补偿：设计稿由 PDF 光栅化，笔画"窄而浓"（stem darkening），
     Chrome 灰度抗锯齿则"宽而淡"。用同色极细描边给笔画加密度，
     不改变任何字形步进/排版（对比 font-weight 会改变字宽与字距）。 */
  -webkit-text-stroke-width: calc(var(--ts, 0) * var(--u));
  -webkit-text-stroke-color: currentColor;
/* 设计稿文字带一圈极淡的白色外发光（PDF 光栅化残留）；
   --halo 为发光半径（设计px），0 = 关闭。
   分色组独立控制：白/金色文字位于深色底图上，白晕会「加宽」笔画
   （实测覆盖率 24.5% vs 设计稿 19.3%），故默认关闭。 */
  text-shadow: 0 0 calc(var(--halo, 0.55) * var(--u)) #fff;
}
.tx.c { left: calc(var(--x, 0) * var(--u)); width: calc(var(--tw, 1920) * var(--u)); text-align: left; }
/* 逐字绝对定位：AI 源 PDF 的逐字 pen origin 直接落到 x 上，
   彻底消除「字面空格 vs Tc 字距」造成的横向漂移（眉标最大偏 21px）。 */
.tx .ch {
  position: absolute;
  left: calc(var(--cx) * var(--u));
  top: 0;
  font: inherit;
  letter-spacing: 0;
  white-space: pre;
}
/* 眉标等含连续空格的文本：保留原始空格（AI 源里字间是真实空格） */
.tx.ws { white-space: pre; }
/* 自动对位：居中元素整体微移（仅带 --tx 的元素生效） */
.tx[style*="--tx"] { transform: translateX(calc(var(--tx) * var(--u))); }
/* 调试：?nudge=序号:dx:dy 微调指定 .tx 元素（定位在 --tx 规则之后以覆盖） */
.tx.nudged { transform: translateX(calc((var(--tx, 0) + var(--nx, 0)) * var(--u))) translateY(calc(var(--ny, 0) * var(--u))); }
.tx.bx { text-align: center; width: calc(var(--w) * var(--u)); }
.tx.ls { margin-left: calc(var(--ls, 0) / 2); }
/* 文字内的超链接（页脚栏目等）：继承文字颜色，不加下划线 */
.tx a { color: inherit; text-decoration: none; }
.tx a:hover { color: var(--gold-bright, #f6c01f); }

/* 中文使用 Noto Sans SC（与设计稿 Adobe 思源黑体同源，步进/轮廓一致；
   由 AI 源转换的 Adobe SHSC 因 CID 子集丢失左边距 lsb 已弃用）。
   ?cf=1 可切回 Adobe SHSC 做对比。 */
.f-l { font-family: var(--cf, 'Noto Sans SC'), 'Source Han Sans SC', sans-serif; font-weight: var(--cw-l, 300); --dy: 0.92; }
.f-r { font-family: var(--cf, 'Noto Sans SC'), 'Source Han Sans SC', sans-serif; font-weight: var(--cw-r, 350); --dy: 0.92; }
.f-m { font-family: var(--cf, 'Noto Sans SC'), 'Source Han Sans SC', sans-serif; font-weight: var(--cw-m, 500); --dy: 0.92; }
.f-n { font-family: var(--cf, 'Noto Sans SC'), 'Source Han Sans SC', sans-serif; font-weight: var(--cw-n, 300); --dy: 0.92; }
.f-o { font-family: 'Outfit Thin Web', sans-serif; font-weight: var(--cw-o, 300); --dy: 0.12; }

/* 数据条的单位字（年 / 大 / 万 / 张 / +）用的是 <i> 标签，
   浏览器 UA 默认给 <i> 加 font-style:italic，会把它们渲染成斜体；
   设计稿真值里这些字是正体，这里统一压回正体。
   注意：不要把 <i> 改成 <span> —— build_en.py 的 TX_RE 用非贪婪 .*?</span>，
   里面的 <span class="ch"> 会被截断，英文页重建会坏。 */
i, em { font-style: normal; }

/* ===== 渲染差异补偿（按文字颜色分组）=====
   设计稿由 PDF 光栅化（stem darkening）：笔画「窄而浓」，核心明显深于标称色
   （实测 #717051 正文核心到 (62,62,22)）；Chrome 灰度抗锯齿则是「宽而淡」，
   核心恰好停在标称色、边缘光晕更宽。故分组补偿：
     · 浅底深字 #717051 / #776e5c → 提字重（补足墨量）+ 压暗标称色（还原深色核心）
     · 深底白字 #ffffff 等 → 降字重，压掉多余光晕
   默认值等同不改动，由调试参数寻优后固化。 */
/* 注意：选择器只匹配色值片段（不带 "--c:"）——
   fitTextWidths() 会用 el.style.setProperty() 改写 inline style，浏览器随即把
   style 属性重新序列化成 "--c: #717051;"（冒号后带空格），写成 [style*="--c:#717051"]
   会整体失配（实测压暗/字重旋钮完全不起作用）。 */
.tx[style*="#717051"] { color: color-mix(in srgb, var(--c) calc(var(--mk71, 100) * 1%), #000); }
.tx[style*="#776e5c"] { color: color-mix(in srgb, var(--c) calc(var(--mk77, 100) * 1%), #000); }
.tx[style*="#dba40e"] { color: color-mix(in srgb, var(--c) calc(var(--mkgd, 100) * 1%), #000); }
.tx[style*="#f6c01f"], .tx[style*="#f6c11f"] { color: color-mix(in srgb, var(--c) calc(var(--mkgo, 100) * 1%), #000); }

/* 浅底深字字重（深字需要补墨量） */
.tx[style*="#717051"].f-l, .tx[style*="#776e5c"].f-l { font-weight: var(--cw-dl, 300); }
.tx[style*="#717051"].f-r, .tx[style*="#776e5c"].f-r { font-weight: var(--cw-dr, 400); }
.tx[style*="#717051"].f-m, .tx[style*="#776e5c"].f-m { font-weight: var(--cw-dm, 500); }
.tx[style*="#717051"].f-n, .tx[style*="#776e5c"].f-n { font-weight: var(--cw-dn, 400); }

/* 深底白字字重（白字墨量过重，需减墨） */
.tx[style*="#ffffff"].f-r,
.tx[style*="#f8f6f3"].f-r,
.tx[style*="#f9f8f1"].f-r,
.tx[style*="#f9f6f3"].f-r { font-weight: var(--cw-wr, 400); }
.tx[style*="#ffffff"].f-m,
.tx[style*="#f8f6f3"].f-m,
.tx[style*="#f9f8f1"].f-m,
.tx[style*="#f9f6f3"].f-m { font-weight: var(--cw-wm, 450); }

/* 深底浅色文字：白色外发光会加宽笔画，单独一组旋钮（默认关闭） */
.tx[style*="#ffffff"], .tx[style*="#f8f6f3"], .tx[style*="#f9f8f1"],
.tx[style*="#edebdf"], .tx[style*="#eeece0"], .tx[style*="#fdf9f7"],
.tx[style*="#e3decb"], .tx[style*="#f9f6f3"] {
  text-shadow: 0 0 calc(var(--halo-l, 0) * var(--u)) #fff;
}
/* 金色文字（多在深底） */
.tx[style*="#dba40e"], .tx[style*="#dba404"],
.tx[style*="#f6c01f"], .tx[style*="#f6c11f"] {
  text-shadow: 0 0 calc(var(--halo-g, 0) * var(--u)) #fff;
}

/* 线 */
.ln {
  position: absolute;
  left: calc(var(--x) * var(--u));
  top: calc(var(--y) * var(--u));
  width: calc(var(--w) * var(--u));
  height: calc(var(--h, 1) * var(--u));
  background: var(--c);
}
.ln.v { width: calc(var(--w, 1) * var(--u)); height: calc(var(--h) * var(--u)); }

/* 描边按钮 / 描边卡片
   设计稿实测：描边色约 #928b78（1px 抗锯齿边），ODM 卡片圆角 9px，
   「查看详情」按钮圆角 3px；ODM 橄榄色卡片只有填充、没有描边。 */
.bbox, .card {
  position: absolute;
  left: calc(var(--x) * var(--u));
  top: calc(var(--y) * var(--u));
  width: calc(var(--w) * var(--u));
  height: calc(var(--h) * var(--u));
  border: calc(1 * var(--u)) solid var(--c, #928b78);
}
.bbox { border-radius: calc(3 * var(--u)); }
.card { --c: #928b78; border-radius: calc(9 * var(--u)); }

/* 矢量描边卡片：SVG 描边带抗锯齿，能还原设计稿 PDF 描边的柔和边缘
   （CSS border 在 Chrome 里是硬边、无 AA） */
.cs {
  position: absolute;
  left: calc(var(--x) * var(--u));
  top: calc(var(--y) * var(--u));
  width: calc(var(--w) * var(--u));
  height: calc(var(--h) * var(--u));
  overflow: visible;
}
.cs rect { vector-effect: none; }

/* 首屏底图：改用 <picture> + <img>（WebP 优先，PNG 兜底），
   移动端另有一张「抹掉烙字」的 hero-design-m */
.hero-bg {
  position: absolute;
  left: 0; top: 0;
  width: 100%;
  height: calc(1014 * var(--u));
  background-color: var(--green-black);
  overflow: hidden;
}
picture { display: contents; }
/* <source> 永远不渲染（HTML 规范的呈现规则）。
   <picture> 用 display:contents 把子元素摊平交给父级排版时，
   若 <source> 仍参与 flex 排版，就会多出一个 0 宽幽灵项：
   导航语言区两个 <a> 各凭空多出 6px → .nav-lang 宽 12px，
   整条导航菜单被推离设计稿位置。 */
source { display: none; }
.hero-bg picture { display: block; width: 100%; height: 100%; }
.hero-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;     /* 桌面端盒子正好是 1920x1014，与原背景图等比 */
}

/* ================= 区块化骨架（移动端重排用） =================
   整页原本是一张固定高的绝对定位画布；为了做真正的手机端排版，
   把内容按语义包成 <section class="sec"> + 若干 .m-* 包裹层。
   桌面端这些包裹层一律 display:contents —— 不生成盒子，
   子元素仍以 .canvas 为包含块做绝对定位，几何与绘制顺序完全不变
   （.bg 底色块集中在 .bg-layer 内并保持原相对次序）。
   移动端（<=900px）由 css/mobile.css 把它们变成真正的流式块。 */
.bg-layer,
.sec,
.sec > *,
.m-grid, .m-head, .m-hero-media, .m-hero-txt,
.m-story-hero, .m-story-cap, .m-story-bg, .m-story-row, .m-strip,
.m-feature, .m-media, .m-body-col, .m-btn, .m-rule, .m-lead-col,
.m-tabbar, .m-pf-card, .m-trio, .m-trio-item, .m-cert-media, .m-cert-item,
.m-odm-item, .m-nature-media, .m-band, .m-foot-brand, .m-foot-col, .m-copy,
.m-news {
  display: contents;
}
/* 直接挂在区块下的底色块（页脚）不能进 display:contents —— 那会让它失去盒子 */
.sec > .bg { display: block; }


/* 箭头：设计稿为「长杆 + 细人字」矢量图形（随字号等比缩放） */
.arw {
  position: absolute;
  left: calc(var(--x) * var(--u));
  top: calc(var(--y) * var(--u));
  width: calc(var(--fs) * 1.266 * var(--u));
  height: calc(var(--fs) * 0.696 * var(--u));
  overflow: visible;
}
.arw path {
  fill: none;
  stroke: var(--c, #776e5c);
  stroke-width: 2;
  stroke-linecap: butt;
  stroke-linejoin: round;
}
.arw path:last-child { stroke-linecap: round; }

/* 全角标点挤压：Adobe 排版把全角标点的步进宽压到 50% em（字形本身不缩放）。
   实现方式：标点仍按全宽排版，再用负 margin 收回一半步进宽。
   不能用 inline-block + 定宽 —— 溢出的字形会污染父元素的固有宽度测量。 */
.pd { margin-right: calc((var(--pdr, 0.5) - 1) * 1em); }
/* Adobe 排版：间隔号「·」前的空格会被压缩 0.25em（实测：26px 字号下空格步进 8.45→1.95） */
.pdk { margin-right: -0.25em; }


/* ================= 交互：产品系列 tab =================
   默认态与设计稿完全一致（tab 为普通文字、无指示条、产品为 3×2 网格）；
   交互态全部由 .on / .pf-* 类驱动，未交互时不产生任何视觉差异。 */
.tx.ptab {
  cursor: pointer;
  color: var(--c, #717051);
  transition: color .28s ease;
}
.tx.ptab:hover { color: #b9902a; }
.tx.ptab.on { color: #dba404; }
/* 激活指示条：位于 tab 文字下方、横线区（设计稿 y≈5141） */
.tx.ptab::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: calc(-47.9 * var(--u));
  width: 0;
  height: calc(2.4 * var(--u));
  background: #dba404;
  border-radius: calc(1.2 * var(--u));
  transition: width .34s cubic-bezier(.22,.61,.36,1);
}
.tx.ptab.on::after { width: 100%; }

/* 产品网格项：聚焦切换用（位移 + 淡入淡出）
   位移变量用 --pfx/--pfy：--dy 已被 .tx 用作「基线微调(em)」，
   .f-r/.f-m 等字体类设为 0.92，.tx 的 top = (--y + --dy*--fs)*--u；
   若复用 --dy 会被文字元素顶出画布，--dx 则对 .tx 完全无效。 */
.pf-item {
  transition: opacity .22s ease, transform .48s cubic-bezier(.22,.61,.36,1);
}
.pf-item.pf-fade { opacity: 0; pointer-events: none; }
.pf-item.pf-move {
  transform: translate(calc(var(--pfx, 0) * var(--u)), calc(var(--pfy, 0) * var(--u)));
}

/* ================= 页脚（仿线上站 goldentree-home.com） =================
   背景用线上真实页脚图：原图 1920x510，线上以 background-position:50% 50% 居中放在
   436px 高的 zone 里（图片顶部落在 zone 上方 37px）。本页脚区 y15314.6..15764，
   zone 顶 = 15314.6、高 436（到 15750.6），故图片顶部相对底色块为 -37px。 */
.bg.img-bg.foot-on {
  background-image: url('../img/ai/footer-online-bg.png');
  background-size: calc(1920 * var(--u)) calc(510 * var(--u));
  background-position: 0 calc(-37 * var(--u));
  background-repeat: no-repeat;
}
@supports (background-image: image-set(url('data:,') 1x type('image/webp'))) {
  .bg.img-bg.foot-on {
    background-image: image-set(url('../img/ai/footer-online-bg.webp') 1x type('image/webp'));
  }
}
/* 分享图标：图标的深底是从线上渲染截图裁的，位置与背景图严格对齐才能无缝 */
.share {
  position: absolute;
  left: calc(var(--x) * var(--u));
  top: calc(var(--y) * var(--u));
  width: calc(var(--w) * var(--u));
  height: calc(var(--h) * var(--u));
  display: block;
}
.share img { width: 100%; height: 100%; display: block; }
/* 页脚灰字落在深底上，白色外发光会发虚 —— 关闭 */
.tx[style*="#878997"], .tx[style*="#7f7f7f"] { text-shadow: none; }
/* 页脚条目字重：线上站用微软雅黑 400，其 CJK 笔画墨量约为 Noto Sans SC 300 的 1.6 倍
   （实测「公司简介」区亮像素：线上 195 / Noto300 122 / Noto400 186），
   故页脚条目取 400 才与线上视觉一致；栏目标题（20px）实测 300 最接近（线上 521 / 300 496）。 */
.tx[style*="#878997"], .tx[style*="#7f7f7f"] { font-weight: 400; }

/* ================= 交互：ODM 合作背书 =================
   选中态 / 未选中态互斥（两种状态颜色相反）：
     选中态   = 橄榄绿底 #a4a47e + 描边透明 + 白色 logo
     未选中态 = 米色底 #eeece0 + 描边 #928b78 + 橄榄绿 logo
   默认「喜临门」为选中态（静态 HTML 已带 odm-on，首帧即目标像素）；
   悬停任一卡片或 logo → 与该项互换，指针移出区块后复位。
   每个 logo 有 深 / 浅 两版同坐标图片，由 JS 交叉淡入切换。 */
.odm-card {
  background-color: #eeece0;            /* 与所在区块底色一致 → 未选中态零像素变化 */
  transition: background-color .34s ease, border-color .34s ease, box-shadow .34s ease;
}
.odm-card.odm-on {
  background-color: #a4a47e;
  border-color: transparent;
}
/* 仅「指针悬停在该项上」时才浮起，默认选中态不投影 → 与设计稿像素一致 */
.odm-card.odm-hover {
  box-shadow: 0 calc(6 * var(--u)) calc(16 * var(--u)) rgba(38, 40, 24, .14);
}
.odm-logo, .odm-logo-w {
  cursor: pointer;
  transition: opacity .3s ease, transform .38s cubic-bezier(.22,.61,.36,1);
}
.odm-logo-w { opacity: 0; pointer-events: none; }
.odm-logo-w.odm-on { opacity: 1; pointer-events: auto; }
.odm-logo.odm-off { opacity: 0; pointer-events: none; }
.odm-logo:hover, .odm-logo-w:hover { transform: scale(1.07); }

/* ================= 动效系统 =================
   1) 滚动入场：分区 + 行错峰（淡入 + 上移）
      · 默认态 = 设计稿原像素：只有「初始视口之下」的元素才由 JS 加 .rev，
        故首屏与「视口 = 整页高」的全页截图都不会截到动画中间态；
      · 位移用独立 translate 属性（而非 transform），互不干扰
        .tx 的 translateX 居中、.pf-item 的位移动画、.odm-logo 的 scale 悬停。
   2) 悬停微动效
   3) 返回顶部 */
.rev {
  opacity: 0;
  translate: 0 calc(34 * var(--u));
}
/* 入场用 animation（而非 transition）：行错峰延迟归动画所有，
   不会泄漏到元素后续的悬停 transition（如箭头右移、卡片投影）。 */
.rev.in {
  opacity: 1;
  translate: 0 0;
  animation: rv-in .8s cubic-bezier(.22,.61,.36,1) backwards;
  animation-delay: calc(var(--rv-i, 0) * 85ms);
}
@keyframes rv-in {
  from { opacity: 0; translate: 0 calc(34 * var(--u)); }
  to { opacity: 1; translate: 0 0; }
}

/* 描边按钮（查看详情）：悬停描边转金 + 浮起，箭头右移 */
.bbox {
  transition: border-color .3s ease, box-shadow .3s ease;
}
.bbox.hov {
  border-color: #dba404;
  box-shadow: 0 calc(6 * var(--u)) calc(16 * var(--u)) rgba(38, 40, 24, .16);
}
.arw { transition: transform .4s cubic-bezier(.22,.61,.36,1); }
.arw.hov { transform: translateX(calc(7 * var(--u))); }

/* 产品 tab：悬停上移 + 文字转金 */
.ptab {
  cursor: pointer;
  transition: color .28s ease, translate .28s cubic-bezier(.22,.61,.36,1);
}
.ptab:hover { color: #dba40e; translate: 0 calc(-3 * var(--u)); }

/* 认证图标（小徽标）：悬停上浮 + 放大 */
.im[src*="icons/cert-"] { transition: transform .45s cubic-bezier(.22,.61,.36,1); }
.im[src*="icons/cert-"]:hover { transform: translateY(calc(-7 * var(--u))) scale(1.09); }

/* 页脚链接：悬停转金 */
.tx a { transition: color .25s ease; }
.tx a:hover { color: var(--gold-bright); }

/* 返回顶部 */
.totop {
  position: fixed;
  right: calc(26 * var(--u));
  bottom: calc(26 * var(--u));
  width: calc(46 * var(--u));
  height: calc(46 * var(--u));
  display: grid;
  place-items: center;
  border: calc(1 * var(--u)) solid rgba(255, 255, 255, .28);
  border-radius: 50%;
  background: rgba(18, 19, 13, .5);
  backdrop-filter: blur(8px);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(calc(10 * var(--u)));
  transition: opacity .3s ease, transform .3s ease, visibility .3s ease, color .25s ease, border-color .25s ease;
  z-index: 90;
}
.totop.show { opacity: 1; visibility: visible; transform: none; }
.totop:hover {
  background: rgba(18, 19, 13, .74);
  border-color: var(--gold-bright);
  color: var(--gold-bright);
}
.totop svg {
  width: 52%;
  height: 52%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ================= 移动端 ================= */
/* 移动端头部/底部参照 goldentree-home.com 原站移动端版式：
   · 顶部固定栏（50px）：左品牌标识，右侧语言入口 + 汉堡菜单；
   · 菜单面板从右侧滑入（宽 78vw / 上限 300px），配半透明遮罩；
   · 底部固定栏：三个「图标 + 文字」快捷入口（首页 / 产品 / 联系）。 */
/* 底部固定快捷栏 / 移动端顶栏公司名与语言入口：仅移动端显示
   （完整样式见 mobile.css 与下面的 @media 块）。
   这条兜底必须放在 @media 之前：同特异性的 display 规则由后写的生效，
   放在 @media 之后会把移动端自己的 display:block 一起盖掉。 */
.m-footbar { display: none; }
.m-brandname, .m-lang { display: none; }

@media (max-width: 900px) {
  /* ============================================================
     移动端顶栏 —— 严格仿原站 goldentree-home.com 移动端 header：
       绿底 rgb(26,107,82) / 高 50px
       左侧公司名白字 16px（flex 收缩 + 省略号）
       右侧地球图标 21×22（点击展开语言列表）+ 两线汉堡
     参考站实测：header[0,0,390,50] bg rgb(26,107,82)；
       .navcontent margin-left 8pt(10.67px)；.navcontent p 16px 白字 overflow:hidden
       .selectlang[292,0,48,50]，地球 iconfont 21×22 落在 [305,14]
       .mm-hbtn[350,10,30,30]，两根 24×2 白线在 y=15 / y=30（中间那根被隐藏）
     ============================================================ */
  /* 顶栏底色恒为绿底 rgb(26,107,82)：原站移动端顶栏不随滚动变色，
     桌面端 .nav.is-scrolled 的深色底只应作用于桌面 —— 这条规则与桌面那条
     同为 (0,2,0) 特异性，靠「写在 @media 块内、位置更靠后」生效。 */
  .nav { height: 50px; background: #1a6b52;
         transition: background-color .3s ease, left .28s cubic-bezier(.22,.61,.36,1); }
  .nav.is-scrolled { background: #1a6b52; }
  .nav-inner { padding: 0; border-bottom: none; justify-content: flex-start; align-items: center; }
  /* 桌面端的品牌 logo 与国旗语言入口在移动端让位给公司名 + 地球。
     注意要写成 .nav .brand：桌面端是 .nav .brand { display:flex }（特异性 0,2,0），
     只写 .brand 会被它压住。 */
  .nav .brand, .nav-lang { display: none; }
  /* .nav-lang 的两个国旗链接在移动端整体让位给地球入口；
     子元素也要显式 display:none —— 父级隐藏不会改写子元素自身的
     display 计算值，会让「最小字号」体检把 2.8px 的遗留字号判成过小文字。 */
  .nav-lang a { display: none; }
  .m-brandname {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    padding-left: 10.67px;           /* 原站 .navcontent margin-left: 8pt */
    color: #fff;
    font-family: 'Noto Sans SC', 'Source Han Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 50px;
    letter-spacing: 0;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .m-brandname:hover { color: #fff; }
  /* 原站英文页移动端顶栏用的是 logo（白底），中文页才是公司名文字。
     我们两版统一用绿底，但内容按原站分版：中文页公司名、英文页 logo。 */
  :lang(zh-CN) .m-brandname { display: block; }
  :lang(en) .m-brandname { display: none; }
  :lang(en) .nav .brand { display: flex; flex: 0 0 auto; }
  /* 语言入口：地球图标按钮（原站 .selectlang 占位 48×50）
     margin-left:auto —— 英文页顶栏左侧是 logo（无 flex:1 的公司名撑开），
     需要靠它把语言入口与汉堡顶到最右，和中文页对齐。 */
  /* margin-right:10px —— 原站地球按钮 .selectlang[292,0,48,50] 与汉堡
     .mm-hbtn[350,10,30,30] 之间留 10px 间隙；抽屉打开、顶栏左移 272px 后，
     地球图标正好落在原站的 [33,14,21,22]。 */
  .m-lang { display: block; flex: 0 0 48px; width: 48px; height: 50px; margin-left: auto; margin-right: 10px; }
  .m-langbtn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 50px;
    padding: 0;
    background: none;
    border: 0;
    cursor: pointer;
  }
  .m-langico {
    width: 21px;
    height: 22px;
    /* -1px：图标在 48px 按钮内居中会落在 x=305.5，四舍五入到 306；
       原站关闭态地球 iconfont 落在 x=305、抽屉打开态落在 x=33，
       这里左移 1px 让「关闭态 305 / 打开态 33」两处都与原站一致。 */
    margin-left: -1px;
    fill: none;
    stroke: #fff;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  /* 语言列表：原站 .langlistbox —— 顶栏下方全宽白底面板 */
  .m-langbox {
    display: none;
    position: fixed;
    top: 50px; left: 0; right: 0;
    z-index: 130;
    background: #fff;
    padding: 15px 34px;
    box-shadow: 0 2px 12px rgba(0,0,0,.18);
  }
  .m-langbox.open { display: block; }
  .m-langrow {
    display: flex;
    align-items: center;
    height: 48px;
    color: #333;
    text-decoration: none;
  }
  .m-langrow:hover { color: #333; }
  .m-langbadge {
    flex: none;
    width: 28px;
    height: 28px;
    margin-right: 10px;
    border: 1px solid #333;
    border-radius: 50%;
    color: #333;
    font-size: 12px;
    line-height: 26px;
    text-align: center;
  }
  .m-langtxt {
    font-family: 'Noto Sans SC', 'Source Han Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 16px;
    line-height: 48px;
    color: #333;
  }
  /* 展开语言列表时压暗下方页面（原站 .langlistboxshadow） */
  body.m-lang-open::before {
    content: "";
    position: fixed;
    inset: 50px 0 0 0;
    background: rgba(0,0,0,.45);
    z-index: 125;
  }
  /* 汉堡：原站只有两根线（.rect.top y=15 / .rect.bottom y=30，中间的被隐藏），
     打开时两线交叉成 X。 */
  .nav-toggle {
    display: block;
    order: 2;
    position: relative;
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    margin: 10px 10px 10px 0;
    padding: 0;
  }
  .nav-toggle span {
    position: absolute;
    left: 3px;
    width: 24px;
    height: 2px;
    margin: 0;
    background: #fff;
    transition: .3s;
  }
  .nav-toggle span:nth-child(1) { top: 5px; }
  .nav-toggle span:nth-child(2) { top: 20px; }
  .nav-toggle.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
  /* opacity:1 必须显式写 —— 桌面端三线汉堡有
     .nav-toggle.open span:nth-child(2) { opacity: 0 }（隐藏中间那根），
     移动端只有两根线，沿用会让 ✕ 只剩一根对角线。
     同理桌面端 .nav-toggle.open span:nth-child(3) 在移动端不存在，无需处理。 */
  .nav-toggle.open span:nth-child(2) { transform: translateY(-7.5px) rotate(-45deg); opacity: 1; }
  /* .nav-right 展开为 contents，面板本身 fixed 脱离文档流 */
  .nav-right { display: contents; }
  /* ---------------------------------------------------------------
     抽屉：一比一仿原站 nav.micro-nav-item
       原站实测（390px 视口、抽屉打开态）：
         抽屉 rect [118, 0, 272, 844]、底色 rgb(0,0,22)、z-index 9999
         菜单首个 li 即在 y=0（抽屉无顶部内边距）
         每个 li 高 66px，文字 15px / line-height 22.5px，垂直居中
         文字墨迹左边界 x=192 → 距抽屉左缘 74px
         当前项 rgb(255,204,0)，其余 rgb(255,255,255)
     --------------------------------------------------------------- */
  .nav-panel {
    display: flex;
    position: fixed;
    top: 0; right: 0;
    width: 272px;
    max-width: 272px;
    height: 100%;
    padding: 0;
    background: #000016;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform .28s cubic-bezier(.22,.61,.36,1), visibility .28s;
    overflow-y: auto;
    z-index: 130;
    visibility: hidden;
  }
  .nav-panel.open { transform: translateX(0); visibility: visible; }
  /* 原站没有黑色遮罩：只有一层 opacity:0 的全屏点击层（.MobileNavClickLayer）
     用于「点页面任意处关闭抽屉」。这里同样只做透明点击层，
     页面内容保持原亮度，不再被压暗 55%。 */
  body.nav-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 110;
  }
  /* 原站抽屉打开时，顶栏与底栏整体左移一个抽屉宽度（272px）：
       顶栏 rect [-272,0,390,50] → 只余左侧 118px 绿条，
         汉堡变 ✕ 后落在 x=78~108，与原站 .mm-hbtn[78,10,30,30] 完全一致；
       底栏 rect [-272,794,390,50] → 只余最右侧「联系」一项，与原站一致。
     这里必须用 left/width 而不是 transform：一旦给 .nav 加 transform，
     .nav 就成为 position:fixed 子元素的包含块，藏在 .nav 里的抽屉
     （.nav-panel）会从「相对视口」变成「相对 .nav」定位，
     实测会跑到 x=-154、高度从 844 塌成 50（.nav 的高度）。 */
  body.nav-open .nav {
    left: -272px;
    right: auto;
    width: 100%;
  }
  body.nav-open .m-footbar {
    left: -272px;
    right: auto;
    width: 100%;
  }
  .m-footbar { transition: left .28s cubic-bezier(.22,.61,.36,1); }
  .nav-menu {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    margin-right: 0;
    transform: none;
    width: 100%;
  }
  /* 每个菜单项高 66px、文字垂直居中（原站 li 高度实测 66） */
  .nav-menu li { display: flex; align-items: center; width: 100%; height: 66px; }
  .nav-menu a {
    font-size: 15px;
    line-height: 22.5px;
    letter-spacing: 0;                 /* 原站 4 个汉字墨迹宽 60px = 4×15，无字距 */
    font-weight: 400;
    padding: 0 0 0 74px;               /* 文字墨迹落在 x=192（抽屉左缘 +74） */
    color: #fff;
  }
  .nav-menu a::after { display: none; }  /* 关掉桌面端的下划线 */
  .nav-menu a:hover { color: #fff; }
  /* 当前页高亮：原站当前项为金色 rgb(255,204,0)
     （首页 / 与 Home 都指向 href="/" ，中英文页通用，无需改 build_en.py） */
  .nav-menu a[href="/"] { color: rgb(255,204,0); }
  /* 固定顶栏 50px + 固定底栏 50px：锚点跳转后目标区会被两头夹住，
     给 section 留出让位，否则底栏「产品/联系」跳过去看不到目标顶部。 */
  section[id] { scroll-margin-top: 50px; scroll-margin-bottom: 60px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* 暂时隐藏的区块（「品牌动态」）：内容待客户确认后恢复 */
.sec-off { display: none; }
