/* ============================================================================
   AICraft 国际站 · v4.0 精细化层 · 2026-11-03
   ----------------------------------------------------------------------------
   ⚠️ 落点纪律（逐页实测，不是推测）：
     线上 17 页在 <body> 末尾已叠了三层注入——
       <style id="b1">        令牌（--r-* / --btn-* / --font-sans）
       <style id="gc-design">  v3.3 设计层（20,418 B）
       <style id="hero-band"> 首屏深色带
     ⇒ 本文件必须用 <link> 插在 **</body> 之前**，不能插 </head> 之前、
       也不能追加进 <head> 里链接的 ui.css。否则文档序在 v3.3 之前，
       同特异度一律被 v3.3 的 !important 压掉。
       （见 memory: lesson-css-body-style-insertion-point-20261029）

   ⛔ 本层不推翻 v3.3 已定案的取舍：
      · 圆角 6/8/12/16 —— v3.3 有意收小的，不放大
      · 主按钮无渐变无彩色投影 —— 不把「AI 模板脸」装回去
      · 首屏次级 CTA 降级文字链 —— 方向保留，只补深色带上的可点性
   ⛔ 不碰 --text / --text2 / --text3 / --accent 取值（v3.9/v3.10 对比度结论原样成立）
   ⛔ 不碰 .par 呼吸球（v3.3b 已按 Brian 两次反馈重做，本层不叠）

   本轮实改（都是 v3.3 没覆盖到的）：
     ① 字族 Inter → Geist / Geist Mono（自托管，CSP 无 font-src ⇒ 必须同源）
     ② 章节节奏 70px 均一 → clamp(60,7.5vw,112)
     ③ 导航 0.95 实底 → 玻璃
     ④ 首屏深色带次级 CTA：纯文字 → 中性玻璃药丸
     ⑤ 供应商 Logo 墙 opacity .6×.6=.36 → 只留一层
     ⑥ AI 客服组件重做（💬 字符 → 细线 SVG；手机上原为 display:none）
     ⑦ 滚动入场只碰 opacity（transform 交给 hover）
     ⑧ 代码 / 模型名 / 价格改等宽 + 等宽数字
   ============================================================================ */

@font-face{
  font-family:"Geist";
  src:url("/fonts/Geist.woff2") format("woff2");
  font-weight:100 900;
  font-style:normal;
  font-display:swap;
}
@font-face{
  font-family:"Geist Mono";
  src:url("/fonts/GeistMono.woff2") format("woff2");
  font-weight:100 900;
  font-style:normal;
  font-display:swap;
}

html:root{
  --v4-sans:"Geist","Noto Sans SC",system-ui,-apple-system,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
  --v4-mono:"Geist Mono",ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  --v4-line:rgba(15,23,42,.075);
  --v4-line-d:rgba(255,255,255,.09);
  --v4-ease:cubic-bezier(.32,.72,0,1);
  --v4-out:cubic-bezier(.16,1,.3,1);
  --v4-d2:280ms;
}

/* ---------------------------------------------------------------- 字族 -- */
/* 换字族有两条路，两条都得写：
     ① 直接声明 html body:not(.editorial)（0,1,2）
     ② 改令牌 --font-sans —— b1 的 body{font-family:var(--font-sans)} 靠它
   ⚠️ ② 会连带 .editorial 页一起换（2026-11-03 实测：tools.html 正文
      Inter → Geist）。这是有意的 —— tools.html 的衬线只在它自己的
      --display（Playfair Display）上，正文本来就是 Inter 不是衬线；
      换成 Geist 与全站一致，编辑体标题不受影响。
      ⇒ 下面那个 :not(.editorial) 在这条路上不起作用，保留只为挡住
        将来可能出现的、直接写在 body.editorial 上的 font-family。 */
html body:not(.editorial){
  font-family:var(--v4-sans);
  font-feature-settings:"ss01" 1,"cv01" 1;
}
html:root{--font-sans:var(--v4-sans)}

/* 等宽数字：价格表、额度、模型名、代码。只改字形来源，不改字号与颜色。 */
html body code,
html body pre,
html body kbd,
html body samp,
html body .td-name,
html body .td-ctx,
html body .model-id,
html body .ep-m,
html body .balance-num,
html body .quota-num{
  font-family:var(--v4-mono);
  font-feature-settings:"tnum" 1;
}

/* ------------------------------------------------------------ 章节节奏 -- */
/* v3.3 只定字号，没定留白；.sec 仍是 ui.css 的 70px 均一。 */
html body .sec{
  padding-top:clamp(60px,7.5vw,112px);
  padding-bottom:clamp(60px,7.5vw,112px);
}

/* -------------------------------------------------------------- 导航玻璃 -- */
html body .nav{
  background:rgba(255,255,255,.78);
  -webkit-backdrop-filter:blur(20px) saturate(180%);
  backdrop-filter:blur(20px) saturate(180%);
  border-bottom:1px solid var(--v4-line);
}
html body.dark .nav{
  background:rgba(15,23,42,.78);
  border-bottom:1px solid var(--v4-line-d);
}

/* ---------------------------------------- 首屏深色带次级 CTA（可点性修复）-- */
/* v3.3 把三个次级按钮降级成纯文字（supabase「单一有色事件」）——方向对，
   但在深色带上三个纯文字并排，跟正文段落没区别，读不出「可点」。
   这里只补一层**中性玻璃**：不加第二个强调色，只把「可点」画出来。
   选择器 (0,4,2) > v3.3 的 .hero.hero-band … (0,4,0)，且都在 !important 上比文档序。 */
html body .hero.hero-band .hero-actions .btn-outline{
  background:rgba(255,255,255,.06)!important;
  border-color:rgba(255,255,255,.18)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.10)!important;
  color:#dbe4f5!important;
  font-weight:500!important;
  padding-left:18px!important;
  padding-right:18px!important;
  -webkit-backdrop-filter:blur(8px);
  backdrop-filter:blur(8px);
}
html body .hero.hero-band .hero-actions .btn-outline:hover{
  background:rgba(255,255,255,.13)!important;
  border-color:rgba(255,255,255,.32)!important;
  color:#fff!important;
}

/* ---------------------------------------------- 供应商 Logo 墙（真实缺陷）-- */
/* .top10-item 与 .top10-logo 各写了一次 opacity:.6 ⇒ 相乘 = .36。
   两层叠同一个属性不是设计，是重复声明 —— 只留外层那一层。 */
html body .top10-logo{opacity:1}
html body .top10-item{opacity:.62}
html body .top10-item:hover{opacity:1}
/* ui.css 另有 body.dark .top10-logo{opacity:.5}（0,2,1）——
   `html body .top10-logo`（0,1,2）压不住它：html/body 加的是**元素**计数，
   挡不住对面多出来的那个 .dark **类**计数。必须显式写 dark 变体。 */
html body.dark .top10-logo{opacity:1}

/* -------------------------------------------------------- AI 客服组件重做 -- */
/* 原状：按钮内容是字面 💬、面板 340px、@media(max-width:768px) 里
   .chat-widget{display:none} ⇒ 手机上整个组件不存在。
   本段不改 HTML，用 mask 把字符换成细线 SVG，并恢复移动端入口。 */

html body .chat-btn-w{
  width:58px;height:58px;font-size:0;line-height:0;border-radius:50%;
  background:linear-gradient(140deg,#6b8af7,#3a5ae8 48%,#1f3aa0);
  border:none;
  box-shadow:0 10px 26px rgba(47,84,235,.4),0 3px 8px rgba(0,0,0,.06),inset 0 1px 0 rgba(255,255,255,.45);
  transition:transform .22s ease,box-shadow .22s ease;
}
/* --------------------------------------- 按钮外观对齐国内站（2026-11-16） -- */
/* 尺寸/渐变/阴影/悬停/脉冲环/图标全部照搬 /opt/aicraft/web/index.html 的 .chat-btn-w。
   只用 ::after，不碰按钮自身 box-shadow（hover 那条在用）。 */
html body .chat-btn-w{position:relative}
html body .chat-btn-w::after{
  content:"";position:absolute;inset:-7px;border-radius:50%;pointer-events:none;
  border:2px solid rgba(209,156,31,.5);
  animation:chatPulse 2.6s cubic-bezier(.2,.6,.3,1) infinite;
}
@keyframes chatPulse{
  0%{transform:scale(.84);opacity:.85}
  70%{transform:scale(1.24);opacity:0}
  100%{opacity:0}
}

html body .chat-btn-w:hover{
  transform:translateY(-3px) scale(1.06);
  box-shadow:0 14px 34px rgba(47,84,235,.5),0 5px 12px rgba(0,0,0,.08),inset 0 1px 0 rgba(255,255,255,.45);
}
html body .chat-btn-w:active{transform:scale(.94)}
html body .chat-btn-w::before{
  content:"";display:block;width:26px;height:26px;margin:0 auto;background:#fff;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E") center/contain no-repeat;
}

html body .chat-panel-w{
  bottom:74px;right:0;width:378px;max-height:540px;
  background:#fff;
  border:1px solid var(--border,#e8e9ee);
  border-radius:var(--r-xl,16px);
  box-shadow:var(--sh-3,0 24px 56px rgba(11,12,15,.10));
  overflow:hidden;
}
html body .chat-panel-w.open-w{
  animation:v4-chat-in .34s var(--v4-out) both;
}
@keyframes v4-chat-in{
  from{opacity:0;transform:translateY(10px) scale(.97)}
  to{opacity:1;transform:none}
}

html body .chat-header-w{
  display:flex;align-items:center;gap:9px;
  padding:14px 18px;font-size:13px;font-weight:600;letter-spacing:-.005em;
  background:var(--accent);
  color:#fff;border-bottom:1px solid rgba(255,255,255,.12);
}
html body .chat-header-w::before{
  content:"";flex:none;width:7px;height:7px;border-radius:50%;
  background:#34d399;box-shadow:0 0 0 3px rgba(52,211,153,.22);
}

html body .chat-msgs-w{padding:16px;gap:10px;background:transparent}
html body .msg-bot,
html body .msg-user{
  padding:10px 14px;font-size:12.5px;line-height:1.6;
  border-radius:var(--r-lg,12px);
  max-width:88%;
}
html body .msg-bot{
  background:rgba(15,23,42,.045);
  border:1px solid var(--v4-line);
  border-bottom-left-radius:4px;
}
html body .msg-user{
  background:var(--accent);
  color:#fff;
  border-bottom-right-radius:4px;
}

html body .chat-input-w{
  padding:12px;gap:8px;
  border-top:1px solid var(--v4-line);
  background:#fff;
}
html body .chat-input-w input{
  height:40px;padding:0 16px;font-size:12.5px;
  background:rgba(15,23,42,.035);
  border:1px solid transparent;
  border-radius:999px;
  transition:border-color var(--v4-d2) var(--v4-ease),background-color var(--v4-d2) var(--v4-ease);
}
html body .chat-input-w input:focus{
  border-color:rgba(47,84,235,.45);
  background:#fff;
  box-shadow:0 0 0 4px rgba(47,84,235,.10);
}
html body .chat-input-w button{
  width:40px;height:40px;font-size:0;line-height:0;border-radius:999px;
  background:var(--accent);
  box-shadow:var(--sh-brand,0 8px 24px -10px rgba(47,84,235,.30));
  transition:transform var(--v4-d2) var(--v4-ease),background-color var(--v4-d2) var(--v4-ease);
}
html body .chat-input-w button:hover{background:#3a57e8}
html body .chat-input-w button:active{transform:scale(.94)}
html body .chat-input-w button::before{
  content:"";display:block;width:17px;height:17px;margin:0 auto;background:#fff;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3.4 20.4l17.3-7.4c.9-.4.9-1.6 0-2L3.4 3.6c-.8-.3-1.6.3-1.4 1.1L4 11.1l9 .9-9 .9-2 6.4c-.2.8.6 1.4 1.4 1.1z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3.4 20.4l17.3-7.4c.9-.4.9-1.6 0-2L3.4 3.6c-.8-.3-1.6.3-1.4 1.1L4 11.1l9 .9-9 .9-2 6.4c-.2.8.6 1.4 1.4 1.1z'/%3E%3C/svg%3E") center/contain no-repeat;
}
html body .chat-powered{
  font-size:9.5px;letter-spacing:.06em;text-transform:uppercase;
  padding:8px;background:transparent;color:var(--text3,#6b7280);
  border-top:1px solid var(--v4-line);
}

/* 深色：ui.css 有四条 body.dark 规则（(0,2,1)），与本层的 html body（0,2,1）
   同特异度且本层在后 —— 不显式覆盖回来就会把深色面板刷成白底。 */
html body.dark .chat-panel-w{background:#1e293b;border-color:#334155}
html body.dark .chat-msgs-w{background:transparent}
html body.dark .msg-bot{background:rgba(255,255,255,.055);border-color:var(--v4-line-d);color:#e2e8f0}
html body.dark .chat-input-w{background:#1e293b;border-color:#334155}
html body.dark .chat-input-w input{background:rgba(255,255,255,.05);color:#f1f5f9}
html body.dark .chat-input-w input:focus{background:rgba(255,255,255,.08);border-color:rgba(126,162,255,.55)}
html body.dark .chat-powered{background:transparent;border-color:var(--v4-line-d)}

/* ------------------------------------------------ 移动端：恢复客服入口 -- */
@media (max-width:768px){
  html body .chat-widget{display:block;bottom:16px;right:16px}
  html body .chat-panel-w{
    width:calc(100vw - 32px);max-width:400px;max-height:70vh;
    right:0;bottom:74px;
  }
  html body .sec{
    padding-top:clamp(48px,9vw,64px);
    padding-bottom:clamp(48px,9vw,64px);
  }
  html body .hero.hero-band .hero-actions .btn-outline{
    padding-left:14px!important;padding-right:14px!important;
  }
}

/* ------------------------------------------------------------ 滚动入场 -- */
/* ⛔ 只碰 opacity。transform 若带 fill:both，入场结束后会把 hover 的
   translateY 永久压死（动画填充态优先于普通声明）。标题没有 hover 位移，
   所以位移只给标题；卡片只淡入。 */
@media (prefers-reduced-motion: no-preference){
  @supports (animation-timeline: view()){
    @keyframes v4-fade{from{opacity:0}to{opacity:1}}
    @keyframes v4-rise{from{opacity:0;transform:translateY(18px)}to{opacity:1;transform:none}}

    html body .sec-title,
    html body .sec-sub{
      animation:v4-rise linear both;
      animation-timeline:view();
      animation-range:entry 0% entry 60%;
    }
    html body .sec-title{animation-range:entry 0% entry 75%}

    html body .card,
    html body .faq-item{
      animation:v4-fade linear both;
      animation-timeline:view();
      animation-range:entry 0% entry 50%;
    }
  }
}

@media (prefers-reduced-motion: reduce){
  html body .sec-title,
  html body .sec-sub,
  html body .card,
  html body .faq-item,
  html body .chat-panel-w.open-w,
  html body .chat-btn-w::after{animation:none!important}
}
