/* layout.css —— 骨架，照旧演示站进去以后那一页（D284）：星空铺底；左边 30% 是 Lucy（官网首页那团粒子，原来女孩的位置）；
 * 右上是电脑画面；右下整片是对话，画面展开时上半截淡掉；
 * 顶栏浮在最上面，左边菜单和字标、右边 Refresh 和 Computers（电脑墙的开关）；左下角是谁、点开账号菜单。 */

.icon-defs { display: none; }
.ic {
  flex-shrink: 0;
  width: var(--ic);
  height: var(--ic);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ic.lg { width: var(--ic-lg); height: var(--ic-lg); stroke-width: 2; }

.stars, .field { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; pointer-events: none; }
.workspace { position: fixed; inset: 0; z-index: 1; }

/* ── 顶栏 ─────────────────────────────────────────────────────────── */
.ws-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-7);
  padding: var(--space-7) var(--edge);
}
.ws-top-left, .ws-top-right { display: flex; align-items: center; gap: var(--space-7); min-width: 0; }
.ws-top-right { gap: var(--space-4); }   /* Refresh 跟 Screens 挨近一点（用户 10-16：16 太远，减半） */
/* 字标照第一版（D115）：Chakra Petch 最粗、大小写照写、不加字距、白字；后面这一页的名字用正文字 */
.ws-title { display: flex; align-items: baseline; gap: var(--space-4); white-space: nowrap; }
.brand-name { font-family: var(--font-brand); font-size: var(--fs-brand); font-weight: var(--fw-bold); line-height: var(--lh-tight); color: var(--ink); text-shadow: var(--glow-brand); }   /* 霓虹，同右下 Lucy 开关的字（用户 10-16），光收着、不呼吸 */
.page-name { font-size: var(--fs-ui); color: var(--neon-60); }
/* 刷新：客人卡住时要找得到（用户 10-16），写字的一颗钮；样子是平行四边形 .slant-sm（controls.css，用户 10-18 晚），跟旁边 Computers 一样 */
.link-reload { margin-left: var(--space-3); }
/* 推了新版本（D596，shell.js）：同一颗钮变成 Update，黄字、黄边，边和前面那颗灯一直一明一暗（跟 Computers 收着时同一个节拍），升级了才停；
   放上去整颗亮成实黄。钮前面那句黄字不闪。平时灯藏着 */
.up-lamp { display: none; width: var(--space-3); height: var(--space-3); border-radius: 50%; background: var(--warning); box-shadow: var(--glow-warn); }
.up-say { font-size: var(--fs-note); color: var(--warning); white-space: nowrap; }
.link-reload.update { color: var(--warning); background: var(--warning-35); animation: up-edge var(--beat-chip) ease-in-out infinite; }
.link-reload.update::before { animation: up-fill var(--beat-chip) ease-in-out infinite; }
.link-reload.update .up-lamp { display: block; animation: up-lamp var(--beat-chip) ease-in-out infinite; }
.link-reload.update:hover { color: var(--bg); background: var(--warning); animation: none; }
.link-reload.update:hover::before { background: transparent; animation: none; }
.link-reload.update:hover .up-lamp { background: var(--bg); box-shadow: none; animation: none; }
@keyframes up-edge { 0%, 100% { background: var(--warning-35); } 50% { background: var(--warning-90); } }
@keyframes up-fill { 0%, 100% { background: var(--bg); } 50% { background: linear-gradient(var(--warning-08), var(--warning-08)), var(--bg); } }
@keyframes up-lamp { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }

/* 左边一竖条（shell.js）：鼠标碰到就弹页面菜单。压在 Lucy 那团粒子上、垫在顶栏和左下角下面，那两处照常点 */
.edge-hot { position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--edge) + var(--h-btn)); z-index: 4; }

/* 本月助手用量（D261）：细线进度条，数没接上就明说 */

/* 右上 Computers N：展开、收起电脑墙的钮（平行四边形 .slant-sm，用户 10-18 晚）。收着、且有电脑在跑才呼吸（用户 11-14：没在跑就不许呼吸）：
   原来是外圈辉光一明一暗，平行四边形会把外圈的光切掉，改成边一明一暗、里面跟着淡淡亮一下，数字跟着闪 */
.screens-chip b { font-weight: var(--fw-bold); color: var(--neon); text-shadow: var(--glow-text); }   /* 亮着几台：系统的青（用户 10-16：不用白） */
.screens-chip.collapsed.running { animation: chip-edge var(--beat-chip) ease-in-out infinite; }
.screens-chip.collapsed.running::before { animation: chip-fill var(--beat-chip) ease-in-out infinite; }
.screens-chip.collapsed.running b { animation: chip-num var(--beat-chip) ease-in-out infinite; }
.screens-chip.collapsed:hover, .screens-chip.collapsed:hover::before { animation: none; }   /* 放上去就照 .slant 的亮一档，不跟呼吸抢 */
@keyframes chip-edge { 0%, 100% { background: var(--neon-35); } 50% { background: var(--neon-90); } }
@keyframes chip-fill { 0%, 100% { background: var(--bg); } 50% { background: linear-gradient(var(--neon-08), var(--neon-08)), var(--bg); } }
@keyframes chip-num { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }

/* ── 左边：Lucy（粒子画在 .field 画布上，cosmos.js 量 .lucy 这一块定云的位置大小） ── */
.lucy-col { position: absolute; left: 0; top: var(--top-h); bottom: var(--foot-h); width: var(--lucy-w); z-index: 1; display: flex; }
.lucy { flex: 1; min-width: 0; }

/* ── 左下角：是谁 ─────────────────────────────────────────────────── */
.side-foot { position: absolute; left: var(--space-8); bottom: var(--space-8); z-index: 6; }
.foot-row { display: flex; align-items: stretch; gap: var(--space-4); }
.user-chip {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  max-width: var(--chip-max);
  padding: var(--space-3) var(--space-5) var(--space-3) var(--space-3);
  border: var(--border-w) solid var(--neon-25);
  border-radius: var(--radius-pill);
  background: var(--panel-soft);
  color: var(--ink);
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.user-chip:hover, .user-chip[aria-expanded="true"] { border-color: var(--neon-60); background: var(--neon-08); }
.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: var(--avatar);
  height: var(--avatar);
  border-radius: 50%;
  background: var(--neon);
  box-shadow: var(--glow-text);
  color: var(--on-neon);
  font-size: var(--fs-menu);
  font-weight: var(--fw-bold);
}
.user-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-menu); }
.user-chip .chev { opacity: 0.7; transform: rotate(180deg); transition: transform var(--t-fast); }
.user-chip[aria-expanded="true"] .chev { transform: none; }

/* ── 右上：Computers，一次露一台电脑那一块（D801；照四列两行的墙排，16:9，多大由 view.js 量出来，它占右边两列两行，screens.css .win.shown） ─── */
/* 这一块本身不接鼠标：收着、卡外面，滚轮和点击落到底下的对话、各页上 */
.screens {
  --sc-pad-y: var(--sc-reach);
  --sc-pad-r: var(--gutter);
  --sc-pad-l: var(--sc-reach);
  position: absolute;
  left: var(--lucy-w);
  right: var(--gutter);
  top: var(--top-h);
  /* 卡背后的黑底（下面 .win.shown::before）伸出卡外 --sc-reach，overflow 会把它裁掉：四周留内边距，外框用负外边距往外扩同样宽，
     放卡的内容框位置、大小一点不变（view.js layout 按内容框算）。右边只到屏幕边（--gutter），再扩就出屏 */
  height: calc(var(--screens-h) + 2 * var(--sc-pad-y));
  margin: calc(-1 * var(--sc-pad-y)) calc(-1 * var(--sc-pad-r)) 0 calc(-1 * var(--sc-pad-l));
  padding: var(--sc-pad-y) var(--sc-pad-r) var(--sc-pad-y) var(--sc-pad-l);
  z-index: 4;
  display: grid;
  gap: var(--card-gap);
  justify-content: center;
  align-content: start;   /* 贴顶：跟左边对话那一栏（chat.css .console）顶边齐，放不满的高度留在下面给分屏文档（用户 12-05）；两行按放得下算（view.js layout），不会溢出 */
  overflow: hidden;
  grid-template-rows: repeat(var(--sc-lines), var(--sc-row-h));   /* 一行多高、几行 view.js layout 写（卡 16:9） */
  pointer-events: none;
}
/* 格子一行多高、几行：view.js layout 写在 .workspace 上，这一块和右边分屏文档的位置（下面 .pd-doc.split）都按它；还没算过先当一行、画面区那么高 */
.workspace { --sc-row-h: var(--screens-h); --sc-lines: 1; }
/* 只露一块（view.js 加 .shown），别的不占格子；一下出来、一下没，不淡入（用户 10-16：像普通网页） */
.win { position: relative; min-height: 0; display: none; }
.win.shown { display: block; pointer-events: auto; }
.win-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0;
  border: var(--border-w) solid var(--neon-50);
  border-radius: var(--radius-card);
  background: var(--card-bg);
  box-shadow: var(--glow-card);
  color: inherit;
  overflow: hidden;
  cursor: zoom-in;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* 小卡、浮层淡入（chain-timeline.css、chain-schedule.css 用） */
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* 画面（D436）：selkies 的网页，每张连着的卡一个 iframe。宽高是电脑的屏、缩放和居中由 view.js placeView 按卡算（selkies 不随窗口重排）；
   要到地址才设宽高和 src，之前不露。接管的绿框在 screens.css */
.sc-view { position: absolute; left: 0; top: 0; border: 0; transform-origin: 0 0; background: var(--bg); pointer-events: none; }   /* 墙上点画面就是点卡，全屏旁观时遮罩吃鼠标 */
.sc-view:not([src]) { display: none; }

/* ── 另外几页（Timeline、Workflows、Email、Messages、Materials、Follow Up、Notify，D298、D303）：占对话那块，左边 Lucy 不动；里面各页自己排，自己滚 ── */
.page.view {
  position: absolute;
  left: var(--lucy-w);
  right: var(--gutter);
  top: calc(var(--top-btn-bottom) + var(--view-gap));
  bottom: calc(var(--top-btn-bottom) + var(--view-gap));   /* 上下的空都从屏幕边量、一样长（用户 10-19） */
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-height: 0;
  font-family: var(--font-sans);
  color: var(--chat);
}

/* ── 露着那一块背后的黑底（用户 10-16：别的页上画面浮在页上，背后垫黑底、四边渐隐）：只遮它四周（用户 11-16：只亮一块不该把左边也遮住）。
   卡自己带，跟着 .win 同一帧出、同一帧没（用户 11-16：单独一块黑底自己淡入淡出、慢半拍，笨）。z-index -1 落在 .screens 那一层最底下 ── */
.win.shown::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: var(--radius-card);
  background: var(--sc-backdrop);
  box-shadow: 0 0 var(--sc-backdrop-fade) var(--sc-backdrop-fade) var(--sc-backdrop);
  pointer-events: none;
}
/* 对话页上露着那一块：右边分屏的方案文档（assistant-plan.css）跟它在同一块地方，文档让到它下面，隔一道卡缝（用户 11-29：中间空太大）。
   那一块两行高（上面 .workspace 的 --sc-row-h、--sc-lines），贴着画面区的顶（.screens 的 align-content），文档从它下沿往下铺满。
   左右宽：文档占对话那块（扣掉中缝）的一半，正好是四列里右边两列（assistant-plan.css --pd-doc-w，用户 11-29：屏幕跟文档要对齐） */
@media (min-width: 761px) {
  .workspace.sc-open .pd-doc.split {
    --sc-grid-h: calc(var(--sc-lines) * var(--sc-row-h) + (var(--sc-lines) - 1) * var(--card-gap));
    top: calc(var(--top-h) + var(--sc-grid-h) + var(--card-gap));
  }
}

/* ── 没登录那一屏（一期 .gate，shell.js 的 showGate）：盖在一切上面，星空照常在底下；工作台藏起来，点不着 ── */
:root[data-gate] .workspace { visibility: hidden; }
.gate {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-7);
}
.gate-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-7);
  width: 100%;
  max-width: var(--gate-w);
  padding: var(--space-8);
  border: var(--border-w) solid var(--neon-40);
  border-radius: var(--radius-card);
  background: var(--panel);
  box-shadow: var(--glow-pop);
  text-align: center;
}
.gate-text { font-size: var(--fs-note); line-height: var(--lh-base); color: var(--chat); }
.gate-text.bad { color: var(--danger); }   /* 登失败那一句（shell.js 的 LOGIN_FAILED） */
.gate-card .btn.google { width: 100%; gap: var(--space-5); background: var(--google-bg); border-color: var(--google-border); color: var(--google-text); }
.gate-card .btn.google:hover { background: var(--google-bg); border-color: var(--google-text); }
.gate-code { display: flex; gap: var(--space-5); width: 100%; }   /* 新客人输邀请码那一行（shell.js 的 gate-code） */
.gate-code .input { flex: 1; min-width: 0; height: auto; }   /* 撑满这一行，跟右边的钮一样高 */
.btn.google svg { flex: none; width: var(--google-logo); height: var(--google-logo); }
.btn.google .g-r { fill: var(--google-red); }
.btn.google .g-b { fill: var(--google-blue); }
.btn.google .g-y { fill: var(--google-yellow); }
.btn.google .g-g { fill: var(--google-green); }

/* ── 提示条 ───────────────────────────────────────────────────────── */
/* .up-done：升级好了那张（D596，shell.js），同一个位置、同一个样子，前面一个青勾、两行字；不叫 .toast，免得 showToast 拿它去写别的 */
.toast, .up-done {
  position: fixed;
  left: 50%;
  bottom: calc(var(--chat-pad-b) + var(--h-ctl) + var(--space-8));
  z-index: 90;
  transform: translateX(-50%);
  max-width: calc(100% - var(--space-8) * 2);
  padding: var(--space-4) var(--space-7);
  border: var(--border-w) solid var(--neon-40);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--glow-pop);
  font-size: var(--fs-menu);
  letter-spacing: var(--ls-ui);
  color: var(--ink);
}
.toast.bad { color: var(--danger); border-color: var(--danger); }
.up-done { display: flex; align-items: center; gap: var(--space-6); }
.up-done-ic { color: var(--neon); }
.up-done-text { font-size: var(--fs-note); color: var(--chat); }

/* ── 电脑「2: 名字」（D521，kit/dom.js 的 computerTag）：号改不了，字标字体加字标那圈霓虹、只比名字略大；颜色跟着周围的字走 ── */
.computer-tag-no { font-family: var(--font-brand); font-weight: var(--fw-bold); font-size: var(--fs-computer-no); line-height: 1; text-shadow: var(--glow-brand); }

/* ── 手机：Lucy 收成顶上一小条，画面、对话往下排；是谁挪到右上角 ──── */
@media (max-width: 760px) {
  .workspace { --lucy-w: 0%; --gutter: var(--space-7); --screens-h: 25%; }
  .lucy-col { right: 0; width: auto; bottom: auto; height: 17%; }
  .screens { left: var(--space-7); top: calc(var(--top-h) + 17%); }
  .page.view { left: var(--space-7); top: calc(var(--top-h) + 17%); bottom: var(--space-7); }   /* 同对话页（chat.css）：让开顶上 Lucy 那一条 */
  .ws-top-right { margin-right: calc(var(--avatar) + var(--space-6)); }
  .side-foot { left: auto; right: var(--space-7); bottom: auto; top: var(--space-6); }
  .edge-hot { display: none; }   /* 手机没有悬停，这一条还会压住画面和各页的左边 */
  .ws-top { padding-inline: var(--space-7); }
  .page-name { display: none; }
  .up-say { display: none; }   /* 手机顶栏放不下那句话（D596）：只留闪着的 Update，点了弹框照样说清 */
  .user-chip { padding: var(--space-1); }
  .user-chip .user-name, .user-chip .chev { display: none; }
  .user-menu { top: calc(100% + var(--space-4)); bottom: auto; left: auto; right: 0; min-width: min(var(--user-menu-w), calc(100vw - var(--space-7) * 2)); }
  .menu-sub > .menu.sub { position: static; display: block; border: 0; box-shadow: none; background: transparent; padding: 0 0 0 var(--space-8); }
}
