/* 几何工场智能体平台 · 控制台样式
   视觉参考：蓝色顶栏 + 白色侧栏 + 面包屑 + 筛选条 + 表格（后台管理风格）
   仅调整外观，内容、路由与交互不变。 */
/* ── 设计 token：对齐《友机技术 Web 端组件规范》──────────────────────────────
   来源：技能 ujoin-web-component-spec（references/color-system.md、typography.md、
   layout-spacing.md、components.md、charts.md）。
   规则：色值一律取规范原值，不另造色；字号只用规范的 11/12/14/16/18/20/24 层级。

   已登记的例外（规范确实没定义，不是漏改）：
   1) 业务色（换刀 #CB71E3 / 过载 #6A76DF）的浅底色：规范只给了「默认标签」底，
      所以 --violet-bg 复用 --bg-page，而不是自造一层浅紫；
   2) 深色阴影用规范阴影色 rgba(38,42,56,·) 的微缩版（开关滑块 1px 之类），
      规范只给了 4 档卡片/浮层阴影；
   3) 顶栏上的状态药丸（rgba(255,255,255,.16) 底）是深蓝底上的浮层样式，
      规范框架色里没有对应 token。 */
:root {
  /* 主色（规范 --primary #3A8CFF；顶栏取框架专属色 --header-bg） */
  --blue: #0F52BC;          /* 顶栏主蓝 = --header-bg */
  --blue-dark: #0A4499;     /* 顶栏底部分割 = --header-border */
  --action: #3A8CFF;        /* 链接 / 主按钮 = --primary */
  --action-dark: #2070E6;   /* 主按钮 hover = --main-600 */
  --soft: #E0EBFF;          /* 选中底色 = --sidebar-active-icon-bg */

  /* 文本（规范 info 灰阶） */
  --ink: #262A38;           /* --text-primary */
  --text: #262A38;
  --sub: #5C6170;           /* --info-600 次要文字 */
  --mute: #7A7F8C;          /* --info-500 辅助说明 */
  --navy: #262A38;          /* 兼容页面内联 var(--navy) */

  /* 面与线（规范 border / bg 系列） */
  --line: #D9DDE6;          /* --border-base */
  --hair: #E8EBF0;          /* --border-light */
  --head: #F5F7FA;          /* --info-50 */
  --hover: #EDF5FF;         /* --bg-hover */
  --bg: #F5F7FA;            /* --bg-page 页面背景 */
  --card: #FFFFFF;          /* --bg-card */

  /* 状态色（规范功能色 + 业务色） */
  --green: #3DCF36;         /* --success-500 运行 / 正常 */
  --green-bg: #F0FDF0;      /* --success-50 */
  --amber: #FF9D3A;         /* --warning-500 预警 / 待处理 */
  --amber-bg: #FFF8F0;      /* --warning-50 */
  --red: #F04040;           /* --error-500 故障 / 超差 */
  --red-bg: #FEEFEF;        /* --error-50 */
  --violet: #6A76DF;        /* --overload 过载 */
  --violet-bg: var(--bg);
  --cyan: #36CFC9;          /* --cyan-500 待机 / 空闲 */
  --cyan-bg: #F0FCFC;       /* --cyan-50 */
  --tool-change: #CB71E3;   /* 换刀（业务特定色） */
  --disabled: #B0B4BF;      /* --info-300 离线 / 停机 / 禁用 */
  --green-hover: #65E05F;   /* --success-400 成功按钮 hover */
  --green-soft: #8CEA87;    /* --success-300 进度渐变起点 */
  --error-line: #FDD8D8;    /* --error-100 错误框描边 */
  --action-soft: #B3D4FF;   /* --main-200 选中气泡描边 */

  --radius: 4px;            /* 按钮 / 输入框圆角（规范） */
  --radius-card: 8px;       /* 卡片 / 弹窗圆角（规范） */
  --bar-h: 56px;            /* 顶栏高度（规范 56px） */
  --side-w: 202px;          /* 侧栏宽度（规范 202px） */
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Alibaba PuHuiTi 2.0", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
/* ── 顶部蓝栏 ───────────────────────────────────────────────────────────── */
.appbar {
  height: var(--bar-h);
  background: var(--blue);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 16px;   /* 规范 顶栏内边距 0 16px */
  position: sticky;
  top: 0;
  z-index: 50;
}
.brand { display: flex; align-items: center; gap: 8px;   /* 规范 Logo 与文字间距 8px */ min-width: 0; }
.brand-mark { display: block; width: 34px; height: 34px;   /* 规范 Logo 34px */ border-radius: 8px; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.brand-text b { font-size: 16px; font-weight: 600; letter-spacing: .01em; white-space: nowrap; }
.brand-text em {
  font-style: normal;
  font-size: 12px;   /* 规范 小字 12px */
  color: rgba(255, 255, 255, .66);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: .02em;
}
.appbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.appbar .badge {
  font-size: 12px;
  color: #FFFFFF;
  background: rgba(255, 255, 255, .16);
  border: none;
  border-radius: 999px;
  padding: 3px 12px;
  white-space: nowrap;
}
/* ── 主体骨架 ───────────────────────────────────────────────────────────── */
.shell { display: flex; min-height: calc(100vh - var(--bar-h)); align-items: stretch; }
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.sidebar {
  width: var(--side-w);
  flex-shrink: 0;
  /* 侧边栏背景：白色（内容区为 --bg 浅灰，形成层次） */
  background: var(--card);
  border-right: 1px solid var(--hair);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: var(--bar-h);
  height: calc(100vh - var(--bar-h));
  overflow-y: auto;
}
#nav { flex: 1; padding: 8px 0 12px; }
/* 可折叠的分组：父级行 + 缩进子项 */
.nav-group + .nav-group { margin-top: 2px; }
/* 一级行（分组标题 / 一级叶子菜单）通用排布：图标 + 文字 + 右侧箭头 */
.nav-group .grp,
#nav a.top {
  width: 100%;
  height: 42px;   /* 规范 一级菜单 42px */
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px 0 18px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
#nav a.top:hover { background: var(--hover); color: var(--ink); }
#nav a.top.active { background: var(--soft); color: var(--blue); font-weight: 500; }
.ni { flex: 0 0 auto; width: 18px; height: 18px; opacity: .82; }
#nav a.top.active .ni, .nav-group .grp:hover .ni { opacity: 1; }
.nav-group .grp .chev { margin-left: auto; }
.nav-group .grp:hover { background: var(--hover); color: var(--ink); }
.nav-group .chev {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  margin-top: -3px;
  border-right: 1.5px solid var(--mute);
  border-bottom: 1.5px solid var(--mute);
  transform: rotate(45deg);
  transition: transform .15s ease;
}
.nav-group.collapsed .chev { transform: rotate(-45deg); margin-top: 0; }
.nav-group .items { overflow: hidden; }
.nav-group.collapsed .items { display: none; }
#nav .items a {
  display: flex;
  align-items: center;
  height: 32px;   /* 规范 二级子项 32px */
  padding: 0 16px 0 46px;
  color: var(--sub);
  text-decoration: none;
  font-size: 14px;   /* 规范 辅助文字 14px */
  cursor: pointer;
}
#nav .items a:hover { background: var(--hover); color: var(--ink); }
#nav .items a.active { background: var(--soft); color: var(--blue); font-weight: 500; }
/* ── 面包屑栏 ───────────────────────────────────────────────────────────── */
.crumbbar {
  height: 36px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--hair);
  background: var(--bg);
}
.crumb { color: var(--sub); font-size: 14px; }
.crumb b { color: var(--ink); font-weight: 400; }
#view { padding: 16px 20px 28px; width: 100%; }
/* 页面级操作条：新增 / 注册 / 创建入口统一放这里 */
.page-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0 10px;
}
.page-actions .hint { max-width: 900px; }

/* ── 报价单：顶部四步流程 + 左下阶段详情 + 右下对话 ─────────────────────── */
/* 轻提示（toast）：底部居中浮层，不打断操作 */
.toast-box {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  z-index: 999; pointer-events: none;
}
.toast-item {
  padding: 8px 14px; border-radius: 999px;
  background: var(--ink); color: #FFFFFF;
  font-size: 13px; line-height: 1.4;
  box-shadow: 0 4px 16px rgba(38, 42, 56, 0.12);
  transition: opacity .22s ease, transform .22s ease;
}
.toast-item.out { opacity: 0; transform: translateY(6px); }

/* ── 报价页对话区：样式参考原生对话窗口（左头像+气泡 / 右蓝气泡 / 底部圆角输入条）── */
.quote-avatar {
  width: 24px; height: 24px; flex: 0 0 auto; border-radius: 999px;
  background: var(--action); color: #FFFFFF;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 500;
}
.quote-chat-log {
  flex: 1 1 auto; min-height: 320px; max-height: 460px; overflow-y: auto;
  padding: 16px; background: var(--bg);
}
.quote-msg { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 14px; }
.quote-msg.user { justify-content: flex-end; }
.quote-bubble {
  max-width: 86%; padding: 8px 12px;
  border: 1px solid var(--hair); border-radius: 8px;
  background: var(--card); color: var(--text); font-size: 14px; line-height: 1.6;
}
.quote-msg.user .quote-bubble { background: var(--action); border-color: var(--action); color: #FFFFFF; }
.quote-bubble > * + * { margin-top: 8px; }
/* 调用期间的 loading 气泡（平台自己给的提示，不冒充应用输出） */
.quote-loading { display: inline-flex; align-items: center; gap: 8px; color: var(--sub); }
.quote-bubble pre { margin: 0; padding: 10px 12px; overflow: auto; background: var(--head); border: 1px solid var(--hair);
  border-radius: 6px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.7; }
.quote-bubble table { width: 100%; border-collapse: collapse; font-size: 12px; }
.quote-composer {
  display: flex; align-items: flex-end; gap: 8px;
  margin: 0 12px 12px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--card);
}
.quote-composer:focus-within { border-color: var(--action); }
.quote-composer textarea {
  /* 高度随输入内容自适应（app.js 的 autoGrowTextarea 撑高）；到 max-height 就内部滚动，
     min-height 是不输入时的一行高度，别把这两条删了 —— 删了就退回「一行固定 + 内部滚动」 */
  flex: 1 1 auto; min-height: 24px; max-height: 132px; padding: 4px 0;
  border: none; outline: none; resize: none; overflow-y: auto; background: transparent;
  font-family: inherit; font-size: 14px; line-height: 1.5; color: var(--text);
}
.quote-send {
  width: 32px; height: 32px; flex: 0 0 auto; cursor: pointer;
  border: none; border-radius: 999px; background: var(--action); color: #FFFFFF;
  display: inline-flex; align-items: center; justify-content: center;
}
.quote-send:hover { background: var(--action-dark); }
.quote-send.loading { opacity: .6; cursor: progress; }
/* 通用对话框：左侧的「上传图纸」按钮（与发送键同一行，样式轻一档） */
.quote-attach {
  width: 32px; height: 32px; flex: 0 0 auto; cursor: pointer;
  border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
}
.quote-attach:hover { border-color: var(--action); color: var(--action); }
.quote-attach:disabled { opacity: .5; cursor: not-allowed; }
/* 回执卡片：应用改了什么（平台解析 [[GEOWORKS_CHANGE]] 得到） */
.chat-change {
  margin-top: 10px; padding: 10px 12px;
  border: 1px solid var(--hair); border-left: 3px solid var(--action);
  border-radius: 6px; background: var(--head);
}
.chat-change-head { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.chat-change .m-table-wrap { margin: 0; }
.chat-warn { margin-top: 8px; font-size: 12px; color: var(--warn, #C0392B); }
.quote-tools { display: flex; align-items: center; gap: 8px; margin: 0 12px 8px; flex-wrap: wrap; }
.quote-tool {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 14px; cursor: pointer; font-family: inherit; font-size: 13px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--card); color: var(--ink);
}
.quote-tool:hover { border-color: var(--action); color: var(--action); background: var(--hover); }
.quote-tool svg { flex: 0 0 auto; }
.quote-attach-chip {
  display: flex; align-items: center; gap: 8px;
  margin: 0 12px 8px; font-size: 12px; color: var(--sub);
}
/* ── 第②步：四项费用卡片 + 加工费展开明细 ───────────────────────────── */
.cost-items { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 12px; }
@media (max-width: 1100px) {.cost-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }}
.cost-item {
  padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--card);
}
.cost-item span { display: block; font-size: 12px; color: var(--sub); }
.cost-item b { display: block; margin-top: 4px; font-size: 18px; color: var(--ink); font-variant-numeric: tabular-nums; }
/* 合计：只做展示。底色与描边都走中性灰，强调只落在金额的字重与字号上——
   主色描边 + 浅蓝底会和「选中态」撞脸（.cost-item.active），看着像被点过。 */
.cost-item.total { background: var(--head); border-color: var(--line); }
.cost-item { cursor: pointer; text-align: left; font-family: inherit; }
.cost-item:hover { border-color: var(--action); background: var(--hover); }
.cost-item.active { border-color: var(--action); box-shadow: 0 0 0 2px rgba(58, 140, 255, .18); }
.cost-detail { margin-top: 12px; padding-top: 8px; border-top: 1px dashed var(--hair); }
.cost-edit { display: flex; align-items: center; gap: 8px; margin: 8px 0 8px; flex-wrap: wrap; }
.cost-edit label { font-size: 12px; color: var(--sub); }
.margin-params { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px 16px; margin: 12px 0 8px; }
.margin-param { display: flex; flex-direction: column; gap: 4px; }
.margin-param span { font-size: 12px; color: var(--sub); }
.margin-param .quote-in { width: 100%; }
.quote-sheet-actions { display: flex; align-items: center; gap: 8px; }
.quote-topbar {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  background: var(--card); border: 1px solid var(--hair); border-radius: var(--radius-card);
  padding: 8px 12px; margin-bottom: 12px;
}
.review-list { display: flex; flex-direction: column; gap: 8px; }
.review-item {
  display: grid; grid-template-columns: auto auto 1fr; gap: 4px 16px; align-items: baseline; text-align: left;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--card);
  padding: 8px 12px; font-family: inherit; font-size: 12px; color: var(--ink); cursor: pointer;
}
.review-item:hover { border-color: var(--action); background: var(--hover); }
.review-item b { font-weight: 600; font-variant-numeric: tabular-nums; }
.review-item span { color: var(--sub); }
.review-item em { grid-column: 1 / -1; font-style: normal; color: var(--mute); }
.quote-history { position: relative; display: inline-block; }
.quote-history-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 320px;
  background: var(--card, #fff); border: 1px solid var(--hair); border-radius: 10px;
  box-shadow: 0 12px 28px rgba(15, 35, 70, .14); padding: 6px; display: flex; flex-direction: column; gap: 4px;
}
.quote-history-menu[hidden] { display: none; }
.quote-step.locked { opacity: .45; cursor: not-allowed; }
.quote-step.locked:hover { border-color: var(--hair); }
.margin-params.strong-labels .margin-param span { font-size: 13px; font-weight: 600; color: var(--ink); }
.quote-part-tabs { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.part-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.part-chip {
  display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border: 1px solid var(--line);
  border-radius: var(--radius); font-size: 12px; color: var(--ink); text-decoration: none; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.part-chip:hover { border-color: var(--action); background: var(--hover); text-decoration: none; }
.part-chip.active { border-color: var(--action); background: var(--soft); font-weight: 600; }
.quote-upload-row { display: flex; align-items: center; gap: 12px; margin: 8px 0 0; flex-wrap: wrap; }
.identify-status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--action); }
.identify-status[hidden] { display: none; }
.identify-status.loading::before {
  content: ''; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--soft); border-top-color: var(--action);
  animation: m-spin .8s linear infinite;
}
.quote-history-item {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: baseline; text-align: left;
  border: 1px solid transparent; border-radius: 8px; background: transparent; padding: 8px 10px;
  font-family: inherit; font-size: 13px; color: var(--ink); cursor: pointer;
}
.quote-history-item:hover { background: var(--hover); border-color: var(--hair); }
.quote-history-item.active { border-color: var(--action); box-shadow: 0 0 0 2px rgba(58, 140, 255, .16); }
.quote-history-item b { font-variant-numeric: tabular-nums; }
.quote-history-item span { grid-column: 1 / 2; font-size: 12px; color: var(--sub); }
.quote-history-item em { grid-column: 2 / 3; grid-row: 1 / 2; font-style: normal; font-size: 12px; color: var(--sub); }
.modal-mask {
  position: fixed; inset: 0; z-index: 60; background: rgba(16, 32, 60, .35);
  display: flex; align-items: center; justify-content: center;
}
.modal-card {
  width: min(460px, calc(100vw - 40px)); background: #fff; border-radius: var(--radius-card); padding: 24px;
  box-shadow: 0 4px 16px rgba(38, 42, 56, .12); display: flex; flex-direction: column; gap: 12px;
}
.modal-card h4 { margin: 0 0 8px; }
.modal-card.wide { width: min(1040px, calc(100vw - 40px)); }
.modal-body { max-height: 62vh; overflow: auto; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 16px; margin: 12px 0 8px; }
.info-item { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.info-item span { font-size: 12px; color: var(--sub); }
.info-item b { font-size: 14px; font-weight: 600; color: var(--ink); word-break: break-all; }
a.link { color: var(--action); cursor: pointer; text-decoration: none; }
a.link:hover { text-decoration: underline; }

.cost-detail .hint b { color: var(--action); }
.cost-item.total b { color: var(--ink); font-size: 20px; }
.cost-ops summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink); }
.quote-raw { margin-top: 10px; }
.quote-raw summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink); }
.quote-raw[open] summary { margin-bottom: 8px; }
.quote-raw .m-md { font-size: 13px; }
.cost-ops[open] summary { margin-bottom: 8px; }
.cost-notes { margin: 0; padding-left: 18px; font-size: 12px; color: var(--sub); }
.cost-notes li { margin: 3px 0; }

/* 工序表格的行内编辑输入框（窄、紧凑，不撑破表格） */
.quote-in {
  height: 24px;
  padding: 0 8px;
  font-size: 12px;
  font-family: inherit;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.quote-in:hover:not(:disabled) { border-color: var(--action); }
.quote-in:focus { outline: none; border-color: var(--action); box-shadow: 0 0 0 2px rgba(58, 140, 255, .16); }
.quote-in:disabled { background: var(--bg); color: var(--sub); }

.quote-flow { padding: 16px; }
.quote-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0 8px;
}
.quote-step {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 96px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--card);
  cursor: pointer;
}
.quote-step:hover { border-color: var(--action); background: var(--hover); }
.quote-step.active { border-color: var(--action); background: var(--soft); }
.quote-idx {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--action);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 500;
}
.quote-step b { font-size: 14px; font-weight: 600; color: var(--ink); }
.quote-step em { font-style: normal; font-size: 12px; color: var(--sub); }
.quote-step .pill { align-self: flex-start; }
@media (max-width: 1000px) {.quote-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }}

/* 智能体回复里的 ```echarts 图表（由 web/echarts-lite.js 渲染成内联 SVG） */
.md-chart {
  margin: 8px 0;
  padding: 8px 10px;
  border: 1px solid var(--hair);
  border-radius: var(--radius-card);
  background: var(--card);
}
.md-chart[data-rendered='1'] pre { display: none; }
.md-chart pre { margin: 0; }
.md-chart-svg { display: block; }
.section-title {
  font-size: 14px;
  color: var(--ink);
  font-weight: 600;
  margin: 18px 0 10px;
  padding-left: 9px;
  border-left: 3px solid var(--action);
  line-height: 1.2;
}
/* ── 容器 ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: var(--radius-card);
  padding: 16px;
  margin: 12px 0;
}
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1400px) {.g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }}
@media (max-width: 760px) {.g2, .g5 { grid-template-columns: minmax(0, 1fr); }}
.stat {
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: var(--radius-card);
  padding: 14px 16px;
}
.stat b { font-size: 24px; color: var(--ink); display: block; line-height: 1.35; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--sub); }
.stat em { font-style: normal; font-size: 12px; color: var(--green); }
/* ── 表格 ───────────────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--card); }
th {
  background: var(--head);
  color: var(--text);
  text-align: left;
  padding: 12px 16px;
  font-weight: 600;
  white-space: nowrap;
  border: none;
  border-bottom: 1px solid var(--hair);
}
td {
  padding: 12px 16px;
  border: none;
  border-bottom: 1px solid var(--hair);
  vertical-align: middle;
  color: var(--text);
}
tbody tr:hover { background: var(--hover); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
/* ── 标签 / 徽标 ────────────────────────────────────────────────────────── */
.pill {
  display: inline-block;
  padding: 4px 8px;
  border-radius: var(--radius);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  line-height: 16px;   /* 规范 标签默认高 24px（4+16+4） */
}
.pill.g { background: var(--green-bg); color: var(--green); }
.pill.a { background: var(--amber-bg); color: var(--amber); }
.pill.b { background: var(--soft); color: var(--action); }
.pill.v { background: var(--violet-bg); color: var(--violet); }
.pill.r { background: var(--red-bg); color: var(--red); }
.pill.gray { background: var(--bg); color: var(--sub); }
.tag {
  display: inline-block;
  background: var(--bg);
  color: var(--sub);
  border-radius: var(--radius);
  font-size: 12px;
  padding: 3px 8px;   /* 规范 标签高 24px */
  margin-right: 6px;
}
/* ── 按钮 ───────────────────────────────────────────────────────────────── */
.btn {
  height: 32px;
  border: 1px solid var(--line);
  background: #FFFFFF;
  color: var(--text);
  border-radius: var(--radius);
  padding: 0 16px;   /* 规范 按钮内边距 8px 16px */
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.btn { text-decoration: none; }
.btn:hover { border-color: var(--action); color: var(--action); text-decoration: none; }
.btn.primary { background: var(--action); border-color: var(--action); color: #FFFFFF; font-weight: 500; }
.btn.primary:hover { background: var(--action-dark); border-color: var(--action-dark); color: #FFFFFF; }
.btn.green { background: var(--green); border-color: var(--green); color: #FFFFFF; }
.btn.green:hover { background: var(--green-hover); border-color: var(--green-hover); color: #FFFFFF; }
/* 停用 / 巡检类操作：按《友机技术 Web 端组件规范》用警告色（--warning-500，hover --warning-400） */
.btn.warn { background: var(--amber); border-color: var(--amber); color: #FFFFFF; }
.btn.warn:hover { background: #FFB666; border-color: #FFB666; color: #FFFFFF; }
.btn.sm { height: 24px; padding: 0 12px; font-size: 12px; }
.btn:disabled { background: #F0F2F5; border-color: var(--line); color: var(--disabled); opacity: 1; cursor: not-allowed; }
.btn.primary:disabled { background: #8CBDFF; border-color: #8CBDFF; color: #FFFFFF; }
.btn.primary:disabled { pointer-events: none; }
/* ── 表单控件 ───────────────────────────────────────────────────────────── */
input, select, textarea {
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  height: 32px;
  padding: 0 10px;
  outline: none;
}
input[type="checkbox"] { height: auto; padding: 0; vertical-align: -1px; margin-right: 4px; }
textarea { height: auto; padding: 8px 10px; line-height: 1.6; }
input:focus, select:focus, textarea:focus { border-color: var(--action); box-shadow: 0 0 0 2px rgba(22, 119, 210, .12); }
input::placeholder { color: var(--mute); }
/* ── 能力卡 ─────────────────────────────────────────────────────────────── */
.cap-card {
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: 6px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
/* 按钮内的小箭头：展开时朝上 */
.btn .chev {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 6px;
  margin-top: 3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform .15s ease;
}
.btn .chev.open { margin-top: -2px; transform: rotate(-135deg); }
.cap-card h4 { font-size: 14px; color: var(--ink); font-weight: 600; display: flex; align-items: center; gap: 6px; }
/* 卡片右上角：标题 + 启用开关 */
.cap-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.cap-card-head h4 { flex: 1 1 auto; min-width: 0; flex-wrap: wrap; row-gap: 4px; }
.cap-card-head .switch { flex: 0 0 auto; margin-top: 1px; }
.cap-card .desc { font-size: 14px; color: var(--sub); min-height: 38px; }
.cap-card .meta { font-size: 12px; color: var(--sub); display: flex; gap: 12px; flex-wrap: wrap; }
/* safe center：内容比容器宽时从左侧对齐，避免两端被裁掉 */
#canvas { display: flex; align-items: center; justify-content: safe center; min-height: 400px; padding: 6px 0; }
/* ── 时间轴 / 事件流 / 进度条 ───────────────────────────────────────────── */
.tl { list-style: none; }
.tl li { position: relative; padding: 0 0 14px 24px; border-left: 2px solid var(--hair); margin-left: 6px; }
.tl li:before {
  content: "";
  position: absolute; left: -7px; top: 4px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--disabled); border: 2px solid #FFFFFF;
}
.tl li.done:before { background: var(--green); }
.tl li.running:before { background: var(--action); }
.tl li.waiting:before { background: var(--amber); }
.tl .tl-t { font-size: 12px; color: var(--sub); }
.tl b { font-size: 14px; color: var(--ink); }
.tl p { font-size: 12px; color: var(--sub); }
/* 事件流：payload 里是设备 ID / 长 JSON（无空格），必须允许任意位置折行，
   否则整行 min-content 会非常大，把外层布局挤变形。 */
.feed { max-height: 320px; overflow-y: auto; font-size: 12px; }
.feed div { padding: 7px 0; border-bottom: 1px solid var(--hair); display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.feed div > span:last-child { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; word-break: break-word; }
.feed .t { flex: 0 0 auto; color: var(--sub); font-size: 12px; min-width: 64px; font-variant-numeric: tabular-nums; }
.feed .mono { flex: 0 0 auto; max-width: 44%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 宽表格在卡片内横向滚动，而不是把栅格撑开 */
.card:has(> table) { overflow-x: auto; }

/* ── 弹框（统一规范）────────────────────────────────────────────────────────
   一个弹框 = 头部（图标 + 标题 + 副标题 + 关闭）+ 正文（m- 前缀的信息块）+ 底部动作条。
   正文只有五种块：m-stats（指标）/ m-rows（字段对照）/ m-sec（小节）/ m-table（表格）/
   m-doc·m-md（正文与输出）。所有弹框都用这五种拼，不再各写各的样式。 */
.modal-root[hidden] { display: none; }
.modal-mask {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(16, 24, 40, .42);
  -webkit-backdrop-filter: blur(1.5px); backdrop-filter: blur(1.5px);
}
.modal {
  position: fixed; top: 6vh; left: 50%; transform: translateX(-50%); z-index: 91;
  width: min(720px, calc(100vw - 32px)); max-height: 88vh;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius-card);
  box-shadow: 0 16px 40px rgba(16, 24, 40, .18);
}
.modal.sm { width: min(520px, calc(100vw - 32px)); }
.modal.lg { width: min(980px, calc(100vw - 32px)); }
/* 头部 */
.modal-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 18px 14px; border-bottom: 1px solid var(--hair);
}
.modal-ic {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px;
  background: var(--soft); color: var(--blue);
  display: flex; align-items: center; justify-content: center;
}
.modal-ic .ni { width: 18px; height: 18px; opacity: 1; }   /* 规范 图标 18px */
.modal-tt { flex: 1 1 auto; min-width: 0; }
.modal-tt b { display: block; font-size: 16px; font-weight: 600; color: var(--ink); line-height: 1.5; }
.modal-tt span { display: block; margin-top: 2px; font-size: 12px; color: var(--sub); }
.modal-x {
  flex: 0 0 auto; width: 28px; height: 28px; border: none; background: none; border-radius: 6px;
  color: var(--sub); font-size: 18px; line-height: 1; cursor: pointer;
}
.modal-x:hover { background: var(--hover); color: var(--ink); }
/* 正文：统一节奏（块与块之间 14px，不再靠内联 margin 拼） */
.modal-body { padding: 16px 18px 18px; overflow-y: auto; font-size: 14px; color: var(--text); }
.modal-body > * + * { margin-top: 14px; }
.modal-body .field-grid + .field { margin-top: 14px; }
/* 底部动作条 */
.modal-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 12px 18px; border-top: 1px solid var(--hair); background: var(--bg);
}
/* 底部件里第一个按钮靠左：跳转类按钮（如「打开编排页面」）放左边，主操作仍在右边 */
.modal-foot > :first-child:not(:last-child) { margin-right: auto; }
/* m-stats：关键指标条（比页面上的 .stat 卡片轻，弹框里不再叠页面卡片） */
.m-stats {
  display: flex; flex-wrap: wrap;
  border: 1px solid var(--hair); border-radius: 6px; background: var(--bg); overflow: hidden;
}
.m-stats > div { flex: 1 1 0; min-width: 92px; padding: 9px 12px; border-left: 1px solid var(--hair); }
.m-stats > div:first-child { border-left: none; }
.m-stats b {
  display: block; font-size: 16px; font-weight: 600; color: var(--ink);
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.m-stats span { display: block; font-size: 12px; color: var(--sub); }
/* m-rows：字段 / 值对照 */
.m-rows { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 7px 12px; font-size: 14px; }
.m-rows .m-k { color: var(--sub); }
.m-rows .m-v { min-width: 0; overflow-wrap: anywhere; }
/* m-sec：小节标题（带一条主色短竖线） */
.m-sec { display: flex; align-items: baseline; gap: 8px; font-size: 14px; font-weight: 600; color: var(--ink); }
.m-sec::before { content: ""; width: 3px; height: 12px; border-radius: 2px; background: var(--action); align-self: center; }
.m-sec .hint { font-weight: 400; }
.m-sec + * { margin-top: 8px; }
/* m-table：弹框内表格（比页面表格紧凑，超高时自身滚动） */
.m-table-wrap { border: 1px solid var(--hair); border-radius: 6px; overflow: auto; max-height: 32vh; }
.m-table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--card); }
.m-table th, .m-table td { padding: 12px 16px; border-bottom: 1px solid var(--hair); text-align: left; vertical-align: middle; }
.m-table th { background: var(--head); color: var(--sub); font-weight: 600; white-space: nowrap; }
.m-table tbody tr:hover td { background: var(--hover); }
.m-table.compact th, .m-table.compact td { padding: 8px 12px; font-size: 12px; }
.m-table td { word-break: break-word; }
.part-cell-desc { color: var(--ink); }
.part-cell-meta { margin-top: 2px; font-size: 12px; color: var(--sub); }
/* 表格行内操作：统一成文字链接样式（查看 / 查看原图纸 / 删除 外观一致） */
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--action); cursor: pointer; }
button.link:hover { text-decoration: underline; }
.row-actions { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
/* 各档价格分段显示 */
.tier-segments { display: flex; flex-direction: column; gap: 4px; }
.tier-seg { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.tier-seg em { font-style: normal; font-size: 12px; color: var(--sub); }
.tier-seg b { font-weight: 600; color: var(--ink); }
.tier-seg + .tier-seg { border-top: 1px dashed var(--hair); padding-top: 4px; }
/* 零件清单：操作列固定在右侧（横向滚动时始终可见） */
/* 操作列固定在右侧；背景按行类型给（表头 / 数据行 / hover / 汇总行），汇总行的样式也要盖住操作列 */
.qp-table th:last-child, .qp-table td:last-child { position: sticky; right: 0; z-index: 1; }
.qp-table thead th:last-child { background: var(--head); }
.qp-table tbody td:last-child { background: var(--card); }
.qp-table tbody tr:hover td:last-child { background: var(--hover); }
.qp-table tfoot td:last-child { background: var(--head); }
.qp-table td:last-child { min-width: 96px; }
.qp-table tfoot td { background: var(--head); font-weight: 600; color: var(--ink); }
/* 审核记录里的报价基础信息 */
.review-nos { grid-column: 1 / -1; font-weight: 500; color: var(--ink); }
.review-totals { grid-column: 1 / -1; }

.m-table tr:last-child td { border-bottom: none; }
.m-table td .nowrap { white-space: nowrap; }
/* m-doc：原文输出（报错原文 / 门禁产出）；m-md：Markdown 正文（智能体回复） */
.m-doc {
  margin: 0; padding: 12px 14px; overflow-x: auto;
  background: var(--head); border: 1px solid var(--hair); border-radius: 6px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px; line-height: 1.75; color: var(--text);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.m-md {
  padding: 12px 14px; overflow-x: auto;
  background: var(--card); border: 1px solid var(--hair); border-radius: 6px;
  font-size: 14px; line-height: 1.75; color: var(--text);
}
.m-md > * + * { margin-top: 10px; }
.m-md .md-h { font-size: 14px; font-weight: 600; color: var(--ink); }
.m-md .md-h1 { font-size: 16px; font-weight: 600; color: var(--ink); }
.m-md ul { margin: 0; padding-left: 20px; }
.m-md li { margin: 3px 0; }
.m-md code {
  padding: 0 4px; background: var(--head); border: 1px solid var(--hair); border-radius: 3px;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px;
}
.m-md pre {
  margin: 0; padding: 10px 12px; overflow: auto;
  background: var(--head); border: 1px solid var(--hair); border-radius: 6px;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.7;
}
.m-md table { width: 100%; border-collapse: collapse; font-size: 12px; }
.m-md th, .m-md td { padding: 6px 9px; border: 1px solid var(--hair); text-align: left; vertical-align: top; }
.m-md th { background: var(--head); font-weight: 500; color: var(--sub); }
.m-md .warn { color: var(--red); }
/* m-error / m-loading：错误与等待 */
.m-error {
  display: flex; gap: 8px; padding: 10px 12px;
  border: 1px solid var(--error-line); border-radius: 6px; background: var(--red-bg); color: var(--red); font-size: 12px;
}
.m-error[hidden] { display: none; }
.m-error b { flex: 0 0 auto; }
.m-loading { display: flex; align-items: center; gap: 10px; padding: 14px 2px; color: var(--sub); font-size: 14px; }
.m-spin {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid var(--soft); border-top-color: var(--action);
  animation: m-spin .8s linear infinite;
}
@keyframes m-spin {to { transform: rotate(360deg); }}
.btn.loading { pointer-events: none; opacity: .72; }
/* 弹框内表单 */
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.field-grid .wide { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-label { font-size: 12px; color: var(--sub); }
.field-label .req { color: var(--red); font-style: normal; margin-left: 3px; }
.field input, .field select, .field textarea { width: 100%; }
.field-hint { font-size: 12px; color: var(--mute); }
.field .switch { margin-top: 4px; }
@media (max-width: 760px) {.field-grid { grid-template-columns: minmax(0, 1fr); }.modal, .modal.sm, .modal.lg { width: calc(100vw - 20px); top: 3vh; max-height: 94vh; }.m-rows { grid-template-columns: 80px minmax(0, 1fr); }}
.field input[type="checkbox"] { width: auto; height: auto; }
/* ── 模型卡片：探测结果行 + 启用开关 ────────────────────────────────────── */
.cap-card.off { opacity: .72; background: var(--bg); }
.cap-card.off h4 { color: var(--sub); }
/* 模型卡片：探测结果单独一行显示 */
.probe-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.switch { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  width: 36px;   /* 规范 小号开关 36×18 */
  height: 18px;
  border-radius: 999px;
  background: var(--disabled);
  transition: background .15s ease;
  position: relative;
  flex: 0 0 auto;
}
.switch-dot {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 2px rgba(38, 42, 56, .16);
  transition: transform .15s ease;
}
.switch input:checked + .switch-track { background: var(--action); }
.switch input:checked + .switch-track .switch-dot { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 2px rgba(58, 140, 255, .25); }
/* 主流程一览：横向进度线（已完成 → 当前 → 待开始） */
.flowline-card { padding: 18px 20px 14px; }
.flowline { position: relative; }
.flowline-track {
  position: absolute;
  /* 圆点放在 18px 高的槽内垂直居中 → 圆心在 9px 处，连线中心与之对齐 */
  top: 8px;
  height: 2px;
  background: var(--hair);
  border-radius: 2px;
}
.flowline-track-done { background: linear-gradient(90deg, var(--green-soft), var(--green)); }
.flowline-steps { display: grid; list-style: none; margin: 0; padding: 0; position: relative; }
.flowline-step { display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; padding: 0 6px; }
.flowline-step .dot-slot { height: 18px; display: flex; align-items: center; flex: 0 0 auto; }
.flowline-step i { display: block; width: 12px; height: 12px; border-radius: 50%; background: #FFFFFF; border: 2px solid var(--line); box-sizing: border-box; }
/* 步骤名最多两行 → 固定两行高度，保证各列的「在办 / 责任角色」横向对齐 */
.flowline-step b { display: block; min-height: 34px; font-size: 12px; font-weight: 500; line-height: 1.35; color: var(--text); }
.flowline-step em { display: block; min-height: 16px; font-style: normal; font-size: 11px; color: var(--mute); }
.flowline-step .step-owner { color: var(--disabled); }
.flowline-step.done i { background: var(--green); border-color: var(--green); }
.flowline-step.active i { width: 18px; height: 18px; background: var(--action); border: 3px solid #FFFFFF; box-shadow: 0 0 0 3px rgba(58, 140, 255, .18); }
.flowline-step.active b { color: var(--action); font-weight: 600; }
.flowline-step.active em { color: var(--action); }
.flowline-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: flex-end;
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed var(--hair);
  font-size: 12px;
  color: var(--sub);
}
.flowline-foot b { color: var(--ink); font-weight: 600; }
.flowline-pct { color: var(--action); font-weight: 600; }
.stage-list { list-style: none; margin: 0; padding: 0; }
.stage { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--hair); }
.stage:last-child { border-bottom: none; padding-bottom: 0; }
.stage-idx {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--blue);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stage-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.stage-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stage-head b { font-size: 16px; color: var(--ink); }
.stage-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--sub); }
.stage-meta .tag { margin-right: 4px; }
/* minmax(0,…) 很关键：否则右列里长 JSON / 设备 ID 的 min-content 会把栅格撑爆，
   左列被挤成一字一行（历史 bug）。 */
.split { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.split > * { min-width: 0; }
@media (max-width: 1000px) {.split { grid-template-columns: minmax(0, 1fr); }}
.hint { font-size: 12px; color: var(--sub); }
@media (max-width: 900px) {:root { --side-w: 156px; }.nav-group .grp { padding-left: 14px; font-size: 14px; }#nav .items a { padding-left: 28px; font-size: 14px; }.brand-text em { display: none; }}
/* 探测时间（结果徽标前） */
.probe-time { font-size: 12px; color: var(--mute); font-variant-numeric: tabular-nums; }
/* ── 页签（接口管理：系统接口 / MCP 服务端） ─────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--hair); margin: 0 0 14px; }
.tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; margin-bottom: -1px;
  background: none; border: none; border-bottom: 2px solid transparent;
  font-family: inherit; font-size: 14px; color: var(--sub); cursor: pointer;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--action); border-bottom-color: var(--action); font-weight: 600; }
.tab .pill { font-size: 11px; }   /* 规范 微字 11px */
/* 顶栏状态徽标：未就绪时用告警色 */
.appbar .badge.warn { background: rgba(240, 64, 64, .28); }
/* 工序卡片里的「执行 / 详情 / 对话 / 改绑定」动作行 */
.stage-body .page-actions { gap: 6px; }
.stage-body .page-actions .btn { height: 26px; }
/* 智能体卡片：探活结论整行展示，避免长文案挤压栅格 */
.cap-card .probe-line .hint { flex: 1 1 auto; min-width: 0; }
/* 对话页：输入行与消息区 */
#chat-log div span:last-child { line-height: 1.7; }
/* 运行结果 / 门禁产出：等宽正文可横向滚动，长表格不撑破弹窗 */
.modal-body pre.mono { background: var(--head); border: 1px solid var(--hair); border-radius: 6px; padding: 10px 12px; }

/* ── 智能体页：对话 ─────────────────────────────────────────────────────── */
.chat-log { display: flex; flex-direction: column; gap: 10px; max-height: 54vh; overflow-y: auto; padding: 2px; }
.chat-row { display: flex; gap: 10px; align-items: flex-start; }
.chat-row .chat-who { flex: 0 0 auto; width: 44px; padding-top: 7px; font-size: 12px; color: var(--sub); }
.chat-bubble { flex: 1 1 auto; min-width: 0; }
/* 气泡复用 Markdown 正文字体规则，但外观另给一套 */
.chat-bubble.m-md {
  padding: 9px 12px; border: 1px solid var(--hair); border-radius: 8px;
  background: var(--bg); font-size: 14px; line-height: 1.7;
  max-height: none; overflow-x: auto;
}
.chat-row.me .chat-bubble.m-md { background: var(--soft); border-color: var(--action-soft); }
.chat-bubble > * + * { margin-top: 8px; }

/* ── 基础数据 · 设备台账：加工能力标签（表格里紧凑展示） ───────────────── */
.equip-caps { display: flex; flex-wrap: wrap; gap: 4px; }
/* 设备台账是页面级长表：不套用弹框的 32vh 内部滚动，否则一屏只看得到几行 */
.m-table-wrap:has(.eq-table) { max-height: none; }
.equip-cap {
  padding: 2px 8px; border-radius: 10px;      /* 规范 圆角 10px 胶囊 */
  background: var(--soft); color: var(--action); font-size: 12px; white-space: nowrap;
}

/* ── 登录页（/login）──────────────────────────────────────────────────────────
   底色取规范的框架深蓝（--header-bg #0F52BC）→ --main-900 #0A2A5C 渐变，
   叠蓝图网格与机加工图纸元素（内联 SVG：法兰端面 / 阶梯轴 / 尺寸标注 / 刀路），
   白卡片浮在最上层。间距走 8 点网格，圆角按规范（按钮 4 / 卡片 8）。 */
.login-body {
  --frame-blue: #0F52BC;      /* --header-bg 品牌深蓝 */
  --frame-deep: #0A2A5C;      /* --main-900 */
  --frame-mid: #1254B8;       /* --main-700 */
  --frame-text: #F4F5F8;      /* 顶栏文字 / 图标 */
  position: relative;
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  font-family: 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(1000px 560px at 10% 6%, rgba(58, 140, 255, .34), transparent 62%),
    linear-gradient(135deg, var(--frame-deep) 0%, var(--frame-blue) 55%, var(--frame-mid) 100%);
}
.login-bg { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.login-bg svg { display: block; width: 100%; height: 100%; }
/* 底部压暗 + 顶部轻压：保证白卡片与深蓝底的对比度 */
.login-bg::after {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(1200px 700px at 50% 118%, rgba(10, 42, 92, .62), transparent 72%),
    linear-gradient(to bottom, rgba(10, 42, 92, .26), transparent 44%);
}
.login-wrap { position: relative; z-index: 1; width: 100%; max-width: 440px; }
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding: 0 4px; }
.login-brand-text { display: flex; flex-direction: column; line-height: 1.35; }
.login-brand-text b { font-size: 18px; font-weight: 600; color: var(--frame-text); }
.login-brand-text em { font-size: 12px; font-style: normal; color: rgba(244, 245, 248, .68); }
/* 回宣传页的入口（登录页品牌区右侧；12px 辅助文字，深蓝底上的浅色） */
.login-back { margin-left: auto; font-size: 12px; color: rgba(244, 245, 248, .72); white-space: nowrap; }
.login-back:hover { color: #FFFFFF; text-decoration: underline; }
.login-card {
  position: relative;
  background: var(--card);
  border: 1px solid rgba(214, 233, 255, .45);
  border-radius: var(--radius-card);
  box-shadow: 0 12px 32px rgba(10, 42, 92, .34);
  padding: 24px;
  overflow: hidden;
}
.login-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 4px; background: var(--action); }
.login-card h1 { margin: 4px 0 20px; font-size: 24px; font-weight: 600; color: var(--ink); }
.login-card .field { margin-bottom: 16px; }
.login-body .field-label { font-size: 14px; }
.login-body .field input,
.login-body .field select { height: 40px; font-size: 15px; padding: 0 12px; }
.login-submit { width: 100%; height: 44px; margin-top: 8px; justify-content: center; font-size: 16px; font-weight: 500; }
.login-sub { margin: -8px 0 16px; font-size: 14px; color: var(--sub); }
.login-error {
  margin: 0 0 12px;
  padding: 8px 10px;
  background: var(--red-bg);
  border: 1px solid var(--error-line);
  border-radius: var(--radius);
  color: var(--red);
  font-size: 13px;
  line-height: 1.6;
}
.login-search {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 8px;
}
.login-tenants {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  background: var(--head);
}
.tenant-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--hair);
  font-size: 14px;
  cursor: pointer;
  background: var(--card);
}
.tenant-item:last-child { border-bottom: 0; }
.tenant-item:hover { background: var(--hover); }
.tenant-item.active { background: var(--soft); }
.tenant-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tenant-id { color: var(--mute); font-size: 13px; }
.tenant-empty { padding: 20px; text-align: center; color: var(--mute); font-size: 13px; }
.login-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 16px; }

/* 顶栏上的「当前租户 · 当前用户」（控制台） */
.user-chip[hidden] { display: none; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 12px;
  margin-left: 4px;
  border-left: 1px solid rgba(255, 255, 255, .22);
  color: #FFFFFF;
  font-size: 12px;
}
.user-chip .user-tenant {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.user-chip .user-tenant::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 6px;
  vertical-align: 1px;
  border-radius: 2px;
  background: rgba(244, 245, 248, .72);
}
.user-chip .user-name { color: rgba(244, 245, 248, .78); }
.user-chip .user-name::before { content: '·'; margin: 0 6px 0 0; color: rgba(244, 245, 248, .5); }
.user-chip button {
  height: 24px;
  padding: 0 10px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, .35);
  background: rgba(255, 255, 255, .12);
  color: #FFFFFF;
  font-size: 12px;
  cursor: pointer;
}
.user-chip button:hover { background: rgba(255, 255, 255, .24); }
@media (max-width: 760px) {
  .login-wrap { max-width: 100%; }
  .user-chip .user-tenant { max-width: 110px; }
}

/* ── 配置向导（报价单智能体页上方；介绍态 → 点「配置」展开两步）────────────────
   规范：本块整体走**警告色**（--amber #FF9D3A）而不是主色蓝——它表达「有件事还没做」，
   和页面里蓝色的常规操作（主按钮 / 链接）区分开；错误仍是 --red，成功仍是 --green。
   卡片圆角 8px、按钮/输入框 4px、间距走 8 点网格（4/8/12/16/24）。
   两步是「一行一步、点开才展开」——默认只有介绍那一条，不去挤报价页自己的内容。 */

/* 向导挂在 #wizard-slot（在报价页内容之上、独立于 #view），所以这里的边距与 #view 对齐 */
#wizard-slot[hidden] { display: none; }
#wizard-slot { padding: 16px 20px 0; }

.wz-card { border-left: 3px solid var(--amber); margin: 0; }
/* 向导里的按钮一律用警告色：主按钮实心橙，次按钮 hover 变橙（不影响页面其它按钮）。
   注意作用域是 .wz-card 而不是 #wizard-slot —— 向导本体在独立页的 #view 里，只有介绍条在槽位里。 */
.wz-card .btn:not(.primary):hover { border-color: var(--amber); color: var(--amber); }
.wz-card .btn.primary { background: var(--amber); border-color: var(--amber); }
.wz-card .btn.primary:hover { background: #FFB666; border-color: #FFB666; color: #FFFFFF; }
/* 介绍态：一行说明 + 「配置」 —— 报价页首默认只有这一段 */
/* 图标 / 文字 / 按钮整行垂直居中（align-items:center）—— 之前是 flex-start，文字会显得偏上 */
.wz-hero { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.wz-hero-ic, .wz-hero-tx, .wz-hero .wz-acts { align-self: center; }
.wz-hero-ic {
  width: 34px; height: 34px; flex: 0 0 auto; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--amber-bg); color: var(--amber);
}
.wz-hero-ic svg { width: 18px; height: 18px; }
.wz-hero-tx { flex: 1; min-width: 260px; display: flex; flex-direction: column; gap: 4px; }
.wz-hero-tx b { font-size: 14px; font-weight: 600; color: var(--ink); }
.wz-hero-tx span { font-size: 12px; color: var(--sub); line-height: 1.7; }
.wz-hero-tx b { font-size: 14px; }
.wz-hero-tx em.wz-no { color: var(--amber); font-style: normal; font-weight: 600; }
.wz-hero-tx kbd {
  font: inherit; font-size: 11px; padding: 0 4px; border-radius: 3px;
  border: 1px solid var(--line); background: var(--bg); color: var(--sub);
}
.wz-hero .wz-meta { color: var(--mute); }
.wz-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wz-head h4 { margin: 0; }
.wz-meta { font-size: 12px; color: var(--mute); }
.wz-acts { margin-left: auto; display: flex; gap: 8px; }
.wz-intro { font-size: 12px; color: var(--sub); margin: 6px 0 10px; line-height: 1.7; }

.wz-list { border-top: 1px solid var(--hair); }
.wz-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--hair); }
.wz-row.clickable { cursor: pointer; }
.wz-row.clickable:hover { background: var(--amber-bg); }
.wz-dot {
  width: 24px; height: 24px; flex: 0 0 auto; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; background: var(--bg); color: var(--sub);
}
.wz-row.on .wz-dot { background: var(--amber); color: #FFFFFF; }
.wz-row.ok .wz-dot { background: var(--green); color: #FFFFFF; }
.wz-main { flex: 1; min-width: 0; }
.wz-main b { font-size: 14px; font-weight: 600; color: var(--ink); }
.wz-main span { display: block; font-size: 12px; color: var(--mute); margin-top: 2px; }
.wz-state { font-size: 12px; color: var(--mute); white-space: nowrap; }
.wz-state.g { color: var(--green); }
.wz-state.a { color: var(--amber); }
.wz-state.r { color: var(--red); }
.wz-caret { width: 14px; flex: 0 0 auto; color: var(--mute); text-align: center; }

.wz-body { padding: 4px 4px 16px 36px; border-bottom: 1px solid var(--hair); }
.wz-drop {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px; border: 1px dashed var(--line); border-radius: var(--radius-card); background: var(--bg);
}
.wz-drop:hover { border-color: var(--amber); background: var(--amber-bg); }
.wz-drop.over { border-color: var(--amber); border-style: solid; background: var(--amber-bg); }
.wz-drop-ic {
  width: 34px; height: 34px; flex: 0 0 auto; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--card); border: 1px solid var(--line); color: var(--amber);
}
.wz-drop-ic svg { width: 18px; height: 18px; }
.wz-drop-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wz-drop-tx b { font-size: 13px; font-weight: 600; color: var(--ink); }
.wz-drop-tx span { font-size: 12px; color: var(--mute); }
.wz-drop kbd {
  font: inherit; font-size: 11px; padding: 0 4px; border-radius: 3px;
  border: 1px solid var(--line); background: var(--card); color: var(--sub);
}
/* 原生 file input 藏起来（只借它的选择器能力），露在外面的按钮与虚线框才是给用户点的 */
.wz-file-input { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.wz-files { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.wz-file {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card);
  font-size: 12px; color: var(--text); max-width: 100%;
}
.wz-file-kind {
  flex: 0 0 auto; padding: 0 6px; border-radius: 3px; font-size: 11px;
  background: var(--amber-bg); color: var(--amber);
}
.wz-file-kind.img { background: var(--green-bg); color: var(--green); }
.wz-file-name { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wz-file-size { color: var(--mute); font-variant-numeric: tabular-nums; }
.wz-file-x {
  border: none; background: transparent; color: var(--mute); cursor: pointer;
  font-size: 14px; line-height: 1; padding: 0 2px;
}
.wz-file-x:hover { color: var(--red); }
.wz-note-in { width: min(560px, 100%); margin-top: 10px; }
.wz-hint { font-size: 12px; color: var(--mute); min-width: 0; }
.wz-sum { margin: 12px 0 6px; font-size: 13px; color: var(--sub); }
.wz-sum b { color: var(--ink); }
.wz-sum .c { color: var(--green); font-weight: 600; }
.wz-sum .u { color: var(--action); font-weight: 600; }
.wz-sum .a { color: var(--amber); font-weight: 600; }
.wz-sum .r { color: var(--red); font-weight: 600; }
.wz-table-wrap { overflow-x: auto; }
.wz-table td { padding: 6px 8px; vertical-align: middle; }
.wz-table th { padding: 8px; white-space: nowrap; font-size: 12px; }
.wz-in {
  width: 100%; min-width: 64px; height: 26px; padding: 0 6px;
  font-size: 13px; color: var(--text);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.wz-in:focus { outline: none; border-color: var(--amber); }
.wz-pick { width: 14px; height: 14px; }
.wz-note { font-size: 12px; color: var(--mute); min-width: 130px; }
.wz-note.r { color: var(--red); }
.wz-note.a { color: var(--amber); }
.wz-act { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* 三步都写完 / 点「完成向导」后：整张卡缩成一行，不再占地方 */
.wz-done { display: flex; align-items: center; gap: 10px; margin: 0; border-left: 3px solid var(--green); }
.wz-done .wz-ok { font-size: 13px; color: var(--ink); }
.wz-done .wz-ok b { color: var(--green); }
.wz-done .wz-acts { margin-left: auto; }

/* 选择租户弹框（登录页）：遮罩 + 卡片；列表项就是按钮，点一下直接登录 */
/* 注意：下面这条必须有——类选择器里的 display 会盖掉浏览器默认的 [hidden]{display:none}，
   少了它弹框会在登录页一打开就浮在最上层（2026-10-12 实际发生）。仓库里 .modal-root[hidden] 同理。 */
.login-modal[hidden] { display: none; }
.login-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.login-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(10, 42, 92, .58);
}
.login-modal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 96px);
  background: var(--card);
  border-radius: var(--radius-card);
  box-shadow: 0 16px 40px rgba(10, 42, 92, .42);
  overflow: hidden;
}
.login-modal-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--hair);
}
.login-modal-head b { font-size: 18px; font-weight: 600; color: var(--ink); flex-shrink: 0; }
.login-modal-head span {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--sub);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.login-modal-x {
  flex-shrink: 0;
  width: 24px; height: 24px;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--mute);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.login-modal-x:hover { background: var(--hover); color: var(--ink); }
.login-modal .btn { height: 36px; font-size: 14px; }
.login-modal-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 16px 20px 4px;
}
.login-modal-body .login-error { margin: 8px 0 0; }
.login-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 20px 16px;
}
.login-modal-hint { font-size: 12px; color: var(--mute); }
.login-modal .login-tenants { flex: 1; min-height: 0; max-height: 320px; }

/* 弹框里的列表项是按钮：占满整行、左对齐、点一下即登录 */
.login-modal .tenant-item {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--hair);
  text-align: left;
  font-family: inherit;
}
.login-modal .tenant-item:last-child { border-bottom: 0; }
.login-modal .tenant-item:disabled { cursor: progress; color: var(--sub); }
.login-modal .tenant-item.busy { background: var(--soft); }
@media (max-width: 760px) {
  .login-modal-body .login-tenants { max-height: 46vh; }
}

/* 报价单列表：表格高度自适应内容。
   原来被全局的 .m-table-wrap { max-height: 32vh } 卡住，20 多张报价单只能看到六七行；
   这里解除上限（与「基础数据 · 设备台账」页同一口径），并给一个最小高度，
   只有一两张单时也不会显得憋屈。其它页面（含弹框里的表格）保持原样。 */
.qp-card { display: flex; flex-direction: column; }
.qp-card .m-table-wrap {
  max-height: none;
  min-height: clamp(320px, 46vh, 620px);   /* 8 点网格：320 / 620 */
}

/* ── 报价流程页（①②③④ 子页 + 报价单页）────────────────────────────────────
   这几页只保留页面本身那一条滚动条：表格跟着页面滚，
   不再被全局 .m-table-wrap { max-height: 32vh } 卡出一条内部滚动条。
   弹框里的表格（.modal-body 里的）保持原样，不放这里。 */
.quote-page .m-table-wrap { max-height: none; }

/* ── 接口平台 · MCP 服务：表格高度自适应 ──────────────────────────────────
   这一页每行都带「工具清单」，行本来就比普通表格高；再套全局的
   .m-table-wrap { max-height: 32vh } 就会在大屏上被切出一条内部滚动条，
   一屏只看得到一行多一点。这里按「报价单列表 / 设备台账」的同一口径处理：
   解除上限让表格跟内容（跟页面）一起长，并给一个最小高度，服务只有一两条时也不憋屈。 */
.mcp-card { display: flex; flex-direction: column; }
.mcp-card .m-table-wrap {
  max-height: none;
  min-height: clamp(360px, 52vh, 760px);   /* 8 点网格：360 / 760 */
}

/* 「计算加工成本」：合计卡片只做展示，不可点（明细只在四个费用项上）。
   hover 也不换主色，否则鼠标扫过又像「可以点」或者「已点中」。 */
.cost-item.static { cursor: default; }
.cost-item.static:hover { border-color: var(--line); background: var(--head); }

/* 「生成报价文件」：点档位行 → 展示该档的报价详情（全部费用） */
.tier-table tbody tr { cursor: pointer; }
.tier-table tbody tr.active td { background: var(--soft); }
.tier-pick { color: var(--action); }
.tier-detail { margin-top: 12px; padding-top: 8px; border-top: 1px dashed var(--hair); }
.tier-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; margin-top: 8px; }
.tier-detail-grid .m-table-wrap { margin: 0; }
@media (max-width: 1100px) { .tier-detail-grid { grid-template-columns: minmax(0, 1fr); } }

/* ── 登录前宣传页（/promo；未登录访问 / 也回这页）────────────────────────────
   报价智能体的产品宣传：展开 5 秒 → 自动折叠成细条 → 进登录页。
   色值全部取上方已登记的设计 token（= 《友机技术 Web 端组件规范》原值）：
   框架深蓝 --blue #0F52BC、主色 --action #3A8CFF、青 --cyan、橙 --amber、
   浅字用框架浅色 rgba(244,245,248,·)（顶栏文字色），圆角 4 / 8，间距 8 点网格。
   宣传页上**没有登录表单**：登录只剩顶栏按钮、细条入口与折叠后的跳转。 */
.promo-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #0A2A5C 0%, var(--blue) 55%, #1254B8 100%);
  color: #F4F5F8;
  font-size: 14px;
  line-height: 1.5;
}
.promo-page .num { font-variant-numeric: tabular-nums; }
.promo-stage { position: relative; min-height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.promo-bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.promo-bg svg { display: block; width: 100%; height: 100%; }
.promo-bg::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(1000px 560px at 8% 2%, rgba(58, 140, 255, .3), transparent 62%),
    radial-gradient(880px 520px at 96% 92%, rgba(54, 207, 201, .16), transparent 60%);
}

/* 顶栏：品牌 + 一个登录入口 */
.promo-bar { position: relative; z-index: 3; height: var(--bar-h); display: flex; align-items: center; gap: 16px; padding: 0 24px; }
.promo-brand { display: flex; align-items: center; gap: 8px; }
.promo-brand img { width: 30px; height: 30px; display: block; }
.promo-brand b { font-size: 16px; font-weight: 600; letter-spacing: .3px; color: #F4F5F8; }
.promo-brand em { font-size: 11px; font-style: normal; letter-spacing: 1.1px; color: rgba(244, 245, 248, .6); }
.promo-bar-sep { flex: 1; }
.promo-login { height: 32px; padding: 0 16px; font-size: 14px; }

/* 宣传区：折叠动画用 grid-template-rows 1fr → 0fr（不写死像素高度） */
.promo { position: relative; z-index: 3; margin: 8px 24px 0; }
.promo-shell { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .52s cubic-bezier(.22, .61, .36, 1); }
.promo-clip { overflow: hidden; min-height: 0; }
.promo-body {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 32px; padding: 24px;
  border: 1px solid rgba(214, 233, 255, .26); border-radius: var(--radius-card);
  background: linear-gradient(120deg, rgba(10, 42, 92, .8), rgba(18, 84, 184, .6));
  backdrop-filter: blur(6px);
  box-shadow: 0 12px 32px rgba(10, 42, 92, .34);
  transition: opacity .34s ease .06s, transform .46s cubic-bezier(.22, .61, .36, 1);
}
.promo-page[data-promo="collapsed"] .promo-shell { grid-template-rows: 0fr; }
.promo-page[data-promo="collapsed"] .promo-body { opacity: 0; transform: translateY(-10px) scale(.985); transition-delay: 0s; }

.promo-kicker {
  display: inline-flex; align-items: center; gap: 8px; height: 24px; padding: 0 10px; border-radius: 9999px;
  background: rgba(54, 207, 201, .14); border: 1px solid rgba(54, 207, 201, .42); color: #AFF0ED;
  font-size: 12px; letter-spacing: .4px;
}
.promo-kicker i { width: 6px; height: 6px; border-radius: 9999px; background: var(--cyan); box-shadow: 0 0 0 3px rgba(54, 207, 201, .22); animation: promoPulse 1.8s infinite; }
.promo-left h1 { margin: 12px 0 8px; font-size: 32px; font-weight: 700; line-height: 1.3; letter-spacing: .5px; color: #FFFFFF; }
.promo-left h1 b { color: #66A8FF; }
.promo-lead { font-size: 16px; color: rgba(244, 245, 248, .84); max-width: 520px; }
.promo-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 4px; }
.promo-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: var(--radius);
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(214, 233, 255, .22); color: #D6E9FF; font-size: 12px;
}
.promo-pill svg { width: 14px; height: 14px; flex: none; }

/* 倒计时 → 自动折叠 */
.promo-timer { display: flex; align-items: center; gap: 10px; margin-top: 28px; }
.promo-timer-track { position: relative; width: 168px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .18); overflow: hidden; }
.promo-timer-fill { position: absolute; inset: 0 auto 0 0; width: 100%; background: linear-gradient(90deg, var(--cyan), var(--action)); animation: promoDrain 5s linear forwards; }
.promo.paused .promo-timer-fill { animation-play-state: paused; }
.promo-timer span { font-size: 12px; color: rgba(244, 245, 248, .62); }
.promo-timer-btn {
  height: 24px; padding: 0 8px; border-radius: var(--radius); border: 1px solid rgba(214, 233, 255, .3);
  background: rgba(255, 255, 255, .06); color: #D6E9FF; font-size: 12px; font-family: inherit; cursor: pointer;
}
.promo-timer-btn:hover { background: rgba(255, 255, 255, .14); color: #FFFFFF; }

/* 右侧：AI 识别动画（零件线框 + 扫描线 + 特征点亮 + 工序芯片 + 数字） */
.promo-ai { border-left: 1px solid rgba(214, 233, 255, .18); padding-left: 32px; }
.promo-ai h2 { font-size: 12px; font-weight: 500; letter-spacing: 1.4px; color: rgba(214, 233, 255, .66); margin: 0 0 12px; }
.promo-cad svg { display: block; width: 100%; height: auto; overflow: visible; }
.promo-cad text { font-size: 11px; }
.promo-scan { animation: promoScan 3.2s cubic-bezier(.45, 0, .55, 1) infinite; }
.promo-feat { opacity: 0; animation: promoPop .42s ease-out forwards; }
.promo-feat.f1 { animation-delay: .55s; } .promo-feat.f2 { animation-delay: 1.15s; }
.promo-feat.f3 { animation-delay: 1.75s; } .promo-feat.f4 { animation-delay: 2.35s; }
.promo-path { stroke-dasharray: 300; stroke-dashoffset: 300; animation: promoDraw 4.6s ease-in-out .8s infinite; }
.promo-ops { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.promo-op {
  display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: var(--radius);
  font-size: 12px; color: rgba(244, 245, 248, .8); background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(214, 233, 255, .18); opacity: 0; animation: promoPop .4s ease-out forwards;
}
.promo-op:nth-child(1) { animation-delay: 1.2s; } .promo-op:nth-child(2) { animation-delay: 1.6s; }
.promo-op:nth-child(3) { animation-delay: 2s; } .promo-op:nth-child(4) { animation-delay: 2.4s; }
.promo-op:nth-child(5) { animation-delay: 2.8s; } .promo-op:nth-child(6) { animation-delay: 3.2s; }
.promo-op.more { color: var(--cyan); border-color: rgba(54, 207, 201, .4); background: rgba(54, 207, 201, .1); }
.promo-quote { display: flex; align-items: flex-end; gap: 20px; margin-top: 20px; padding-top: 16px; border-top: 1px dashed rgba(214, 233, 255, .24); }
.promo-quote div { min-width: 0; }
.promo-quote b { display: block; font-size: 24px; font-weight: 700; line-height: 1.25; color: #FFFFFF; }
.promo-quote b.cyan { color: var(--cyan); }
.promo-quote span { font-size: 11px; color: rgba(244, 245, 248, .58); }

/* 折叠后的细条：没有「展开」，只有登录入口 */
.promo-strip {
  display: flex; align-items: center; gap: 12px; height: 0; padding: 0 16px; overflow: hidden; opacity: 0; transform: translateY(6px);
  border: 1px solid rgba(214, 233, 255, 0); border-radius: var(--radius-card);
  background: rgba(10, 42, 92, .5); backdrop-filter: blur(6px);
  transition: height .42s cubic-bezier(.22, .61, .36, 1) .1s, opacity .3s ease .18s, transform .42s ease .1s, border-color .3s;
}
.promo-page[data-promo="collapsed"] .promo-strip { height: 48px; opacity: 1; transform: none; border-color: rgba(214, 233, 255, .24); }
.promo-strip-mark { display: flex; align-items: center; gap: 8px; flex: none; font-size: 12px; letter-spacing: .4px; color: var(--cyan); }
.promo-strip-mark svg { width: 16px; height: 16px; }
.promo-strip em { font-style: normal; font-size: 14px; font-weight: 500; color: rgba(244, 245, 248, .92); }
.promo-strip-fine { font-size: 12px; color: rgba(244, 245, 248, .55); }
.promo-strip .btn { height: 28px; padding: 0 12px; font-size: 12px; flex: none; }

/* 折叠后露出的主体（用户取消自动跳转时的停留态）：三步 + 登录入口，无表单 */
.promo-main { position: relative; z-index: 3; flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 24px; text-align: center; transition: padding .52s cubic-bezier(.22, .61, .36, 1); }
.promo-page[data-promo="collapsed"] .promo-main { padding-top: 24px; }
.promo-main-in { display: flex; flex-direction: column; align-items: center; gap: 32px; }
.promo-main h2 { font-size: 20px; font-weight: 600; color: #FFFFFF; margin: 0; }
.promo-main h2 span { color: #66A8FF; }
.promo-chain { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; }
.promo-chain-n {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--radius);
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(214, 233, 255, .2); font-size: 14px; color: rgba(244, 245, 248, .9);
}
.promo-chain-n i { font-style: normal; font-size: 12px; color: var(--cyan); }
.promo-chain-a { color: rgba(214, 233, 255, .45); font-size: 14px; }
.promo-facts { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; font-size: 12px; color: rgba(244, 245, 248, .6); }
.promo-facts b { color: #FFFFFF; font-weight: 600; }
.promo-enter { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.promo-enter-btn { height: 44px; padding: 0 28px; font-size: 16px; box-shadow: 0 6px 18px rgba(58, 140, 255, .38); }
.promo-enter-fine { font-size: 12px; color: rgba(244, 245, 248, .58); }

.promo-foot { position: relative; z-index: 3; padding: 16px 24px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 12px; color: rgba(244, 245, 248, .5); border-top: 1px solid rgba(214, 233, 255, .12); }

@keyframes promoPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes promoDrain { to { width: 0; } }
@keyframes promoPop { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes promoDraw { 0% { stroke-dashoffset: 300; } 55%, 100% { stroke-dashoffset: 0; } }
@keyframes promoScan { 0% { transform: translateY(0); opacity: 0; } 12% { opacity: 1; } 88% { opacity: 1; } 100% { transform: translateY(190px); opacity: 0; } }
@keyframes promoDrift { to { stroke-dashoffset: -240; } }
.promo-drift { animation: promoDrift 12s linear infinite; }

@media (max-width: 1024px) {
  .promo-body { grid-template-columns: 1fr; gap: 24px; }
  .promo-ai { border-left: 0; border-top: 1px solid rgba(214, 233, 255, .18); padding-left: 0; padding-top: 24px; }
  .promo-left h1 { font-size: 26px; }
}
@media (max-width: 640px) {
  .promo-bar { padding: 0 16px; }
  .promo-brand em { display: none; }
  .promo { margin: 8px 16px 0; }
  .promo-body { padding: 16px; }
  .promo-left h1 { font-size: 22px; }
  .promo-lead { font-size: 14px; }
  .promo-quote b { font-size: 20px; }
  .promo-cad text { font-size: 10px; }
  .promo-strip { gap: 8px; padding: 0 12px; }
  .promo-strip em { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .promo-strip-fine { display: none; }
  .promo-main { padding: 32px 16px; }
  .promo-main-in { gap: 24px; }
  .promo-chain-n { height: 36px; padding: 0 12px; font-size: 12px; }
  .promo-chain-a { display: none; }   /* 换行后箭头会掉在行尾，窄屏靠 ①② 表顺序 */
  .promo-foot { padding: 16px; }
}
/* 系统要求「减弱动效」时：不播扫描/绘制动画，但 5 秒折叠与跳转照常 */
@media (prefers-reduced-motion: reduce) {
  .promo-shell, .promo-body, .promo-strip, .promo-main { transition-duration: .01s; }
  .promo-scan, .promo-path, .promo-drift, .promo-kicker i { animation: none; }
  .promo-feat, .promo-op { animation: none; opacity: 1; }
}
