/* ============================================================================
   screen-home.css —— 工作台（#screen-home）的专属补充规则。

   对照的唯一标准是 UI 预览 ui-v2/index.html 的 `pc-home`（1186-1258 行）与
   `mp-home`（1814-1855 行）。两档共用同一份 DOM（web/index.html 的 #screen-home
   + app.js 的 renderHome / paintModuleWorkbench / paintHomeFeed），切换全部落在这里的媒体查询：

     ≥1024px = pc-home：.top 页头（h2 工作台 + tagline + 两枚 pill）
                          → .wrap 880px 容器 →（.orb 150px + h1.greet 27px + p.sub-txt + 两枚 40px pill）
                          → 渐变 .card（IP 档案：图标 + 标题 + .chip.g + note + 更新问卷/查看档案与诊断）
                          → .sec-t 四大模块 + .grid.g2 的 .mod（.mi/.mn/.md/.mf，余额不足带 .flag）
                          → .sec-t 最近记录 + .card(10px) > .stack 的 .li
     <1024px = mp-home：.top 收成 48px 居中标题栏、.wrap 收成 .ph-pad 的 16px 内边距、
                          问候块收成 .ph-hero 带（.orb 92px + 19px 名字 + 12px 副行 + 两枚 .chip）、
                          模块卡收成整宽的 .ph-card 行（图标 / 名字+说明 / 右箭头）

   只写原型里没有的、这一屏独有的东西；组件（.top/.pill/.card/.mod/.grid.g2/.sec-t/.stack/.li/.chip/
   .note/.orb/.ph-hero/.wrap/.greet/.sub-txt/.home-av…）一律用 proto.css 与线上那套，不改不复制。
   色值一律走 token（var(--ink)/var(--line)/rgb(var(--g))/var(--gt)…），深浅两套都要能看。
   ========================================================================== */

/* ===================== 屏骨架：窗口钉满（与 styles.base.css 的 .screen 同口径） =====================
   本屏是 `.screen`（原型是 `.scr`）：绝对定位铺满 `.screen-stack`，`overflow:hidden` 由栈负责裁。
   原来是 styles.base.css 里的 `.screen{position:absolute;inset:0}`；补这一条是因为排期中间
   proto.css 曾把原型手机外框的 `.screen` 误作用域成 `.uiv2 .screen`（更 specific），
   把**每一屏**都压成相对定位、顺序排进文档流（实测第 2 屏起落在 y=920/1840/…，主区整块看不到）。
   那条后来在 proto.css 里已修正，这里保留同口径的一条：幂等、不依赖别的文件的对错。 */
#screen-home {
  position: absolute;
  inset: 0;
}

/* ===================== 屏骨架：.content 就是原型的 .body =====================
   外壳把每屏的滚动容器做成 `section.screen > .content`（registry.js），原型是 `.scr > .top + .body`。
   所以这里把 .content 摆成同一件事：页头固定一行、.body 自己滚。
   ⚠ 下面这条 `max-width:none` **不够用**：app.responsive.css 里 `body.pc-authed #screen-home .content > *`
   的权重是 (1,2,2)，比这里的 (1,1,1) 高，登录后 920px 那条照样生效 —— 真正解开它的是本文件
   下面「主区对齐预览」那一块（同带 body.pc-authed 前序、多一个 class 的 (1,3,1) 版本）。 */
#screen-home > .content {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0;
  align-items: stretch;
}
#screen-home > .content > .top,
#screen-home > .content > .body {
  width: 100%;
  max-width: none;
}
#screen-home > .content > .body {
  flex: 1;
  min-height: 0;
  overflow: auto;
}
#screen-home .body > .wrap {
  width: 100%;
}

/* ===================== 主区对齐预览：正文居中定宽，不吃满主区（甲方「右侧大面积空缺」） =====================
   症状：PC 档页头与正文都贴在左边，右侧空掉约 1/5 主区（1440 窗口 = 248px）。
   根因：app.responsive.css:233（在 ≥1024px 块里）的
        `body.pc-authed #screen-home .content > *{max-width:920px}`
   把 .top 与 .body 都钳到 920px；.content 又是 align-items:stretch ⇒ 这个 920 的盒子贴在
   主区左侧，右边缘 1192 到主区右边缘 1440 之间就白掉 248px（.wrap 再在 920 里居中，左右各 20px，
   于是看着像「内容全挤在左边」）。
   预览的口径（`ui-v2/index.html` 的 pc-home）：.top/.body 吃满 .main，正文由
   `.wrap{max-width:880px;margin:0 auto}` 居中 —— proto.css:154-155 已经是这条，
   只是被上面那条 920 钳住没生效。所以这里只松开 .top/.body 的宽度，对齐交回 proto.css 的 .wrap。
   手机档不受影响（本块在 ≥1024px 内；手机档 .wrap 走下面 @media(max-width:1023px) 的 .ph-pad 整宽规则）。 */
@media (min-width: 1024px) {
  body.pc-authed #screen-home > .content > .top,
  body.pc-authed #screen-home > .content > .body {
    max-width: none;
  }
}

/* 两档开关：手机档独有的东西在桌面档一律不占位（同一份 DOM，按档位切）。 */
#screen-home .hm-chips { display: none; }
#screen-home [data-home-member][hidden] { display: none; }
#screen-home [data-home-ipcard][hidden] { display: none; }
#screen-home [data-home-workbench][hidden] { display: none; }

/* ===================== 问候块（pc-home 的 .row / mp-home 的 .ph-hero） ===================== */
#screen-home .hm-hero { align-items: center; gap: 24px; }
#screen-home .hm-herocopy { flex: 1; min-width: 0; }
#screen-home .hm-cta { gap: 8px; align-items: center; margin-top: 14px; }
#screen-home .hm-big { height: 40px; padding: 0 20px; }

/* ===================== 能量球（pc-home 的 .orb / mp-home 的 .orb.sm） =====================
   甲方原话：「那个球周围发黑」。实测结论（把三层 canvas / .orb::before 雾光 / .orb::after 兜底
   逐个 display:none 后按环带亮度归因，见 tmp/uicheck/orbab7）：
     1) 画布里的雾体在**整块画布**上都是低透明度深蓝，只靠一条径向 mask 羽化收边。而画布中线
        距中心 75px、那条 radial-gradient 的 100% 落在 farthest-corner = 106px ⇒ 74% 那一档
        在中线处还剩约 0.6 的衰减 ⇒ **画布四条边本身就是一条硬边**，浅色地上就是一块 150px 见方、
        圆角发灰的方底 —— 这就是"黑底/黑圈"。
     2) proto.css:434 本来给浅色档备了更紧的一条 mask（50%/64%/74%），但它写成
        `.uiv2 [data-theme="light"] .orb canvas`：[data-theme] 挂在 <html>、.uiv2 挂在 #app，
        这个前序组合永远配不上 ⇒ **线上这条是死规则**，球一直吃深色档那套（58%/74%/86%），
        方底比原型还大一圈。
     3) .orb::before 那层雾光是品牌蓝 rgba(70,175,255,.5)+blur(11px)：在深底上是发光，
        在浅底上是**压暗**（半径约 125px 的一大圈）—— 这是"发黑"的另一半。
   修法（纯 CSS，`web/js/shaders.js` 一行不碰）：**浅色档**给画布与那层雾光 `mix-blend-mode:screen`
   —— 只加亮、不压暗：深蓝雾体在浅底上变成淡蓝光晕，画布边界自然消失，球的体积感与动效照旧；
   同时把画布 mask 收回原型浅色档那一档（补上面那条死规则）。深色档**一行不动**：screen 在深底上
   本就没意义，也没必要冒险。色值一个都不新增（screen / mask 都不是颜色）。
   ⚠ WebGL 不可用时画布是空白的，screen 对空白是恒等变换，::after 那层兜底球照常显示。 */
[data-theme="light"] #screen-home .orb canvas {
  -webkit-mask-image: radial-gradient(circle at 50% 50%, #000 50%, rgba(0, 0, 0, .45) 64%, transparent 74%);
  mask-image: radial-gradient(circle at 50% 50%, #000 50%, rgba(0, 0, 0, .45) 64%, transparent 74%);
  mix-blend-mode: screen;
}
[data-theme="light"] #screen-home .orb::before {
  mix-blend-mode: screen;
}

/* ===================== IP 档案卡（原型那张渐变 .card） ===================== */
#screen-home .hm-ipcard {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(120deg, rgba(var(--g), .13), rgba(var(--g2), .06));
  border-color: rgba(var(--g), .28);
}
#screen-home .hm-ipcard-body { display: flex; align-items: center; gap: 16px; width: 100%; }
#screen-home .hm-ipic {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: grid; place-items: center;
  color: var(--gt);
  background: rgba(var(--g), .12);
  border: 1px solid rgba(var(--g), .24);
}
#screen-home .hm-ipcopy { flex: 1; min-width: 0; }
#screen-home .hm-ipacts { display: flex; align-items: center; gap: 8px; flex: none; }

/* ===================== 最近记录 ===================== */
/* 抬头右侧的「全部」：原型 pc-home 没有这一枚（它只是演示数据），线上要留入口，所以按 .sec-t 的口径摆右。 */
#screen-home .hm-sect { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#screen-home .hm-sect a { font-size: var(--fs-caption); font-weight: var(--fw-strong); color: var(--gt); text-decoration: none; }
#screen-home .hm-recentcard { padding: 10px; }
/* .li 两侧都可能很长（标题 + 消耗口径），窄档让右侧件自己换到下一行 */
#screen-home .li .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 卡片禁用态（.mod.off 的右标是 .flag「余额不足」） */
#screen-home .mod.off { opacity: .66; }

/* ===================== 手机档（<1024px）＝ mp-home ===================== */
@media (max-width: 1023px) {
  /* .top → .ph-top：48px、只剩一个居中的 h3；搜索/新建对话/算力那几件是 PC 档的事 */
  #screen-home .top {
    height: 48px;
    padding: 0 14px;
    gap: 10px;
    border-bottom: 1px solid var(--line);
    background: var(--main);
  }
  #screen-home .top h2 { flex: 1; text-align: center; }
  #screen-home .top .tagline,
  #screen-home .top .sp,
  #screen-home .top .hm-pconly,
  #screen-home .top button.pill { display: none; }

  /* .wrap → .ph-pad：16px 内边距 + 给底部 tabbar 留出的 100px */
  #screen-home .body > .wrap { max-width: 100%; margin: 0; padding: 16px 16px 100px; }

  /* .ph-hero：整宽的渐变带，随 .wrap 的 16px 内边距外扩 */
  #screen-home .hm-hero {
    margin: 0 -16px 14px;
    padding: 22px 16px 20px;
    gap: 16px;
    background: linear-gradient(150deg, rgba(var(--g), .16), rgba(var(--g2), .08));
    border-bottom: 1px solid var(--line);
  }
  /* 能量球收到 .orb.sm 的 92px（proto.css 那条只在 .sm 上，这里按档位给同一尺寸） */
  #screen-home .hm-orb { width: 92px; height: 92px; margin-left: -4px; }
  #screen-home .greet { font-size: 19px; line-height: 1.3; margin: 0; }
  #screen-home .greet .grd { display: none; }
  #screen-home .sub-txt { font-size: 12px; margin-top: 6px; }
  /* 原型 mp-home 的问候带里没有按钮（四个入口就在下面的模块卡里），PC 那两枚 pill 收起来；
     手机档的算力/会员改成 .chip 一行 */
  #screen-home .hm-cta { display: none; }
  #screen-home .hm-chips { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
  #screen-home .hm-chips b { font-weight: 700; }

  /* IP 档案卡 → mp-home 的 .ph-card 一行：图标 / 名字+说明 / 右箭头，整块可点 */
  #screen-home .hm-ipcard { display: block; padding: 14px; border-radius: 15px; }
  #screen-home .hm-ipcard-body { gap: 12px; }
  #screen-home .hm-ipic { width: 38px; height: 38px; border-radius: 12px; }
  #screen-home .hm-ipcopy .t13 { font-size: var(--fs-body); font-weight: var(--fw-medium); display: block; }
  #screen-home .hm-ipcopy .note { font-size: var(--fs-caption); line-height: 1.5; }
  /* 手机档不画两枚 pill，改为一个右箭头（与 .ph-card 一致）；点整块卡片进档案页 */
  #screen-home .hm-ipacts { display: none; }
  #screen-home .hm-ipcard-body::after {
    content: "";
    width: 9px; height: 9px; flex: none;
    border-right: 1.7px solid var(--dim);
    border-bottom: 1.7px solid var(--dim);
    transform: rotate(-45deg);
  }

  /* 四大模块 / 最近记录：mp-home 用 .label 抬头、模块卡收成整宽的 .ph-card 行
     （图标 / 名字+说明两行 / 右侧件），间距比 PC 紧。.mn 与 .md 在原型的 .ph-card 里是同一列的上下两行，
     所以这里把 .mod 摆成四列网格：38px 图标 | 正文 | .flag | 箭头。 */
  /* 手机档的段落抬头留白比桌面紧一档（22/10），桌面是 --ax-gap-section(22)/10 ——
     数值本来就一致，写成 token 是为了别再各写各的。 */
  #screen-home .sec-t { margin: var(--ax-gap-section) 0 var(--ax-gap-sect-body); }
  #screen-home .grid.g2 { grid-template-columns: 1fr; gap: 9px; }
  #screen-home .mod {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto auto;
    align-items: center;
    column-gap: 12px;
    row-gap: 3px;
    padding: 14px;
    border-radius: 15px;
  }
  #screen-home .mod .mi { grid-column: 1; grid-row: 1 / span 2; width: 38px; height: 38px; border-radius: 12px; }
  #screen-home .mod .mn { grid-column: 2; grid-row: 1; font-size: var(--fs-body); font-weight: var(--fw-medium); }
  #screen-home .mod .md { grid-column: 2; grid-row: 2; font-size: var(--fs-caption); line-height: 1.5; }
  /* .md 在手机档是卡片说明的正文，原型那一行说明就够，多余的那行脚注（.mf）收掉 */
  #screen-home .mod .mf { display: none; }
  #screen-home .mod .flag { grid-column: 3; grid-row: 1 / span 2; position: static; }
  /* 原型 .ph-card 右端的 .ic.cv（箭头）；.mod 自己的 DOM 里没有它，用一个方块补同一件事 */
  #screen-home .mod::after {
    content: "";
    grid-column: 4;
    grid-row: 1 / span 2;
    width: 9px; height: 9px;
    border-right: 1.7px solid var(--dim);
    border-bottom: 1.7px solid var(--dim);
    transform: rotate(-45deg);
    justify-self: end;
  }
}

/* ===================== PC 档（≥1024px）＝ pc-home ===================== */
@media (min-width: 1024px) {
  /* .ph-hero 那一套（负边距 / 渐变带 / 下边框）只在手机档；桌面档回到 .wrap 里的普通一行 */
  #screen-home .hm-hero { margin: 0; padding: 0; background: none; border-bottom: 0; }
  #screen-home .hm-ipcard + * { margin-top: 0; }
}

/* 2026-09-29 排版巡检：IP 档案卡与下面的模块网格之间是 0 间距（两档都是），
   卡的下边框直接压在第一排模块卡的上边框上，读起来像一张卡被切成了两半。
   补上与网格自身行距同一个 token（--ax-gap-card）。上面那条 `+ * {margin-top:0}`
   清的是网格自带的外边距，这里给的是卡自己的下边距，两者不冲突。 */
#screen-home .hm-ipcard:not([hidden]) { margin-bottom: var(--ax-gap-card); }
