/* hidden 属性必须优先于组件自身的 display（登录遮罩/用户条等靠它显隐） */
[hidden] { display: none !important; }

/* 品牌字：钉钉进步体（DingTalk JinBuTi，钉钉官方永久免费商用授权）。
   只子集了 LOGO 用到的「金碳」+ ASCII，整份 4.7KB。
   注意：这份子集不能拿去排正文——缺字会静默回退成系统字体。 */
@font-face {
  font-family: 'DingTalk JinBuTi';
  src: url('/static/fonts/dingtalk-jinbuti.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-brand: 'DingTalk JinBuTi', '钉钉进步体', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --bg: #f7f8fa;
  --bg-soft: #f7f8fa;
  --panel: #ffffff;
  --panel-2: #f2f3f5;
  --border: #e7e8eb;
  --line: #f0f1f4;
  --text: #1f2329;
  --muted: #8f959e;
  --accent: #10b981;
  --accent-2: #059669;
  --warn: #f59e0b;
  --danger: #ef4444;
  --blue: #3b82f6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(31, 35, 41, .04), 0 8px 24px rgba(31, 35, 41, .06);
  --shadow-lg: 0 2px 6px rgba(31, 35, 41, .05), 0 16px 40px rgba(31, 35, 41, .08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #fff;
  color: var(--text);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 14px;
}

.app { display: flex; height: 100vh; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: 224px;              /* 设计规范：左侧导航固定 224px */
  flex: 0 0 224px;
  background: var(--bg);
  border-right: 1px solid var(--line);
  padding: 16px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.brand { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px; }
.brand-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-name {
  font-size: 16.5px; font-weight: 550; color: var(--text);
  letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-family: var(--font-brand);
}
.logo {
  width: 27px; height: 27px; border-radius: 50%;
  object-fit: contain; display: block; background: transparent; flex: 0 0 27px;
}
.brand-actions { display: flex; align-items: center; gap: 4px; }
.brand-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; border: 0; background: transparent;
  color: var(--text); cursor: pointer; transition: .15s;
}
.brand-ico svg { width: 19px; height: 19px; }
.brand-ico:hover { background: var(--panel-2); }

/* margin-bottom:auto 撑开剩余空间，把底部用户中心顶到底（原由「最近」会话区承担） */
.nav { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; margin-top: 14px; margin-bottom: auto; }
/* 分组标题（AGENTS / 工作管理）：只说这一档在管什么，不参与点击 */
.nav-label {
  font-size: 11.5px; color: var(--muted); padding: 12px 10px 4px; letter-spacing: .4px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 9px 10px; border-radius: 8px;
  background: transparent; border: 1px solid transparent; color: var(--text);
  cursor: pointer; font-size: 14px; font-weight: 400; line-height: 1.35;
  letter-spacing: -.2px; -webkit-font-smoothing: antialiased; transition: .15s;
}
.nav-item:hover { background: var(--panel-2); }
.nav-item.active { background: var(--panel-2); font-weight: 400; }
/* 文字：常规字重，选中也不加粗（选中态只用底色 + 图标高亮区分） */
.nav-txt {
  font-size: 14px; font-weight: 400; letter-spacing: -.2px;
  color: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 图标与文字同色（参考图里是一体的深灰），不是灰到 hover 才亮 */
.nav-ico { width: 19px; height: 19px; flex: 0 0 19px; color: inherit; transition: .15s; }
.nav-item:hover .nav-ico { color: inherit; }
.nav-item.active .nav-ico { color: var(--accent); }
/* ---------- 报告正文块（图表 / 指标卡 / 表格 / 计算过程） ----------
   由 static/report_md.js 渲染。iframe(srcdoc) 是独立文档、不继承这里，
   所以同一套规则在 report_md.js 的 css() 里还有一份，改样式要两边同步。 */
.rm-metrics { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.rm-metric { border: 0; border-radius: 10px;
             padding: 10px 14px; background: var(--panel, #fff); min-width: 132px; }
.rm-metric-l { font-size: 12px; color: var(--muted, #6b7280); }
.rm-metric-v { font-size: 19px; font-weight: 650; color: var(--text, #111827); margin-top: 2px; }
.rm-metric-v span { font-size: 12px; font-weight: 400; color: var(--muted, #6b7280); margin-left: 3px; }
.rm-metric-h { font-size: 11.5px; color: #9ca3af; margin-top: 3px; }
.rm-table { overflow-x: auto; margin: 12px 0; }
.rm-table table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.rm-table th, .rm-table td { border: 1px solid var(--line);
                             padding: 6px 10px; text-align: left; }
.rm-table thead th { background: #f4f6f8; }
.rm-table td.rm-th { background: #fafbfc; color: #374151; font-weight: 600; }
.rm-chart { margin: 14px 0; }
.rm-trace { border: 0; border-radius: 10px;
            padding: 10px 12px; margin: 12px 0; background: #fafbfc; }
.rm-trace summary { cursor: pointer; font-size: 13px; font-weight: 600; color: #374151; }
.rm-trace-t { overflow-x: auto; margin-top: 8px; }
.rm-trace-t table { border-collapse: collapse; font-size: 11.5px; width: 100%; }
.rm-trace-t th, .rm-trace-t td { border: 1px solid var(--line);
                                 padding: 4px 8px; text-align: left; white-space: nowrap; }
.rm-trace-t thead th { background: #eef1f0; }
.rm-trace-note { font-size: 11.5px; color: var(--muted, #6b7280); margin-top: 6px; }
.rm-note { border-left: 3px solid #94a3b8; background: #f8fafc; border-radius: 0 8px 8px 0;
           padding: 8px 12px; margin: 12px 0; font-size: 12.5px; color: #374151; }
.rm-note p { margin: 0 0 4px; }
.rm-note p:last-child { margin: 0; }
.rm-note-warn { border-left-color: #f59e0b; background: #fffbeb; }
.rm-code { background: #f4f6f8; border-radius: 8px; padding: 10px 12px;
           font-size: 12px; overflow-x: auto; }
.rm-quote { margin: 10px 0; padding: 6px 12px; border-left: 3px solid var(--line); color: #4b5563; }
.rm-hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.rm-miss { font-size: 12px; color: #9ca3af; padding: 8px 12px;
           border: 1px dashed #d5d8dd; border-radius: 8px; }

/* 报告行尾的就地审核按钮组：跟着状态徽标排，不挤压标题 */
.rp-acts { display: flex; align-items: center; gap: 6px; flex: none; margin-left: 2px; }

/* 交付入口页的「会话 / 任务」两栏列表已移除（入口收口到侧栏最近对话与输入框菜单） */

/* 二级导航项：缩进一档、字号小一号，圆点标记层级 */
.nav-sub { padding: 2px 0 4px; }
.nav-sub-item {
  display: block; width: 100%; text-align: left;
  padding: 5px 10px 5px 40px; margin: 1px 0;
  border: 0; border-radius: 6px; background: transparent;
  font: inherit; font-size: 12.5px; color: var(--muted);
  cursor: pointer; position: relative;
}
.nav-sub-item::before {
  content: ""; position: absolute; left: 26px; top: 50%;
  width: 4px; height: 4px; margin-top: -2px; border-radius: 50%;
  background: currentColor; opacity: .35;
}
.nav-sub-item:hover { background: var(--panel-2); color: var(--text); }
.nav-sub-item.active { background: var(--panel-2); color: var(--accent); font-weight: 500; }
.nav-sub-item.active::before { opacity: 1; }
.sidebar.collapsed .nav-sub { display: none; }

/* 导航项提醒条数徽标（如「待办任务 4」） */
.sidebar.collapsed .nav-badge { display: none; }

/* 「新建」项：图标为带勾选的任务框，与其它导航项同规格（同色） */
.nav-new:hover .nav-ico { color: var(--accent); }

/* ---------- 导航折叠态：窄条只留图标 ---------- */
.sidebar { transition: width .18s ease, flex-basis .18s ease; }
.sidebar.collapsed { width: 60px; flex-basis: 60px; padding-left: 8px; padding-right: 8px; }
.sidebar.collapsed .brand { position: relative; justify-content: center; }
/* 折叠后常显 LOGO；导航开关按钮悬停时以不透明底浮出盖在 LOGO 上 */
.sidebar.collapsed .brand-main { display: flex; }
.sidebar.collapsed .brand-name { display: none; }
.sidebar.collapsed .brand-actions { position: absolute; inset: 0; display: grid; place-items: center; }
.sidebar.collapsed .brand-ico { width: 38px; opacity: 0; background: var(--bg); transition: opacity .15s; }
.sidebar.collapsed .brand:hover .brand-ico { opacity: 1; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 11px 0; gap: 0; }
.sidebar.collapsed .nav-txt { display: none; }
.sidebar.collapsed .nav-label { display: none; }
.sidebar.collapsed .dock-btn { justify-content: center; padding: 6px 0; gap: 0; }
.sidebar.collapsed .dock-name,
.sidebar.collapsed .dock-arrow { display: none; }

/* ---------- 工作总览（P0-02 入口页，按设计稿尺寸基准） ----------
   左导航 224 / 顶栏 60 / 主内容最大 1120 / 输入框最大 760，主色 #10B981 */
.crumbs { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.view-home { padding: 0; }            /* 工具栏要贴到视口顶，覆写 .view 的内边距 */
.home-topbar {
  flex: 0 0 60px;                      /* .view 是 flex column，内容超高时不允许被压缩 */
  position: sticky; top: 0; z-index: 20; height: 60px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.home-wrap { flex: none; width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 32px 56px; }

/* 欢迎区：顶部间距 64px；主标题 32/44；副标题 14/24，与主标题间距 8px */
.home-hero { padding-top: 64px; text-align: center; }
.home-title { margin: 10px 0 0; font-size: 32px; line-height: 44px; font-weight: 700; }
.home-sub { margin: 8px 0 0; font-size: 14px; line-height: 24px; color: var(--muted); }
#home-composer { margin: 30px auto 0; max-width: 760px; text-align: left; }

/* ---------- AgentTaskComposer（核算台 / 柔性看板用的自然语言框） ----------
   与 #composer 同一规格：无底色、无描边、无外环，焦点只靠光标 */
.atc {
  background: transparent; border: 0; border-radius: 16px;
  padding: 16px 20px;
}
.atc:focus-within { box-shadow: none; }
.atc-input {
  display: block; width: 100%; border: 0; outline: 0; resize: none;
  min-height: 120px; max-height: 240px; padding: 0; overflow-y: hidden;
  font: inherit; font-size: 14.5px; line-height: 1.7; color: var(--text);
  background: transparent;
}
.atc-input::placeholder { color: #9aa5b1; }
.atc-err {
  margin-top: 8px; font-size: 12.5px; color: #dc2626;
  background: #fef2f2; border: 0; border-radius: 8px; padding: 6px 10px;
}
.atc-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.atc-example {
  max-width: 62%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border: 0; background: none; color: var(--muted); font-size: 12.5px;
  cursor: pointer; text-align: left; padding: 4px 0;
}
.atc-example:hover { color: var(--accent-2); }
.atc-go {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); color: #fff; border: 0; border-radius: 10px;
  padding: 9px 22px; font-size: 14px; font-weight: 600; cursor: pointer;
}
.atc-go:hover:not(:disabled) { background: var(--accent-2); }
.atc-go:disabled { opacity: .65; cursor: default; }
.atc-spin {
  width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff;
  animation: atc-rot .7s linear infinite;
}
@keyframes atc-rot { to { transform: rotate(360deg); } }

/* ---------- 常用任务：3 列，间距 16，最小高 128 ---------- */
.home-quick { margin-top: 32px; }
.home-quick h3, .panel-head h3 { margin: 0; font-size: 16px; }
.home-quick h3 { margin-bottom: 14px; }
.quick-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.quick-card {
  display: flex; flex-direction: column; align-items: flex-start; text-align: left;
  min-height: 128px; padding: 18px 20px; border: 0;
  border-radius: 14px; background: var(--panel); color: var(--text); cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s, box-shadow .15s;
}
.quick-card svg { width: 22px; height: 22px; color: var(--accent); margin-bottom: 10px; }
.quick-card b { font-size: 14.5px; }
.quick-card span { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.quick-card i {
  font-style: normal; font-size: 11px; color: #94a3b8; margin-top: auto; padding-top: 10px;
}
.quick-card:hover {
  border-color: var(--accent); background: #f6fdf9;
  transform: translateY(-2px); box-shadow: 0 6px 18px rgba(16, 185, 129, .08);
}

/* ---------- 最近任务 / 待处理事项：与快捷卡间距 32，两栏 ---------- */
.home-lower { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; margin-top: 32px; }
.home-panel { padding: 16px 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.panel-link { border: 0; background: none; color: var(--accent-2); font-size: 12.5px; cursor: pointer; }
.panel-link:hover { text-decoration: underline; }
.home-row {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: none; border: none; border-bottom: 1px solid var(--line);
  padding: 9px 2px; font-size: 12.5px; cursor: pointer; color: var(--text);
}
.home-row:last-child { border-bottom: none; }
.home-row:hover { background: #f7f9fc; }
.home-row .hr-main { flex: 1; min-width: 0; }
.home-row .hr-main b { display: block; font-variant-numeric: tabular-nums; font-size: 13px; }
.home-row .hr-main span { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hr-badge {
  flex: none; font-size: 11px; font-weight: 600; border-radius: 999px; padding: 3px 9px;
}
.hr-badge.run { background: #eef2ff; color: #4f46e5; }
.hr-badge.warn { background: #fffbeb; color: #b45309; }
.hr-badge.bad { background: #fef2f2; color: #dc2626; }
.hr-badge.ok { background: #ecfdf5; color: #047857; }
.home-empty { padding: 10px 2px; font-size: 12.5px; }

/* ---------- 参数确认卡 ---------- */
.confirm-mask {
  position: fixed; inset: 0; z-index: 90; background: rgba(15, 23, 42, .38);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.confirm-card {
  width: 520px; max-width: 100%; max-height: 90vh; overflow: auto;
  background: #fff; border-radius: 16px; padding: 22px 24px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, .25);
}
.confirm-card h3 { margin: 0; font-size: 17px; }
.confirm-card > .muted { margin: 6px 0 12px; font-size: 12.5px; }
.cf-desc {
  font-size: 13px; line-height: 1.7; background: #f8fafc; border: 0;
  border-radius: 10px; padding: 10px 12px; white-space: pre-wrap; word-break: break-word;
}
.cf-label { font-size: 12.5px; font-weight: 600; margin: 14px 0 8px; }
/* 四个场景（含「日常问答」）：确认卡内容宽 472px，四列每列约 110px，正好一行 */
.cf-agents { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.cf-agent {
  border: 0; border-radius: 10px; background: #fff;
  padding: 10px 12px; text-align: left; cursor: pointer; font: inherit; color: var(--text);
}
.cf-agent b { display: block; font-size: 13px; }
.cf-agent span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.cf-agent.on { border-color: var(--accent); background: #f0fdf7; box-shadow: 0 0 0 1px var(--accent); }
.cf-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 6px; }
.cf-grid label { font-size: 12px; color: var(--muted); display: block; }
.cf-grid input, .cf-grid select {
  width: 100%; margin-top: 5px; padding: 7px 9px; font-size: 12.5px;
  border: 0; border-radius: 8px; background: #fff; color: var(--text);
}
.cf-note { font-size: 11.5px; margin: 10px 0 0; }
.cf-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* ---------- 响应式（1440 基准，兼容平板/移动） ---------- */
@media (max-width: 1024px) {
  .quick-cards { grid-template-columns: repeat(3, 1fr); }
  .home-lower { grid-template-columns: 1fr; }
  .cf-grid { grid-template-columns: 1fr; }
  .cf-agents { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .quick-cards { grid-template-columns: 1fr; }
  .home-hero { padding-top: 36px; }
  .home-title { font-size: 26px; line-height: 36px; }
  .home-topbar { padding: 0 16px; }
  .home-wrap { padding: 0 16px 40px; }
}

/* ---------- 能效诊断 Agent 首页 + 任务流（edh-*） ---------- */
.edh-hero { display: flex; align-items: center; gap: 14px; padding-top: 40px; }
.edh-hero .edh-ico {
  display: grid; place-items: center; width: 46px; height: 46px; flex: none;
  border-radius: 13px; background: #e7f8f1; color: var(--accent-2);
}
.edh-hero .edh-ico svg { width: 22px; height: 22px; }
.edh-scope {
  display: flex; gap: 18px; margin: 10px auto 0; max-width: 760px;
  font-size: 12.5px; color: var(--muted);
}
.edh-scope b { color: #334155; font-weight: 600; }
.edh-cards { grid-template-columns: repeat(2, 1fr); }
.edh-recent { margin-top: 28px; }
.edh-foot { margin-top: 18px; text-align: center; }

.edh-flow { max-width: 760px; margin: 24px auto 0; padding: 20px 24px; }
.edh-stepbadge {
  flex: none; font-size: 11.5px; font-weight: 600; color: #475569;
  background: #f1f5f9; border: 0; border-radius: 999px;
  padding: 4px 11px;
}
.edh-intent {
  background: #f8fafc; border: 0; border-radius: 10px;
  padding: 10px 14px;
}
.edh-intent b { font-size: 14.5px; }
.edh-types { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.edh-type {
  border: 0; border-radius: 10px; background: #fff;
  padding: 10px 13px; text-align: left; cursor: pointer; font: inherit; color: var(--text);
}
.edh-type b { display: block; font-size: 13px; }
.edh-type span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.edh-type.on { border-color: var(--accent); background: #f0fdf7; box-shadow: 0 0 0 1px var(--accent); }
.edh-flow .cf-label { margin-top: 14px; }
.edh-flow .input { width: 100%; }
.edh-flow .cf-actions { margin-top: 18px; }
#edh-building, #edh-month { margin-top: 6px; }

.edh-check {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 2px; border-bottom: 1px solid var(--line);
}
.edh-check:last-child { border-bottom: none; }
.edh-check .edh-ck-ico { color: var(--accent); flex: none; display: flex; }
.edh-check .edh-ck-ico svg { width: 18px; height: 18px; }
.edh-check .hr-main b { display: block; font-size: 13px; }
.edh-check .hr-main span { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.edh-run-actions { margin-top: 14px; display: flex; justify-content: flex-end; }
#edh-run-host .ed-msgs { max-height: none; }

@media (max-width: 768px) {
  .edh-cards { grid-template-columns: 1fr; }
  .edh-types { grid-template-columns: 1fr; }
}

/* ---------- 碳核算 Agent 首页 + 核算流（cbh-*，其余复用 edh-*） ---------- */
.cbh-kv {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px;
  margin-top: 12px; padding: 10px 14px;
  background: #f8fafc; border: 0; border-radius: 10px;
}
.cbh-kv > div { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.cbh-kv span { flex: none; font-size: 11.5px; color: var(--muted); }
.cbh-kv b { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cbh-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 14px; }
.cbh-stat {
  background: #f8fafc; border: 0; border-radius: 12px; padding: 12px 14px;
}
.cbh-stat span { display: block; font-size: 11.5px; color: var(--muted); }
.cbh-stat b { display: block; font-size: 24px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; }
.cbh-stat b small { font-size: 12px; font-weight: 500; color: var(--muted); }
.cbh-stat .muted { font-size: 11px; margin-top: 3px; }

.cbh-bar-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.cbh-bar-t { flex: none; width: 110px; font-size: 12.5px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cbh-bar { flex: 1; height: 10px; background: #eef2f6; border-radius: 999px; overflow: hidden; }
.cbh-bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.cbh-bar-v { flex: none; font-size: 12px; color: #334155; font-variant-numeric: tabular-nums; }

.cbh-table { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; margin-top: 4px; }
.cbh-table table { width: 100%; border-collapse: collapse; font-size: 12px; }
.cbh-table th, .cbh-table td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.cbh-table th { background: #f8fafc; font-weight: 600; color: #475569; }
.cbh-table tr:last-child td { border-bottom: none; }

@media (max-width: 768px) {
  .cbh-stats { grid-template-columns: 1fr; }
  .cbh-bar-t { width: 84px; }
}

/* 碳核算：大模型理解条（预选参数 + 置信度 + 待补充，仍需人工核对） */
.cbh-llm {
  border: 0; border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 10px 14px; margin-bottom: 10px; background: #fbfcfe;
}
.cbh-llm-h { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.cbh-llm-tag { font-size: 12.5px; font-weight: 600; }
.cbh-llm .fxt-narr { font-size: 12.8px; line-height: 1.75; color: var(--text); }

/* ---------- 柔性用电 Agent 首页 + 任务流（fxh-* / fxt-*，其余复用 edh-*/cbh-*） ---------- */
.btn.dark {
  background: #17181a; color: #fff; border: 0; border-radius: 999px;
  height: 40px; padding: 0 22px; font-weight: 600; font-size: 13px;
}
.btn.dark:hover { background: #000; }
.btn.dark:disabled { opacity: .45; cursor: default; }

/* 01 页任务参数卡：输入框与参数合为一张卡——描述在上、参数居中、开始分析收底。
   composer 自带的卡片外框与提交按钮在这里去掉：外框由参数卡承担，
   提交统一走底部的整宽按钮，不出现两个"开始分析"。 */
.fxt-config { max-width: 720px; margin: 14px auto 0; padding: 20px 24px 16px; }
.fxt-config .atc { border: 0; padding: 0; background: transparent; box-shadow: none; }
.fxt-config .atc:focus-within { box-shadow: none; }
.fxt-config .atc-input { border: 0; border-radius: 12px; padding: 12px 16px; }
.fxt-config .atc-go { display: none; }
.fxt-cfg-row { margin-bottom: 14px; }
.fxt-flabel { font-size: 12.5px; font-weight: 600; color: #6b7280; margin-bottom: 8px; }
.fxt-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.fxt-chips .chip {
  border: 0; background: #fff; border-radius: 999px;
  padding: 7px 15px; font-size: 13px; color: var(--text); cursor: pointer;
  transition: all .15s ease; line-height: 1.4;
}
.fxt-chips .chip:hover { border-color: var(--line); background: #f7f8fa; }
.fxt-chips .chip.active {
  background: #111418; border-color: #111418; color: #fff; font-weight: 500;
}
.fxt-config .input { width: 100%; margin-top: 8px; font-size: 13px; }
/* 提高特异性：通用 .btn 定义在本文件后部，会盖掉同权重的 .fxt-go */
.btn.fxt-go {
  width: 100%; margin-top: 6px; padding: 12px 16px; font-size: 14px;
  border-radius: 10px; background: #17181a; color: #fff; border: 0; font-weight: 600;
}
.btn.fxt-go:hover { background: #000; }
.btn.fxt-go:disabled { opacity: .45; cursor: default; }
.fxt-cards { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.fxt-u-item { background: #f8fafc; border: 0; border-radius: 10px;
  padding: 10px 14px; margin-bottom: 8px; }
.fxt-u-item b { font-size: 13.5px; }
.fxt-u-item .muted { margin-top: 4px; }

.fxt-confirm {
  display: flex; align-items: flex-start; gap: 9px; cursor: pointer;
  padding: 7px 2px; font-size: 13px; color: var(--text);
}
.fxt-confirm input { margin-top: 3px; accent-color: var(--accent); }

.fxt-res { border: 0; border-radius: 12px;
  padding: 12px 14px; margin-bottom: 10px; }
.fxt-res-h { display: flex; align-items: center; gap: 10px; }
.fxt-res-h b { font-size: 14px; }
.fxt-res-g { display: grid; gap: 4px; margin-top: 8px; }
.fxt-res-g > div { display: flex; justify-content: space-between; gap: 12px;
  font-size: 12.5px; }
.fxt-res-g span { color: var(--muted); flex: none; }
.fxt-res-g b { font-weight: 550; text-align: right; }

.fxt-steps { display: grid; gap: 10px; }
.fxt-steps > div { display: flex; gap: 10px; align-items: flex-start; }
.fxt-step-ico { display: inline-grid; place-items: center; flex: none;
  width: 22px; height: 22px; border-radius: 999px; font-size: 12px; margin-top: 1px; }
.fxt-step-ico.ok { background: #e7f8f1; color: var(--accent-2); }
.fxt-step-ico.run { background: #fef3c7; color: #b45309; }
.fxt-steps b { font-size: 13.5px; display: block; }

.fxt-ev { display: grid; gap: 8px; }
.fxt-ev > div { background: #f8fafc; border: 0;
  border-radius: 10px; padding: 10px 14px; }
.fxt-ev b { font-size: 13px; }

@media (max-width: 768px) {
  .fxt-config { padding: 16px 14px; }
}

/* 排放因子卡：正式 / 内置要一眼分清，出处能点开 */
.cbh-factor { margin-top: 16px; }
.cf-src { font-size: 12px; }
.cf-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 7px 2px; border-bottom: 1px dashed var(--border); font-size: 13px;
}
.cf-row:last-child { border-bottom: 0; }
.cf-row b { min-width: 88px; }
.cf-ver { color: var(--muted); font-size: 12px; }
.cbh-factor .cf-fetch { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.cbh-factor .cf-fetch .input { flex: 1 1 160px; margin: 0; font-size: 12.5px; }
.cbh-factor .cf-fetch #cbh-f-url { flex: 2 1 260px; }
.cf-cand {
  border: 0; border-radius: 10px; padding: 10px 12px;
  margin-top: 10px; background: #fbfcfe;
}
.cf-cand-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.cf-quote {
  margin: 6px 0; padding: 6px 10px; background: #fff; border-left: 3px solid var(--accent);
  border-radius: 4px; font-size: 12.5px; color: var(--text);
}
.cf-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

/* ---------- Main ---------- */
/* 全局细滚动条：贴边、细、半透明，替代系统默认的宽轨道 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(23, 24, 26, .16); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(23, 24, 26, .30); }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
* { scrollbar-width: thin; scrollbar-color: rgba(23, 24, 26, .18) transparent; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: #fff; }
.view { display: none; flex-direction: column; height: 100%; padding: 20px 28px; gap: 14px; overflow: auto; }

/* ============ 异常规则配置（阈值） ============ */
.th-demo-badge { vertical-align: 2px; margin-left: 8px; padding: 2px 10px; border-radius: 999px;
  background: #e7f8f1; color: var(--accent-2); font-size: 12px; font-weight: 600; }
.th-card { max-width: 780px; }
.th-row { padding: 12px 0 4px; }
.th-row-head { display: flex; justify-content: space-between; align-items: baseline; }
.th-label { font-size: 13.5px; }
.th-val { color: var(--accent); font-size: 21px; font-weight: 700; }
.th-range { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; margin: 10px 0 4px;
  border-radius: 999px; background: var(--panel-2); outline: none; }
.th-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow);
  cursor: pointer; }
.th-range::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; background: #fff;
  border: 1px solid var(--line); box-shadow: var(--shadow); cursor: pointer; }
.th-scale { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.th-sep { border: none; border-top: 1px solid var(--line); margin: 16px 0 12px; }

/* ================= 能效诊断 Agent ================= */
.ed-main { flex: 1; display: flex; flex-direction: column; min-height: 480px; }
.ed-b-ico { font-size: 22px; }
.ed-b-name { font-weight: 600; }
.ed-b-sub { font-size: 12px; color: var(--muted); }
.ed-badge { font-size: 11px; padding: 2px 9px; border-radius: 10px; white-space: nowrap; }
.ed-badge-ok { background: #ecfdf5; color: #059669; }
.ed-badge-warn { background: #fff7ed; color: #c2410c; }
.ed-badge-wait { background: #eef4ff; color: #2563eb; border: 0; }

/* 报告页审核状态条：谁提交、谁审的、结论与凭证 */
.edr-review { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin: 0 0 12px; padding: 9px 12px; border-radius: 8px; font-size: 12.5px;
  background: var(--bg, #f9fafb); border: 0; }
.edr-review b { font-size: 12.5px; }
.edr-review.rv-confirmed { background: #ecfdf5; color: #065f46; }
.edr-review.rv-false_positive { background: #fff7ed; color: #92400e; }
.edr-review.rv-pending { background: #eef4ff; color: #1e3a8a; }
.edr-rv-meta { color: var(--muted); font-size: 11.5px; }
.edr-rv-note { color: var(--muted); font-size: 11.5px; }
.ed-label { margin-top: 14px; font-size: 13px; color: var(--muted); display: block; }
.ed-msgs { flex: 1; overflow-y: auto; max-height: 520px; padding: 6px 2px;
  display: flex; flex-direction: column; gap: 14px; }
.ed-msg { display: flex; gap: 10px; }
.ed-msg.user { justify-content: flex-end; }
.ed-avatar { width: 32px; height: 32px; border-radius: 50%; background: #ecfdf5;
  display: flex; align-items: center; justify-content: center; flex: none; font-size: 15px; }
.ed-bubble { background: var(--bg, #f9fafb); border: 0;
  border-radius: 12px; padding: 12px 14px; max-width: 660px; font-size: 13.5px; line-height: 1.65; }
.ed-msg.user .ed-bubble { background: #ecfdf5; border-color: #a7f3d0; }
.ed-hr { border: none; border-top: 1px solid var(--line); margin: 10px 0; }
.ed-q { font-weight: 600; margin-bottom: 8px; }
.ed-task { display: flex; gap: 10px; align-items: center; border: 0;
  background: var(--card, #fff); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px;
  cursor: pointer; transition: border-color .15s; }
.ed-task:hover { border-color: #10b981; }
.ed-task-ico { font-size: 18px; }
.ed-task-t { font-weight: 600; font-size: 14.5px; }
.ed-task-s { font-size: 13px; color: var(--muted); margin-top: 2px; }
.ed-arrow { margin-left: auto; color: #9ca3af; font-size: 18px; }
.ed-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.ed-chip { border: 0; background: var(--card, #fff); border-radius: 16px;
  padding: 5px 12px; font-size: 12.5px; cursor: pointer; }
.ed-chip:hover { border-color: #10b981; color: #059669; }
.ed-inputrow { display: flex; gap: 10px; align-items: flex-end; }
.ed-input { flex: 1; resize: none; border: 0; border-radius: 10px;
  padding: 10px 12px; font: inherit; font-size: 13.5px;
  /* 同样要有自己的底色：白盒子压在白卡片上看不见边界 */
  background: var(--bg-soft); color: var(--text); outline: none;
  transition: border-color .15s, box-shadow .15s; }
.ed-input::placeholder { color: #9aa3ad; }
.ed-input:focus { border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, .12); }
.ed-send { background: #111827; color: #fff; border: none; border-radius: 10px;
  padding: 10px 18px; cursor: pointer; }
.ed-note { margin-top: 8px; font-size: 12.5px; color: #9ca3af; }
.ed-card { width: 100%; }
.ed-card-t { font-weight: 700; font-size: 16.5px; margin-bottom: 6px; }
.ed-card-s { font-size: 13.5px; color: var(--muted); margin-bottom: 12px; }
.ed-card-plan { background: var(--bg, #f9fafb); border: 0; border-radius: 8px;
  padding: 8px 10px; font-size: 13.5px; line-height: 1.8; }
.ed-resultbox { font-size: 15px; }
.ed-note2 { font-size: 14px; color: #374151; background: var(--bg, #f9fafb); border-radius: 8px;
  padding: 8px 10px; margin-top: 8px; line-height: 1.7; }
.ed-note2.warn { background: #fffbeb; color: #92400e; }


/* 逐步执行：每道工序一行，执行中/完成/失败三态 */
.ed-steps { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.ed-step { display: flex; gap: 8px; padding: 8px 10px; border-radius: 8px;
           border: 0; background: var(--panel, #fff); }
.ed-step-ico { flex: none; width: 16px; text-align: center; font-size: 12.5px; }
.ed-step-c { flex: none; min-width: 18px; font-size: 11px; color: var(--muted);
             font-variant-numeric: tabular-nums; padding-top: 1px; }
.ed-step-main { min-width: 0; flex: 1; }
.ed-step-t { font-size: 14.5px; font-weight: 600; }
.ed-step-d { font-size: 13px; color: var(--muted); margin-top: 3px; line-height: 1.6; }
.ed-step.run .ed-step-ico { color: var(--accent); animation: ed-spin 1s linear infinite; }
.ed-step.ok { background: #f6fbf8; }
.ed-step.ok .ed-step-ico { color: #1f8a4c; }
.ed-step.bad { background: #fdf6f6; }
.ed-step.bad .ed-step-ico { color: #c0392b; }
.ed-tail { font-size: 12px; margin-top: 8px; }

/* 大模型编排：工具调用折叠区与拦截提示 */
.ed-answer { margin-top: 10px; font-size: 15px; line-height: 1.75; white-space: pre-wrap; }
.ed-guard { border-left: 3px solid #c0392b; background: #fdf6f6;
  padding: 8px 10px; border-radius: 6px; font-size: 12.5px; line-height: 1.65; }
.ed-guard b { color: #c0392b; display: block; margin-bottom: 4px; }
.ed-raw { margin-top: 6px; font-size: 11.5px; color: var(--muted); }

/* 流水线 + 每步 LLM + 报告 */
.ed-aibar { display: flex; align-items: center; gap: 10px;
  padding: 8px 0 4px; flex-wrap: wrap; }
.ed-aibar .muted { font-size: 12px; line-height: 1.5; }
/* 工序卡片：时间线布局——左列圆形节点，节点间竖线相连；结论在上，原始数据按需展开 */
.ed-pstep { position: relative; padding: 2px 0 14px 34px; margin-top: 8px; }
/* 节点间的连接线：从圆下缘延伸到下一行（done 行染绿，视觉上「这段走通了」） */
.ed-pstep::before {
  content: ''; position: absolute; left: 12px; top: 26px; bottom: 2px;
  width: 2px; border-radius: 1px; background: var(--line, #e5e7eb);
}
.ed-pstep:last-child::before { display: none; }
.ed-pstep.done::before { background: linear-gradient(180deg, #34d399, #a7f3d0); }
.ed-pstep.bad::before { background: #c0392b; }
.ed-pstep-h { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
/* 节点圆：运行中显示工序代号（灰），完成变绿色 ✓，失败红色 ✗ */
.ed-pstep-c {
  position: absolute; left: 2px; top: 2px; z-index: 1;
  width: 22px; height: 22px; border-radius: 50%; padding: 0;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: #fff;
  background: var(--muted, #9ca3af);
  box-shadow: 0 0 0 3px #fff;   /* 白圈把圆和竖线隔开，节点感更清楚 */
}
.ed-pstep.running-step .ed-pstep-c { background: #9ca3af; animation: ed-pulse 1.2s ease-in-out infinite; }
.ed-pstep.done .ed-pstep-c {
  background: linear-gradient(135deg, #6ee7b7, var(--accent, #10b981));
  box-shadow: 0 0 0 3px #fff, 0 2px 8px rgba(16, 185, 129, .3);
}
.ed-pstep.bad .ed-pstep-c { background: #c0392b; }
@keyframes ed-pulse { 50% { box-shadow: 0 0 0 3px #fff, 0 0 0 6px rgba(16,185,129,.18); } }
.ed-pstep-t { font-size: 15px; font-weight: 600; }
.ed-pstep-flag { margin-left: auto; font-size: 13px; color: #1f8a4c; white-space: nowrap; }
.ed-pstep.bad .ed-pstep-flag { color: #c0392b; }
.ed-pstep-data { margin-top: 2px; }
.ed-pstep-data summary { cursor: pointer; font-size: 13px; color: var(--muted, #6b7280);
  list-style: none; }
.ed-pstep-data summary::-webkit-details-marker { display: none; }
.ed-pstep-data summary::before { content: '▸ '; }
.ed-pstep-data[open] summary::before { content: '▾ '; }
.ed-pstep-data[open] summary { margin-bottom: 4px; }

.ed-kv { display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  font-size: 15px; padding: 4px 0; border-bottom: 1px dashed var(--line, #eef0f3); }
.ed-kv span { color: var(--muted, #6b7280); white-space: nowrap; }   /* 标签不折行 */
.ed-kv b { white-space: nowrap; text-align: right; flex: none; }      /* 值也不折行 */
.ed-sline { font-size: 13.5px; color: var(--muted, #6b7280); padding: 4px 0; line-height: 1.7; }
/* 工序的一句话说明：只来自流水线 plan 里这道工序的 desc，没带就不占行 */
.ed-pstep-d { font-size: 12.5px; line-height: 1.6; color: var(--muted, #8f959e);
  margin: -1px 0 6px; max-width: 620px; }
/* 正在跑的这一道把「在做什么」说清楚，跑完的退回灰：视觉焦点跟着工序走 */
.running-step .ed-pstep-d { color: #5b6472; }
/* ✦ AI 解读：这一段是大模型把事实说成人话，不是引擎算出的数，样式上要分得开。
   左侧一道绿→青渐变细轨承担识别，正文仍用同一套字号行距，不做第二套排版 */
.ed-pstep-ai { position: relative; margin-top: 8px; padding: 7px 0 2px 13px;
  font-size: 15px; line-height: 1.75; }
.ed-pstep-ai::before {
  content: ''; position: absolute; left: 0; top: 5px; bottom: 8px; width: 2px;
  border-radius: 2px; background: linear-gradient(180deg, var(--accent, #10b981), #22d3ee);
  opacity: .5;
}
/* 没出解读（模型不可用）时不要那道轨：那是「这里有 AI 结论」的假信号 */
.ed-pstep-ai:has(> .ed-stray:only-child)::before { display: none; }
.ed-ai-tag { display: inline-flex; align-items: center; gap: 3px; margin: 0 0 6px;
  font-size: 11.5px; font-weight: 650; letter-spacing: .2px;
  color: var(--accent-2, #059669);
  background: linear-gradient(135deg, #ecfdf5, #ecfeff);
  border: 0; border-radius: 999px; padding: 1px 9px; }
.ed-pstep-ai p { margin: 0 0 8px; white-space: pre-wrap; }
.ed-pstep-ai ul { margin: 0 0 8px; padding-left: 20px; }
/* 字还在往外蹦：块尾挂一枚光标，行首的渐变轨跟着呼吸——「模型正在写」要看得见，
   但也只在流式期间存在，llm_done 一到就把 data-streaming 摘掉 */
.ed-pstep-ai[data-streaming="1"]::after {
  content: ''; display: inline-block; width: 6px; height: 15px; margin-left: 2px;
  vertical-align: -2px; background: var(--accent, #10b981);
  animation: ed-caret 1s steps(1) infinite;
}
.ed-pstep-ai[data-streaming="1"]::before { animation: ed-rail 1.5s ease-in-out infinite; }
@keyframes ed-caret { 50% { opacity: 0; } }
@keyframes ed-rail { 50% { opacity: 1; } }
.ed-sys { text-align: center; font-size: 11.5px; color: var(--muted);
  padding: 4px 8px; margin: 4px auto; width: fit-content;
  background: var(--bg, #f9fafb); border-radius: 10px; }
.ed-guard-raw { margin-top: 8px; }
.ed-guard-raw summary { color: #c0392b; }
/* 「数值无法溯源」警示框：这是护栏唯一能在页面上示警的地方，样式掉了就等于白拦 */
.ed-stray { margin-top: 8px; font-size: 13.5px; color: #b45309;
  background: #fffbeb; border-left: 3px solid #f59e0b; padding: 7px 10px; border-radius: 5px; }
/* 报告正文的排版与会话里的 Markdown 完全一致，读诊断和读回答是同一种体验 */
.ed-report { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.ed-report-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ed-report-h h4 { margin: 0 0 10px; font-size: 17px; font-weight: 700; color: #17181a; }
.ed-report-body h4 { margin: 22px 0 10px; font-size: 17px; font-weight: 700; color: #17181a; }
.ed-report-body h4:first-child { margin-top: 0; }
.ed-report-body p { margin: 0 0 12px; font-size: 15px; line-height: 1.75;
  color: #26282c; white-space: pre-wrap; }
.ed-report-body ul { margin: 2px 0 14px; padding-left: 24px; font-size: 15px;
  line-height: 1.75; color: #26282c; }
.ed-report-body li { margin: 8px 0; }
.ed-quote { border-left: 3px solid var(--line); padding: 4px 10px;
  margin: 6px 0; font-size: 14px; line-height: 1.7; color: var(--muted, #6b7280); }
.ed-raw summary { cursor: pointer; }
.ed-raw pre { max-height: 200px; overflow: auto; background: var(--bg, #f9fafb);
  border-radius: 6px; padding: 8px; margin-top: 4px; white-space: pre-wrap; }
@keyframes ed-spin { to { transform: rotate(360deg); } }

.edr-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px; margin-bottom: 16px; }
.edr-metric { background: var(--card, #fff); border: 0;
  border-radius: 12px; padding: 14px 16px; }
.edr-metric.warn .edr-m-v { color: #c2410c; }
.edr-m-t { font-size: 12px; color: var(--muted); }
.edr-m-v { font-size: 22px; font-weight: 700; margin: 4px 0 2px; }
.edr-m-n { font-size: 11.5px; color: #9ca3af; }
.edr-sec-t { font-weight: 700; margin-bottom: 10px; }
.edr-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.edr-tabs button { border: 0; background: var(--card, #fff);
  border-radius: 16px; padding: 5px 14px; font-size: 12.5px; cursor: pointer; }
.edr-tabs button.active { background: #111827; color: #fff; border-color: #111827; }
.edr-event { border: 0; border-radius: 10px; padding: 12px 14px;
  margin-bottom: 10px; cursor: pointer; }
.edr-event:hover, .edr-event.open { border-color: #10b981; }
.edr-ev-head { display: flex; gap: 10px; align-items: center; }
.edr-ev-id { font-size: 11.5px; color: var(--muted); flex: none; }
.edr-ev-mid { flex: 1; min-width: 0; }
.edr-ev-t { font-weight: 600; font-size: 13.5px; }
.edr-ev-s { font-size: 12px; color: var(--muted); }
.ed-conflict { font-size: 12px; color: #92400e; background: #fffbeb; border-radius: 6px;
  padding: 6px 8px; margin-top: 6px; line-height: 1.5; }
.edr-det-head { display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 12px; gap: 10px; }
.edr-bars { margin: 10px 0 4px; }
.edr-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.edr-bar-l { width: 70px; font-size: 12px; color: var(--muted); flex: none; }
.edr-bar-track { flex: 1; height: 14px; background: #f3f4f6; border-radius: 7px; overflow: hidden; }
.edr-bar-fill { height: 100%; border-radius: 7px; }
.edr-bar-fill.gray { background: #d1d5db; }
.edr-bar-fill.green { background: #10b981; }
.edr-bar-v { width: 90px; font-size: 12.5px; font-weight: 600; text-align: right; }
.edr-bar-note { font-size: 11.5px; color: #9ca3af; margin-top: 6px; line-height: 1.5; }
.edr-ev-tabbar { display: flex; gap: 14px; border-bottom: 1px solid var(--line); margin: 14px 0 10px; }
.edr-ev-tabbar button { border: none; background: none; padding: 8px 2px; font-size: 13px;
  cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; }
.edr-ev-tabbar button.active { color: var(--fg, #111827); font-weight: 600;
  border-bottom-color: #10b981; }
.edr-ev-sec { margin-bottom: 12px; }
.edr-ev-sect { font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.ed-evi { font-size: 14.5px; padding: 9px 12px; border: 0;
  border-radius: 8px; margin-bottom: 8px; line-height: 1.7; }
.ed-evi b { display: block; font-size: 13px; color: #059669; margin-bottom: 2px; }
.ed-evi.against b { color: #c2410c; }
.ed-evi i { float: right; font-style: normal; font-size: 12.5px; color: #9ca3af; }
.th-strategy-title { font-weight: 600; margin-bottom: 4px; }
.th-radio { display: block; padding: 5px 0; cursor: pointer; }
.th-radio input { margin-right: 8px; accent-color: var(--accent); }
.th-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.th-table th, .th-table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); }
.th-table th { color: var(--muted); font-weight: 500; }
.th-num { font-variant-numeric: tabular-nums; }
.th-diff { color: var(--accent-2); font-weight: 600; }
.th-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; }
.th-tag.ok { background: #e7f8f1; color: var(--accent-2); }
.th-tag.warn { background: #fdf3e0; color: #b45309; }
.th-warns { background: #fffbeb; border-radius: 10px; padding: 10px 14px;
  font-size: 13px; margin: 10px 0; }
.th-warns ul { margin: 6px 0 0; padding-left: 18px; }
.view.active { display: flex; }

.view-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.view-header h1 { margin: 0; font-size: 19px; font-weight: 650; }
.muted { color: var(--muted); margin: 4px 0 0; font-size: 12.5px; }
.actions { display: flex; gap: 8px; align-items: center; }

/* ---------- 欢迎首页（对话空态，布局参考 Perplexity 入口页） ---------- */
.hero {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 10px; text-align: center; padding: 40px 0 18px; flex: 0 0 auto;
  max-width: 720px; margin: 0 auto; width: 100%;
}
/* 单行问候：字号收敛到接近正文标题，人名加重（参考稿的 Hey 👋 Saleh!） */
.hero h1 { margin: 0; font-size: 26px; font-weight: 650; letter-spacing: .2px; color: #1f2329; }
.hero h1 b { font-weight: 720; }

/* 建议问题：点一下填进输入框；左侧彩色小图标区分话题 */
.chips { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
  margin: 14px auto 0; max-width: 720px; width: 100%; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px 7px 8px; border-radius: 999px; border: 0;
  background: var(--panel); color: #4b5563; font: inherit; font-size: 13px;
  cursor: pointer; transition: .15s;
}
.chip-ico {
  width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center;
  font-size: 12px; font-style: normal; flex: 0 0 22px;
}
.chip-ico.blue { background: #e8f0fe; }
.chip-ico.green { background: #e6f4ea; }
.chip-ico.pink { background: #fdecec; }
.chip-ico.amber { background: #fdf3e0; }
.chip:hover { color: var(--text); box-shadow: var(--shadow); transform: translateY(-1px); }

.hc-icon.blue { background: #eef4ff; }
.hc-icon.green { background: #e7f5ec; }
/* ---------- 对话页双形态：空态=融合首页（整体垂直居中） / 有消息=聊天 ---------- */
#view-chat { overflow-y: auto; }
#view-chat #chat-hero { order: 1; }
#view-chat #composer { order: 2; }
#view-chat #home-chips { order: 3; }
#view-chat #chat-home-extra { order: 4; }
#view-chat #chat-scroll { order: 5; }
#view-chat #file-input { display: none; }

#view-chat:not(:has(.msg.user, .msg.assistant)) { justify-content: center; }
#view-chat:not(:has(.msg.user, .msg.assistant)) #chat-header { display: none; }
/* 限定在 #agx-chat-col 内：#chat-scroll 会被搬到对话详情页，
   那时它不再是 #view-chat 的子节点，这套单列规则不该再管它 */
#view-chat:not(:has(.msg.user, .msg.assistant)) #agx-chat-col #chat-scroll { display: none; }
#view-chat:not(:has(.msg.user, .msg.assistant)) #chat-hero { padding: 0 12px 10px; }
#view-chat:not(:has(.msg.user, .msg.assistant)) .hero-cards { margin-top: 22px; }
/* 入口页与聊天态共用同一套 composer 样式：对话框是完整的一块，
   不给 textarea 单独的圆角和阴影（那会让它从容器里浮出来变成两截） */

/* 入口页（还没说过话）：系统提示气泡也不显示，保持空态干净
   （登录信息在侧栏用户中心，不必再占一屏） */
#view-chat:not(:has(.msg.user, .msg.assistant)) .msg.system { display: none; }

/* 聊天态：藏首页元素；输入框悬浮在消息流上层（DeepSeek 式）——
   消息流占满 100% 宽并自己滚动，输入框 720 居中 absolute 盖在其上，
   消息滚动时从输入框后面穿过；流末留出输入框高度的空白，最后一条消息能完整滚出来 */
#view-chat:has(.msg.user, .msg.assistant) { position: relative; padding: 0; }
/* 内边距改由内容自己控制：header 手动留边，消息列与输入框各自居中（轴线一致），滚动条得以贴住窗口右缘 */
#view-chat:has(.msg.user, .msg.assistant) #chat-header { padding: 20px 28px 0; }
#view-chat:has(.msg.user, .msg.assistant) #chat-hero,
#view-chat:has(.msg.user, .msg.assistant) #home-chips,
#view-chat:has(.msg.user, .msg.assistant) #chat-home-extra { display: none; }
#view-chat:has(.msg.user, .msg.assistant) #agx-chat-col #chat-scroll { order: 1; flex: 1; padding-bottom: 152px; }
#view-chat:has(.msg.user, .msg.assistant) #agx-chat-col #composer {
  position: absolute; left: 0; right: 0; bottom: 16px; z-index: 5;
  width: 100%; max-width: 720px; margin: 0 auto; padding: 12px 0 0;
  /* 上方渐透、下方实底：滚到输入框附近的气泡自然淡出，不硬切一条线 */
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #fff 34%);
}

/* ---------- 空态：问候语 + 输入框整体垂直居中 ----------
   只作用于未产生任何消息时；一旦有消息就回到「消息流 + 底部悬浮输入框」的聊天态。
   safe center：矮屏时内容超高从头排，不把顶部裁掉 */
#view-chat:not(:has(.msg.user, .msg.assistant)) {
  justify-content: center;
  justify-content: safe center;
}
#view-chat:not(:has(.msg.user, .msg.assistant)) .hero { padding: 0 0 20px; }
/* 空态占位容器没有内容时不占空间，否则居中会被多出的 gap 顶偏 */
#chat-home-extra:empty { display: none; }

/* ---------- 功能入口卡片：已随入口页简化移除 ---------- */

/* 消息流：滚动容器占满（滚动条贴内容区右缘），内容收进与对话框同宽的 720 居中列——
   左右 padding 动态撑出居中，窄屏时退为 28px 边距 */
.chat-scroll {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; width: 100%;
  padding: 0 max(28px, calc((100% - 720px) / 2));
}
.chat-scroll:empty { display: none; }

/* ---------- Chat ---------- */
.msg { max-width: 100%; padding: 11px 14px; border-radius: 14px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.msg.user { align-self: flex-end; background: #e6f7f0; color: #1f2329; border-bottom-right-radius: 4px; }
/* 回答是一整块结论，要给自己的底和边：
   直接铺在白底页面上读不出边界，也不知道这段是 Agent 给的还是页面的。
   排版仍然靠标题/表格/列表呈现层次，只是外面套一层卡片。 */
.msg.assistant {
  align-self: stretch; padding: 14px 16px; border-radius: 14px;
  background: var(--bg-soft); border: 0;
  box-shadow: 0 1px 2px rgba(31, 35, 41, .04); white-space: normal;
  font-size: 15px; line-height: 1.75; color: #26282c;
}
.msg.assistant.streaming { white-space: pre-wrap; }   /* 流式期间还是纯文本，保留换行 */
.msg.assistant p { margin: 0 0 12px; }
.msg.assistant p:last-child { margin-bottom: 0; }
.msg.assistant h4 { font-size: 17px; font-weight: 700; color: #17181a; margin: 22px 0 10px; }
.msg.assistant h4:first-child { margin-top: 2px; }
.msg.assistant ul, .msg.assistant ol { margin: 2px 0 14px; padding-left: 24px; }
.msg.assistant li { margin: 8px 0; }
.msg.assistant li::marker { color: #6b7280; }
/* 表格与代码块改成白底：卡片本身已经是浅灰，内块再同色就彻底看不见边界了 */
.msg.assistant table { border-collapse: collapse; width: 100%; margin: 10px 0 12px; font-size: 13px; line-height: 1.5; background: #fff; }
.msg.assistant th, .msg.assistant td { border: 1px solid var(--line); padding: 7px 11px; text-align: left; vertical-align: top; }
.msg.assistant th { background: var(--panel-2); font-weight: 600; white-space: nowrap; }
.msg.assistant tr:nth-child(even) td { background: #fbfcfd; }
.msg.assistant code {
  background: #fff; border: 0; border-radius: 5px;
  padding: 1px 5px; font-size: 12.5px; font-family: ui-monospace, Consolas, monospace;
}
.msg.assistant pre.md-pre {
  background: #fff; border: 0; border-radius: 10px;
  padding: 12px 14px; overflow-x: auto; margin: 10px 0;
}
.msg.assistant pre.md-pre code { background: none; border: 0; padding: 0; }
.msg.assistant .md-quote { border-left: 3px solid var(--line); padding: 2px 12px; color: #6b7280; margin: 8px 0; background: #fff; border-radius: 0 8px 8px 0; }
.msg.assistant svg { max-width: 100%; }
.msg.system { align-self: center; max-width: 100%; background: transparent; color: var(--muted); font-size: 12px; box-shadow: none; }

/* 本轮的两张对话列卡片：读到了什么（需求回读）、走到哪了（下发进度）。
   参数明细和工序表都在工作区，这里只留人能一眼核对的两句话 */
.msg.need, .msg.job {
  align-self: stretch; max-width: 100%; white-space: normal;
  background: #fff; border: 0; border-radius: 14px;
  padding: 12px 14px; box-shadow: 0 1px 2px rgba(23, 24, 26, .04);
}
.need-h, .job-h { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.need-h b, .job-h b { font-weight: 650; color: var(--text); }
/* ✓ 说的是「需求已读取 / 任务已下发」这一步成了，不代表整轮跑完 */
.need-ck, .job-ck {
  flex: 0 0 17px; width: 17px; height: 17px; border-radius: 999px;
  display: grid; place-items: center; font-style: normal;
  background: var(--accent-2); color: #fff; font-size: 10.5px; line-height: 1;
}
.msg.job.bad .job-ck { background: #e03131; }
.need-l { display: flex; flex-direction: column; gap: 6px; margin-top: 9px; }
.need-r { display: flex; gap: 10px; font-size: 13px; line-height: 1.55; }
.need-k { flex: 0 0 66px; color: var(--muted); }
.need-v { min-width: 0; color: var(--text); word-break: break-word; }
/* 进度文案与百分比都抄自工作区步骤条：停工/完成只在颜色上区分，不另写一套状态 */
.job-t { min-width: 0; color: var(--muted); font-size: 12.5px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.job-t::before { content: '·'; margin-right: 6px; color: #b7bec7; }
.job-t:empty::before { content: none; }
.msg.job.run .job-ck { animation: ed-pulse 1.6s ease-in-out infinite; }
.msg.job.bad .job-t, .msg.job.bad .job-h b { color: #b02525; }
.msg.job.done .job-t { color: var(--accent-2); }
.job-bar { height: 4px; border-radius: 999px; background: var(--panel-2);
  margin-top: 10px; overflow: hidden; }
.job-bar > i { display: block; height: 100%; background: var(--accent-2);
  border-radius: 999px; transition: width .3s; }

/* 回到底部：消息流离底较远时浮现（DeepSeek 式悬浮 ↓） */
.chat-jump {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 156px; z-index: 6;
  width: 38px; height: 38px; border-radius: 50%; border: 0;
  background: #fff; color: #3c4450; font-size: 16px; cursor: pointer;
  box-shadow: 0 4px 16px rgba(23, 24, 26, .12); transition: .15s;
}
.chat-jump:hover { color: #17181a; box-shadow: 0 6px 20px rgba(23, 24, 26, .18); }

.tool-card {
  align-self: flex-start; max-width: 82%; width: 100%;
  border: 0; border-radius: 12px; background: var(--panel);
  font-size: 12.5px; overflow: hidden;
}
.tool-card summary { cursor: pointer; padding: 8px 12px; color: var(--accent-2); list-style: none; }
.tool-card summary::-webkit-details-marker { display: none; }
.tool-card pre { margin: 0; padding: 0 12px 12px; color: var(--muted); white-space: pre-wrap; word-break: break-word; }

/* 用户条 / 登录 / 权限视图 */
/* 底部用户中心（弹出菜单含系统配置等入口） */
.sidebar-dock {
  display: flex; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--line);
}
.dock-item { position: relative; flex: 1; min-width: 0; }
.dock-btn {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 10px; border: 0; border-radius: 10px; background: transparent;
  cursor: pointer; color: var(--text); min-width: 0; text-align: left;
}
.dock-btn:hover { background: var(--panel-2); }
.dock-avatar {
  width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: 0 0 30px;
}
.dock-name { flex: 1; min-width: 0; line-height: 1.25; }
.dock-name b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock-name span { display: block; font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dock-arrow { width: 15px; height: 15px; color: var(--muted); flex: 0 0 15px; }
.pop-menu {
  display: none; position: absolute; bottom: calc(100% + 8px); left: 0; width: 248px;
  background: #fff; border: 0; border-radius: 14px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, .16); padding: 8px; z-index: 60;
}
.dock-item.open .pop-menu { display: block; }
.pop-item {
  display: block; width: 100%; text-align: left; padding: 8px 10px;
  border: 0; background: none; border-radius: 8px; cursor: pointer; font-size: 12.5px; color: var(--text);
}
.pop-item:hover { background: var(--panel-2); }
.pop-item.danger { color: #dc2626; }
.pop-sep { height: 1px; background: var(--border); margin: 6px 2px; }
.pop-head { display: flex; align-items: center; gap: 10px; padding: 4px 8px 8px; }
.pop-head b { display: block; font-size: 13px; }
.pop-head span { font-size: 11.5px; color: var(--muted); }
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .38);
  display: grid; place-items: center; z-index: 70;
}
.modal-card {
  width: 340px; max-width: 92vw; background: #fff; border-radius: 16px; padding: 22px;
  display: flex; flex-direction: column; gap: 10px; box-shadow: 0 18px 50px rgba(15, 23, 42, .2);
}
.modal-card h2 { font-size: 18px; margin: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

/* 单据详情浮层：宽卡 + 可滚动正文，正文复用上传页的 bl-* / dqb-* 版式。
   抬头溯源用灰底（L1），与下面白底的电费单台账分层 */
.bd-card { width: 880px; max-width: 94vw; max-height: 88vh; padding: 20px 22px; gap: 12px; }
.bd-top { display: flex; align-items: center; gap: 12px; }
.bd-top h2 { flex: 1 1 auto; min-width: 0; font-size: 17px; margin: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-x { flex: 0 0 auto; width: 28px; height: 28px; display: flex; align-items: center;
  justify-content: center; border: 0; border-radius: 8px; background: transparent;
  color: var(--muted); font-size: 14px; line-height: 1; cursor: pointer; transition: background .15s, color .15s; }
.bd-x:hover { background: var(--bg-soft); color: var(--text); }
.bd-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden;
  margin: 0 -8px; padding: 0 8px; }
.bd-prov { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 18px; padding: 12px 14px; border-radius: 12px; background: var(--bg-soft); }
.bd-prov-i { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.bd-prov-i > span { font-size: 11.5px; color: var(--muted); }
.bd-prov-i > b { font-size: 13px; font-weight: 600; color: var(--text); }
.bd-prov-i > b i { font-style: normal; font-size: 11px; color: var(--muted); margin-left: 6px; }
.dc-acts { display: flex; align-items: center; gap: 6px; }

/* 新增数据源 / 新增设备：把页内展开的表单收进浮层，与上传单据/单据详情同一套 modal 骨架。
   抬头复用 bd-top/bd-x，正文复用 bd-body 的可滚与滚动条留白；字段网格沿用 dcs-/dvm- 那套，
   只在浮层里收成两列、窄屏一列。正文不撑高（flex:0 1 auto），短表单就是一张紧凑的卡。
   脚注左侧报错、右侧取消/保存。 */
.fm-card { width: 640px; max-width: 94vw; max-height: 88vh; padding: 20px 22px; gap: 12px; }
.fm-sub { margin: -2px 0 0; font-size: 12px; color: var(--muted); line-height: 1.6; }
.fm-body { flex: 0 1 auto; display: flex; flex-direction: column; gap: 12px; }
.fm-card .dcs-grid, .fm-card .dvm-addgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fm-card .dvm-addgrid { align-items: end; }
.fm-foot { display: flex; align-items: center; gap: 12px; }
.fm-err { flex: 1 1 auto; min-width: 0; font-size: 12px; color: var(--danger); line-height: 1.5; }
.fm-foot .modal-actions { flex: 0 0 auto; margin-top: 0; }
@media (max-width: 560px) {
  .fm-card .dcs-grid, .fm-card .dvm-addgrid { grid-template-columns: 1fr; }
}

.user-chip {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin: 0 10px 10px;
  background: #fff; border: 0; border-radius: 12px;
}
.user-chip .avatar {
  width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: 0 0 30px;
}
.user-chip .u-info { flex: 1; min-width: 0; }
.user-chip .u-info b { display: block; font-size: 12.5px; }
.user-chip .u-info span {
  font-size: 11px; color: var(--muted); display: block;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.user-chip .logout { padding: 4px 8px; font-size: 11.5px; }

/* 登录页：左侧品牌视觉区 + 右侧登录卡（左右分栏，居中自适应） */
/* ---------- 登录页：中性底上「品牌卡 + 表单卡」等高成组 ---------- */
/* 底不铺纯白：叠一层极浅绿晕，让左边品牌绿卡浮起来（照参考图的灰底浮卡） */
.login-mask {
  position: fixed; inset: 0; z-index: 50;
  background:
    radial-gradient(70% 60% at 82% 12%, rgba(16, 185, 129, .07) 0%, rgba(16, 185, 129, 0) 60%),
    var(--bg);
  display: flex; align-items: center; justify-content: center; padding: 32px;
}
/* 左品牌叙事、右表单；gap 收紧让两卡读作一个整体，而不是两块散卡 */
.login-page {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(340px, 400px);
  gap: 24px; align-items: stretch;
  width: min(1060px, 100%); max-height: 100%;
}
.login-side {
  position: relative; overflow: hidden; min-height: 560px; padding: 46px 48px;
  border-radius: 24px; color: #fff; display: flex; flex-direction: column;
  background: radial-gradient(120% 130% at 12% 8%, #14b8a6 0%, #059669 42%, #065f46 100%);
  box-shadow: 0 24px 60px rgba(6, 95, 70, .18);
}
.login-side::after {
  content: ''; position: absolute; right: -90px; bottom: -110px;
  width: 340px; height: 340px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.16), rgba(255,255,255,0) 70%);
}
.ls-brand { display: flex; align-items: center; gap: 12px; }
.ls-brand .logo { width: 40px; height: 40px; flex: 0 0 40px; background: #fff; border-radius: 50%; padding: 3px; }
.ls-name { font-size: 18px; font-weight: 600; letter-spacing: .3px;
  font-family: var(--font-brand); }
.ls-body { margin-top: auto; margin-bottom: auto; padding: 28px 0; }
.ls-body h1 { margin: 0; font-size: clamp(30px, 3.6vw, 42px); line-height: 1.3; font-weight: 700; letter-spacing: .5px; }
.ls-sub { margin: 18px 0 0; font-size: 15px; color: rgba(255,255,255,.85); }
.ls-points { list-style: none; margin: 30px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.ls-points li { position: relative; padding-left: 20px; font-size: 14px; color: rgba(255,255,255,.92); }
.ls-points li::before {
  content: ''; position: absolute; left: 0; top: 7px; width: 8px; height: 8px;
  border-radius: 50%; background: #a7f3d0;
}
.ls-foot { font-size: 12px; color: rgba(255,255,255,.62); }

/* 表单卡与品牌卡等高、内容垂直居中：白卡不顶格摆字段，留出呼吸 */
.login-card {
  width: 100%; background: #fff; border: 0;
  border-radius: 24px; padding: 40px 36px; box-shadow: 0 24px 60px rgba(15, 23, 42, .08);
  display: flex; flex-direction: column; gap: 16px; justify-content: center;
}
.login-card h2 { margin: 0; font-size: 26px; font-weight: 700; color: #1f2937; }
.lc-sub { margin: -8px 0 6px; font-size: 13px; color: var(--muted); }
.lc-field { display: flex; flex-direction: column; gap: 7px; }
.lc-label { font-size: 12.5px; color: #6b7280; }
/* 与登录按钮同宽：通用 .input 有 max-width:240px，不解除就会被卡窄 */
.lc-field .input { width: 100%; max-width: none; height: 46px; border-radius: 12px; }
.lc-field .input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(16, 185, 129, .14); outline: none; }
/* 验证码：输入框 + 图片同行，图片可点击刷新 */
.lc-captcha { display: flex; gap: 10px; align-items: stretch; }
.lc-captcha .input { flex: 1; min-width: 0; }
.lc-captcha-img {
  flex: 0 0 130px; height: 46px; padding: 0; border: 1px solid var(--border, #d1d5db);
  border-radius: 12px; background: #f8fafc center/cover no-repeat; cursor: pointer;
  overflow: hidden; transition: border-color .15s;
}
.lc-captcha-img:hover { border-color: var(--accent); }
.lc-captcha-img:not(.loaded)::after { content: '点击获取'; font-size: 12px; color: #9aa0a6; }
.lc-remember { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.lc-remember input { width: 14px; height: 14px; accent-color: var(--accent); }
.login-card .btn { width: 100%; justify-content: center; height: 46px; margin-top: 2px; font-size: 15px; font-weight: 600; border-radius: 12px; }
.login-agree { font-size: 11.5px; color: #9aa0a6; text-align: center; }
.login-err { color: #dc2626; font-size: 12.5px; min-height: 16px; }

@media (max-width: 1000px) {
  .login-page { grid-template-columns: minmax(0, 420px); justify-content: center; gap: 0; }
  .login-side { display: none; }
}
@media (max-height: 760px) {
  .login-side { min-height: 440px; padding: 32px 36px; }
  .ls-body h1 { font-size: 28px; }
  .login-card { padding: 28px 28px; gap: 12px; }
}

.form-row { display: flex; flex-wrap: wrap; gap: 10px; }
.form-row .input { flex: 1 1 150px; }
.form-row .btn { flex: 0 0 auto; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text); }
textarea.input { width: 100%; resize: vertical; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.55; }
.table-wrap { overflow-x: auto; }
table td .btn { padding: 3px 8px; font-size: 11.5px; }

/* 等待大模型首字的占位反馈：只转圈看不出在干什么，要有动作感 */
.msg.thinking {
  align-self: stretch; display: inline-flex; align-items: center; gap: 9px;
  padding: 6px 2px; background: transparent; border: 0; box-shadow: none;
  color: var(--muted); font-size: 14.5px;
}
.tdot { width: 7px; height: 7px; border-radius: 50%; background: #c3c9cf;
  animation: td-bounce 1.2s infinite ease-in-out; }
.tdot:nth-child(2) { animation-delay: .15s; }
.tdot:nth-child(3) { animation-delay: .3s; }
@keyframes td-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .45; }
  40% { transform: translateY(-5px); opacity: 1; }
}

/* 流水线：副标题转 + 未开工的工序（让用户一开始就知道还有多少步） */
.ed-pipe-sub.running::before {
  content: '⟳'; display: inline-block; margin-right: 6px; color: var(--accent);
  animation: ed-spin 1s linear infinite;
}
.ed-pstep-flag.running { color: var(--accent); }
.ed-pstep-flag.running::before {
  content: '⟳'; display: inline-block; margin-right: 4px;
  animation: ed-spin 1s linear infinite;
}
/* 已完成的工序：状态打上主题色渐变，一眼看出这条走完了 */
.ed-pstep.done .ed-pstep-flag {
  background: linear-gradient(135deg, #6ee7b7, var(--accent, #10b981));
  color: #fff; border-radius: 999px; padding: 2px 10px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}

/* 对话内图表 */
.msg.tool-charts {
  align-self: flex-start; max-width: 82%; width: 100%; background: transparent;
  border: none; box-shadow: none; padding: 0; display: flex; flex-direction: column; gap: 14px;
}
.chart-box {
  background: var(--panel); border: 0; border-radius: 14px;
  padding: 14px 16px; box-shadow: var(--shadow);
}
.chart-title { font-size: 12.5px; color: #4b5563; font-weight: 650; margin-bottom: 8px; }
.chart-unit { font-size: 11px; color: #9ca3af; margin-top: 4px; text-align: right; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: #6b7280; }
.chart-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }
.chart-donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.chart-donut { width: 150px; height: 150px; border-radius: 50%; position: relative; flex: 0 0 150px; }
.chart-donut::after { content: ""; position: absolute; inset: 30px; background: #fff; border-radius: 50%; }
.chart-donut-center {
  position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; text-align: center;
}
.chart-donut-center b { font-size: 17px; }
.chart-donut-center span { font-size: 10.5px; color: #9ca3af; display: block; }
.chart-hbars { display: flex; flex-direction: column; gap: 8px; }
.chart-hbar { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.chart-hbar .lbl { width: 130px; color: #4b5563; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-hbar .track { flex: 1; height: 18px; border-radius: 6px; background: #f5f7f6; overflow: hidden; }
.chart-hbar .track i { display: block; height: 100%; border-radius: 6px; min-width: 2px; }
.chart-hbar .val { width: 80px; text-align: right; color: #6b7280; font-variant-numeric: tabular-nums; }

/* 输入区：大圆角容器，内部不设底色与线条，工具行融在同一块面板里 */
.composer { width: 100%; max-width: 720px; margin: 6px auto 0; padding: 0; }
.composer-box {
  /* 交互框不再有底色与描边（文件末尾「减线之后」那一节统一规定）：
     以前是「浅灰盒子 + 阴影」，全站去掉描边后这里跟着去掉，
     输入区靠 ✨、占位符与发送键站住位置。落文件时的浅绿底见 .composer-box.drag */
  background: transparent;
  border: 0; border-radius: 26px;
  box-shadow: none; transition: box-shadow .18s, background .18s;
}
.composer-box:focus-within { box-shadow: none; }
/* 文件拖到输入框上就给个落点反馈：工作区不再有单独的上传面板 */
.composer-box.drag {
  border-color: var(--accent); background: #e7f8f1;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, .12);
}
/* 输入区：参考稿是「左上角 ✨ + 占位符」的多行输入，下面一行胶囊按钮 */
.composer-input { position: relative; }
.ci-spark {
  position: absolute; top: 16px; left: 17px; font-size: 15px;
  opacity: .7; pointer-events: none; filter: grayscale(.15);
}
.composer textarea {
  display: block; width: 100%; resize: none; min-height: 56px; max-height: 220px;
  padding: 12px 18px 6px 44px; border: 0; background: transparent; color: var(--text);
  font: inherit; font-size: 14.5px; line-height: 1.6; outline: none;
}
/* 入口页（还没说话）保留参考稿的多行大输入；进了对话就收窄，别占内容区 */
#view-chat:not(:has(.msg.user, .msg.assistant)) .composer textarea { min-height: 96px; }
.composer textarea::placeholder { color: #9aa3ad; }
.composer-bar { position: relative; display: flex; align-items: center; gap: 8px; padding: 6px 14px 14px 14px; }
.cb-spacer { flex: 1; }
/* 附件键默认隐藏、不占位：工作台与用电数据首页的交互框不收附件，左端留空。
   只有能源单据页露出这颗键（见 #view-bill_land .ci-attach），那一页挂文件是正事。
   键上不写字：一颗回形针，说明收回悬停提示，跟发送键同一做法。
   文件通道全站只有同一条（#file-input → uploadFiles） */
.ci-attach { display: none; align-items: center; justify-content: center;
  width: 32px; height: 32px; margin-left: -8px; padding: 0;
  border: 0; border-radius: 9px; background: none; cursor: pointer;
  color: #6b7280; transition: .15s; }
.ci-attach svg { width: 16px; height: 16px; }
.ci-attach:hover { color: var(--text); background: var(--bg, #f5f6f8); }
/* 能源单据页露这颗键：这一页挂文件是正事——
   只靠拖进输入框的话，第一次进来的人不知道文件从哪儿进。
   这一列的 .composer-bar 内缩 12px、正文左边的 ✦ 标识在 14px：
   往左挪 6px 让 16px 的回形针落在同一条线上 */
#view-bill_land .ci-attach { display: inline-flex; margin-left: -6px; }
/* 发送：圆形实心按钮 + 向上箭头，同参考稿（键上不写字，说明放悬停提示） */
.send-btn {
  width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%;
  background: #17181a; color: #fff; font: inherit;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: .15s;
}
.send-btn svg { width: 16px; height: 16px; }
.send-btn:hover { background: #000; transform: translateY(-1px); }
.send-btn:disabled { opacity: .45; cursor: default; transform: none; }
/* 巡检第一屏那一按起的是任务，不是回话：用主色把这一下说清楚 */
.send-btn.is-run { background: var(--accent); }
.send-btn.is-run:hover { background: var(--accent-2); }

/* 「这一条任务交给谁」：胶囊 + 向上展开的下拉（对话框贴在页面下半部，往下开会顶出屏幕）。
   下拉里五行只有名字，选中项靠左边的勾和一层灰底区分，不靠主色，也不再另配一句说明 */
.cb-agent { position: relative; }
.agent-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px;
  border: 0; border-radius: 999px; background: #fff; color: #3c4450;
  font: inherit; font-size: 12.5px; font-weight: 550; line-height: 1; cursor: pointer; transition: .15s;
}
.agent-pill svg { width: 14px; height: 14px; }
.agent-pill:hover { background: var(--bg, #f5f6f8); color: var(--text); }
.cb-agent-pop {
  position: absolute; right: 0; bottom: calc(100% + 8px); width: 232px; z-index: 60;
  background: #fff; border: 0; border-radius: 12px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, .16); padding: 8px;
}
.cb-agent-pop[hidden] { display: none; }
/* 勾在名字前头，没选中的行也留着这一格宽：五行文字才在同一条起笔线上 */
.agent-item { display: flex; align-items: center; gap: 9px; width: 100%;
  border: 0; background: none; text-align: left; cursor: pointer;
  padding: 10px 12px; border-radius: 9px; font-size: 13.5px; color: var(--text); }
.agent-item svg { width: 15px; height: 15px; color: currentColor; flex: 0 0 15px; }
.agent-item:not(.active) svg { visibility: hidden; }
.agent-item:hover { background: var(--bg, #f7f8fa); }
.agent-item.active { background: var(--panel-2, #f2f3f5); }
/* 入口大标题里的标识：与 26px 标题字号对齐 */
.hero h1 svg { vertical-align: -3px; }

/* ---------- 四个主页的输入框：附图那套「立起来的白卡」 ----------
   #composer 是工作台 / 智能问答 / 四个 Agent 首页共用的同一个节点，
   进主页时脚本挂上 is-hero（app.js mountChatNodes），离开就摘掉：
   对话页与 Agent 工作页还是原来那套无底框，只有这一屏把「说一句」当主角，
   需要一张卡把它托住。主页交互框不收附件（附件键只在能源单据页露出），
   传单据去能源单据页挂文件或拖进那一页的输入框。
   卡面上的文字只有一条左起笔：正文靠 textarea 的 18px，底行那一排也按 18px 内缩，
   右端同理——不然附件图标和上面的话会错开一小截，看着像没对齐。 */
.composer.is-hero .composer-box {
  background: var(--panel); border: 0; border-radius: 20px;
  box-shadow: var(--shadow);
}
.composer.is-hero .composer-box:focus-within { box-shadow: var(--shadow-lg); }
/* 落文件的反馈在卡面上要看得见：整块换成浅绿底，比原来那圈描边更像「放这里」 */
.composer.is-hero .composer-box.drag { background: #e7f8f1; box-shadow: 0 0 0 3px rgba(16, 185, 129, .14); }
/* 附图的占位符从卡片左上角起笔，不再给 ✨ 让出那 44px */
.composer.is-hero .ci-spark { display: none; }
.composer.is-hero textarea { min-height: 96px; padding: 16px 18px 6px; }
.composer.is-hero .composer-bar { padding: 6px 18px 12px; }
/* 右端照附图是「一行字 + 圆形发送键」：Agent 选择不涂胶囊底，靠文字和箭头站住 */
.composer.is-hero .agent-pill {
  height: 32px; background: none; color: #6b7280; font-weight: 500;
}
.composer.is-hero .agent-pill:hover { background: none; color: var(--text); }
/* 固定态（app.js pinnedAgent() 判定后挂 is-fixed）：四个 Agent 的页面里这颗只报名字——
   caret 不画、鼠标过去不给反馈、点了不冒菜单。要换 Agent 只有左边导航那一格 */
.agent-pill.is-fixed { cursor: default; }
.agent-pill.is-fixed svg { display: none; }
.agent-pill.is-fixed:hover { background: #fff; color: #3c4450; }
.composer.is-hero .agent-pill.is-fixed:hover { background: none; color: #6b7280; }

/* 主页的快捷问法：附图那套「图标 + 一句话」的圆角片，四个入口共用这一份规格
   （工作台 .try-row / 优化 .fxl-chip / 巡检 .edl-chip / 核算 .cal-chip，
   横排居中、放不下自动换行）。
   巡检追问那一排 .edl-asks 不并进来——它贴在输入框上方，字号与留白另算。
   卡片是白底 + 软阴影，和主页输入框同一档，不描边 */
.home-try, .fxl-chips, .edl-chips.edh-chips, .cal-chips {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; padding: 0;
  justify-content: center;
}
.home-try .try-row, .fxl-chips .fxl-chip, .edl-chips.edh-chips .edl-chip,
.cal-chips .cal-chip {
  display: inline-flex; align-items: center; gap: 8px;
  border: 0; border-radius: 12px; background: var(--panel); box-shadow: var(--shadow);
  padding: 8px 14px; font: inherit; font-size: 13px; color: #4b5563;
  text-align: left; cursor: pointer; transition: color .15s, box-shadow .15s, transform .15s;
}
.home-try .try-row:hover, .fxl-chips .fxl-chip:hover,
.edl-chips.edh-chips .edl-chip:hover, .cal-chips .cal-chip:hover {
  background: var(--panel); color: var(--accent-2);
  box-shadow: var(--shadow-lg); transform: translateY(-1px);
}
.qc-ico { width: 15px; height: 15px; flex: 0 0 15px; color: var(--muted); }
.home-try .try-row:hover .qc-ico, .fxl-chips .fxl-chip:hover .qc-ico,
.edl-chips.edh-chips .edl-chip:hover .qc-ico,
.cal-chips .cal-chip:hover .qc-ico { color: var(--accent-2); }

/* 任务向导：对象 → 周期 → 范围 → 执行。
   外层 .msg.task 必须覆盖聊天气泡的 pre-wrap 与 78% 限宽，
   否则模板字符串里的换行会把卡片撑成一条细柱。 */
.msg.task { align-self: stretch; max-width: min(780px, 100%); background: transparent;
  border: 0; box-shadow: none; padding: 0; white-space: normal; }
.task-card { border: 0; border-radius: 14px;
  background: var(--panel, #fff); padding: 16px 18px;
  box-shadow: var(--shadow); }
.task-head { display: flex; align-items: center; gap: 8px; font-size: 14.5px; }
.task-ico { font-size: 17px; }
.task-badge { margin-left: auto; font-size: 11px; padding: 2px 10px;
  border-radius: 999px; background: #f1f2f4; color: var(--muted); flex: none; }
.task-badge.run { background: #eef4ff; color: #2563eb; }
.task-badge.ok { background: #ecfdf5; color: #059669; }
.task-badge.bad { background: #fef2f2; color: #c0392b; }
.task-goal { margin: 10px 0 16px; font-size: 12.5px; color: var(--muted);
  border-left: 3px solid var(--line); padding: 2px 0 2px 10px; }

/* 任务卡的模型理解条：一句话 → 期间/对象/工序三项预选，每项标来路。
   没被判断出来的那项写「未定 · 默认项」，不让人把默认值当成模型识别的结果 */
.task-pilot { margin: -8px 0 16px; padding: 9px 12px; border: 0;
  border-radius: 10px; background: #f8fafc; font-size: 12.3px; }
.pilot-h { display: flex; align-items: center; gap: 8px; }
.pilot-tag { font-weight: 600; }
.pilot-ways { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.pilot-way { border: 0; background: #fff; border-radius: 8px;
  padding: 3px 9px; }
.pilot-way b { font-weight: 600; margin-left: 2px; }
.pilot-way i { font-style: normal; color: var(--muted); font-size: 11px; margin-left: 5px; }
.pilot-way.off { opacity: .55; }
.pilot-say { margin-top: 7px; }
.pilot-warn { margin-top: 6px; color: #b45309; }
.pilot-tip { margin-top: 6px; color: var(--muted); font-size: 11.5px; }

/* 步骤时间线：左侧圆点 + 竖线把三步串成一条流程 */
.task-flow { display: flex; flex-direction: column; }
.task-step { position: relative; padding: 0 0 18px 28px; }
.task-step::before { content: ''; position: absolute; left: 8px; top: 22px; bottom: 2px;
  width: 2px; background: var(--border); }
.task-step:last-child { padding-bottom: 2px; }
.task-step:last-child::before { display: none; }
.task-step.done::before { background: #16a34a; }
.task-no { position: absolute; left: 0; top: 0; width: 18px; height: 18px;
  border-radius: 50%; background: #f1f2f4; color: var(--muted); font-size: 11px;
  display: inline-flex; align-items: center; justify-content: center; }
.task-step.now .task-no { background: var(--accent); color: #fff;
  box-shadow: 0 0 0 3px rgba(16, 163, 74, .12); }
.task-step.done .task-no { background: #16a34a; color: #fff; }
.task-step.pending { opacity: .45; }
.task-step-h { display: flex; align-items: baseline; gap: 8px; font-size: 13px;
  min-height: 18px; }
.task-step.now .task-step-h { font-weight: 600; }
.task-step.done .task-step-h b { font-weight: 600; }
.task-hint { color: var(--muted); font-size: 11.5px; font-weight: 400; }
.task-edit { margin-left: auto; border: 0; background: none; cursor: pointer;
  color: var(--accent); font-size: 11.5px; }
.task-edit:hover { text-decoration: underline; }
.task-back::before { content: '← '; }
.task-opts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.task-opt { position: relative; display: flex; flex-direction: column; gap: 2px;
  border: 0; background: #fff; border-radius: 10px;
  padding: 9px 14px; cursor: pointer; text-align: left; font-size: 13px;
  transition: border-color .15s, box-shadow .15s, transform .15s; }
.task-opt:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(0, 0, 0, .07);
  transform: translateY(-1px); }
.task-opt .task-sub { color: var(--muted); font-size: 11px; }
.task-rec { position: absolute; top: -9px; right: 8px; background: var(--accent);
  color: #fff; font-size: 10px; border-radius: 6px; padding: 1px 6px; }
.task-loading { font-size: 12.5px; color: var(--muted); padding: 2px 0 8px; }
.task-flow.locked { opacity: .55; pointer-events: none; }

.task-confirm { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 12px;
  display: flex; flex-direction: column; gap: 10px; }
.task-sum { font-size: 12.5px; color: var(--muted); }
.task-sum b { color: #111; }
.task-confirm .btn.primary { align-self: flex-end; }
.task-scope { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.task-run:not(:empty) { margin-top: 14px; border-top: 1px dashed var(--border); padding-top: 12px; }

/* 报告下方出口：重新诊断 / 审核入库 */
.task-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.task-mem { font-size: 11.5px; margin-top: 6px; text-align: right; }
.attach-chip .chip-act { border: 0; background: none; color: var(--accent-2, #0ca678);
  font-size: 11px; cursor: pointer; padding: 0 2px; }
.attach-chip .chip-act:disabled { color: var(--muted); cursor: default; }

/* 诊断结论区：跑完直接摊开在按钮上方，「查看结论」只负责把人带到这儿 */
.ed-concl { border: 0; border-radius: 12px; padding: 10px 12px;
  background: #fff; margin-top: 14px; }
.ed-concl-h { font-size: 12.5px; font-weight: 650; margin-bottom: 6px; }
.ed-concl-row { display: flex; gap: 8px; font-size: 12px; line-height: 1.65; padding: 3px 0; }
.ed-concl-row b { flex: none; font-weight: 600; color: var(--text); }
.ed-concl-row span { color: var(--muted); }
.ed-concl.flash { box-shadow: 0 0 0 2px var(--accent-2); }

/* 本轮发现的问题 + 定向追问：问题来自报告接口，问法就是人常问的那几句 */
.ed-issues { border: 0; border-radius: 12px; padding: 10px 12px;
  background: #fff; margin-top: 10px; }
.ed-issue { border-top: 1px dashed var(--border); padding: 8px 0 2px; }
.ed-issue:first-of-type { border-top: 0; }
.ed-issue-h { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.ed-issue-h .ed-badge { margin-left: auto; flex: none; }
.ed-issue-d { font-size: 11.5px; color: var(--muted); line-height: 1.6; margin: 2px 0 6px; }
.ed-issue-ask { display: flex; flex-wrap: wrap; gap: 6px; }
/* 报告页的「完整报告」：点了才跑，正文落在下面这块 */
#edr-full .edr-sec-t { display: flex; align-items: center; gap: 8px; }
#edr-full .edr-sec-t .ck-spacer { flex: 1; }
#edr-full-tip { font-size: 11.5px; margin-bottom: 8px; }
.edr-full-body:empty { display: none; }
.task-rv { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 10px; padding: 8px 10px; border-radius: 8px;
  background: #eef4ff; font-size: 12px; color: #1e3a8a; }
.task-rv-tag { font-size: 11px; padding: 1px 8px; border-radius: 999px;
  background: #2563eb; color: #fff; flex: none; }
.task-rv .task-goto-rv { margin-left: auto; }
/* 任务卡里跑流水线：气泡这层不套了。灰底会把执行区从任务卡那一列里切出来，
   14px 内缩又让工序和上面的参数行错开；分组交给上面那条虚线和工序时间轴自己 */
.task-run .ed-msg { gap: 0; }
.task-run .ed-avatar { display: none; }
.task-run .ed-bubble { max-width: none; background: none; padding: 0; }
.scope-note { font-size: 11.5px; color: #92400e; background: #fffbeb;
  border-left: 3px solid #fcd34d; border-radius: 5px;
  padding: 5px 8px; margin: 6px 0; line-height: 1.5; }

/* 附件条是输入框盒子里的第一块内容：盒子自身不留内边距，这里给它一圈呼吸，
   否则胶囊会顶在圆角上；工作区不再有上传面板，附件只显示在这一处 */
.attach-bar { display: flex; flex-wrap: wrap; gap: 6px; }
.attach-bar:not([hidden]) { padding: 10px 12px 0; }
.attach-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px;
  border: 0; border-radius: 9px; background: #fff;
  font-size: 12px; max-width: 260px;
}
.attach-chip .chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-chip img { width: 26px; height: 26px; object-fit: cover; border-radius: 6px; }
.attach-chip .chip-ico { font-size: 14px; }
.attach-chip button {
  border: 0; background: none; cursor: pointer; color: var(--muted);
  font-size: 12px; padding: 0 2px; line-height: 1;
}
.attach-chip button:hover { color: #dc2626; }

/* ---------- Controls ---------- */
.btn {
  padding: 9px 14px; border-radius: 10px; border: 0;
  background: var(--panel); color: var(--text); cursor: pointer; font: inherit; transition: .15s;
}
.btn:hover { background: var(--panel-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: var(--shadow); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.danger { color: var(--danger); }
.input {
  padding: 8px 10px; border-radius: 10px; border: 0;
  background: var(--panel); color: var(--text); font: inherit; outline: none; max-width: 240px;
}
.input.grow { flex: 1; max-width: none; }
.input:focus { box-shadow: var(--shadow); }
select.input { appearance: auto; }

/* ---------- Cards ---------- */
.card { background: var(--panel); border: 0; border-radius: var(--radius); padding: 14px 16px; }
.card h3 { margin: 0 0 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
.card-list { display: flex; flex-direction: column; gap: 10px; }
.card-list .row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--panel); border: 0; border-radius: 12px; padding: 12px 14px;
}
/* 会话列表：整行（标题区）可点进会话，只有「清空」是独立动作。
   悬停给整行反馈，否则用户不知道这里能点。 */
.row-link { cursor: pointer; transition: background .12s, border-color .12s; }
.row-link:hover { background: #f7f9fc; }
.row-link .sess-main { flex: 1; min-width: 0; }
.sess-title {
  display: block; font-size: 13.5px; font-weight: 650; line-height: 1.5;
  margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sess-main .muted { font-size: 12px; }
/* 执行记录的归属标签：这一轮是谁跑的。只按会话 key 前缀认，认不出就不标 */
.sess-agent {
  flex: 0 0 auto; align-self: center; margin-left: 10px;
  font-size: 11.5px; color: var(--muted); background: var(--panel-2, #f2f3f5);
  border: 0; border-radius: 999px; padding: 3px 10px; white-space: nowrap;
}

/* ---------- 任务中心（工作管理）：四路任务汇成一列 ----------
   一行一个任务，浅灰底块 + 圆角，表面不描边（全站减线那一轮的口径）：
   标题行左标题右状态，第二行左 Agent 右时间，第三行说明，
   「查看任务」压在右下角——它是这一行唯一的动作，不做整行可点，
   免得人说「点哪儿都跳到同一页」却看不出这一行到底归谁。
   整列限宽 860：三栏下这一页铺到 1400px 时，标题与说明各占一行半，
   眼睛要从行尾走回行首才读得完下一行 */
.tc-list { max-width: 860px; display: flex; flex-direction: column; gap: 10px; }
.tc-row {
  border: 0; border-radius: 14px; padding: 14px 16px 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.tc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tc-title { font-size: 14px; font-weight: 650; line-height: 1.5; }
.tc-who { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--muted); }
.tc-who i { font-style: normal; font-variant-numeric: tabular-nums; }
.tc-desc { margin: 0; font-size: 12.5px; line-height: 1.65; color: #4b5563; }
.tc-foot { display: flex; justify-content: flex-end; }
/* 查看任务：文字链，不套按钮壳——它不是这一行的第二层结构 */
.tc-go {
  border: 0; background: none; padding: 0; cursor: pointer;
  font: inherit; font-size: 12.5px; color: var(--muted);
}
.tc-go:hover { color: var(--accent-2); }
/* 状态徽标：四档各一色，配色沿用巡检与核算自己那一页的徽标，不再开一套 */
.tc-st { flex: 0 0 auto; font-size: 11.5px; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.tc-st.ok { background: #e7f8f1; color: var(--accent-2); }
.tc-st.run { background: #eef4ff; color: #2563eb; }
.tc-st.warn { background: #fdf3e3; color: #b45309; }
.tc-st.bad { background: #fef2f2; color: #c0392b; }
/* 页签：照数据中心那一排的胶囊，选中给淡绿底，未选中不铺底 */
.tc-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tc-tab { border: 0; background: none; padding: 5px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: #4b5563; cursor: pointer; }
.tc-tab:hover { color: var(--accent-2); }
.tc-tab.on { background: #e7f8f1; color: var(--accent-2); }
.tc-tab.zero { opacity: .5; }
.tc-tab-n { margin-left: 6px; font-style: normal; font-size: 11px; opacity: .75; font-variant-numeric: tabular-nums; }
/* 哪一路读不到就说哪一路：另外三路照常显示，不拿空列表冒充「这个 Agent 没任务」 */
.tc-warn { font-size: 12px; color: #b45309; }
.tc-empty { padding: 6px 0; }
/* 图上这句副标题贴右：.view-header 是 space-between，三项会把中间那项顶到正中，
   所以自己吃掉左侧留白，让它和刷新键一起靠右 */
.tc-sub { align-self: flex-end; margin-left: auto; font-size: 12.5px; color: var(--muted); }

/* ---------- 执行记录：左列表 + 右详情（P0 同页分栏，不另开一页） ----------
   只有执行记录这一口径分栏：「记录」那一格列的就是这段对话本身，右栏没有内容可说。
   两列各自滚，列表几十上百条时右栏不会跟着跑出视线 */
.sc-split { display: flex; flex: 1; min-height: 0; gap: 16px; }
.sc-list { flex: 1; min-width: 0; overflow: auto; }
.sc-detail { display: none; }
.sc-split.is-task .sc-list { flex: 0 0 400px; }
.sc-split.is-task .sc-detail {
  display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 12px; overflow: auto;
}
.sc-split .row.sel { border-color: var(--accent); background: #f3fbf7; }
.sd-card { background: var(--panel); border: 0; border-radius: var(--radius); padding: 14px 16px; }
.sd-card .btn.tiny { margin-top: 8px; align-self: flex-start; }
.sd-hd { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.sd-hd-t { display: flex; gap: 8px; align-items: center; font-size: 15px; font-weight: 650; line-height: 1.5; }
.sd-who {
  flex: 0 0 auto; font-size: 11.5px; font-weight: 500; color: var(--accent-2);
  background: #e7f8f1; border-radius: 999px; padding: 2px 9px; white-space: nowrap;
}
.sd-hd-s { margin: 0; word-break: break-all; }
.sd-ttl { font-size: 12.5px; font-weight: 650; color: var(--muted); margin-bottom: 8px; }
.sd-hint p { margin: 4px 0 0; font-size: 13px; line-height: 1.7; }
.sd-goal { display: flex; gap: 8px; font-size: 13.5px; line-height: 1.6; }
.sd-goal b { flex: 0 0 auto; font-weight: 600; color: var(--muted); }
.sd-flow { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.sd-msg { border-left: 1px solid var(--line); padding: 2px 0 2px 10px; }
.sd-msg.ai { border-left-color: var(--accent); }
.sd-msg i { display: block; font-style: normal; font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.sd-msg p, .sd-md { margin: 0; font-size: 13px; line-height: 1.65; }
.sd-more { margin-top: 8px; }
.sd-rows { display: flex; flex-direction: column; gap: 6px; }
.sd-row {
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start; text-align: left;
  background: var(--panel-2); border: 1px solid transparent; border-radius: 10px;
  padding: 8px 10px; font: inherit; color: inherit; cursor: pointer;
}
.sd-row.is-static { cursor: default; background: transparent; border-color: var(--line); }
.sd-row:not(.is-static):hover { border-color: var(--accent); background: #f3fbf7; }
.sd-row-t { font-size: 13px; font-weight: 600; line-height: 1.5; }
.sd-row-s { font-size: 11.5px; color: var(--muted); }
.sd-note { margin-top: 8px; }
@media (max-width: 1120px) {
  .sc-split.is-task { flex-direction: column; overflow: auto; }
  .sc-split.is-task .sc-list { flex: 0 0 auto; overflow: visible; }
}
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.grid.two { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.stat { background: var(--panel); border: 0; border-radius: var(--radius); padding: 14px 16px; }
.stat .k { color: var(--muted); font-size: 12px; }
.stat .v { font-size: 18px; font-weight: 650; margin-top: 4px; word-break: break-all; }

.pre { margin: 0; white-space: pre-wrap; word-break: break-word; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.editor {
  flex: 1; min-height: 260px; padding: 14px; border-radius: var(--radius);
  border: 0; background: var(--panel); color: var(--text);
  font-family: "Cascadia Mono", Consolas, monospace; font-size: 13px; resize: vertical; outline: none;
}
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--muted); }

/* ---------- 图表 / 徽标 ---------- */
.chart { width: 100%; min-height: 180px; }
.bar { height: 8px; border-radius: 6px; background: var(--panel-2); overflow: hidden; margin-top: 4px; }
.bar i { display: block; height: 100%; border-radius: 6px; }
.badge {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px;
  background: var(--panel-2); color: var(--muted); border: 0;
}
.badge.ok { color: var(--accent-2); }
.badge.off { color: var(--warn); }

/* ---------- 感知：态势摘要 / 事件卡 / 卡内展开 ---------- */
.se-conn.ok { color: #0f7b52; } .se-conn.warn { color: #b45309; } .se-conn.bad { color: #b91c1c; }

/* 态势摘要：一行 */
.se-head .sh-item.warn .sh-value { color: #b45309; }
.se-head .sh-item.bad .sh-value { color: #b91c1c; }
.se-head .sh-item.muted .sh-value { color: #9ca3af; }
.se-head .sh-pending.bad { color: #b91c1c; }

/* 事件卡：标题 / 位置 / 推断标签 + 卡内展开 */
.se-ev.open { border-color: var(--accent); }
.se-ev.high { border-left: 4px solid #ef4444; }
.se-ev.medium { border-left: 4px solid #f59e0b; }
.se-ev.low { border-left: 4px solid #94a3b8; }
.se-st.handling { background: #fff7ed; color: #b45309; }
.se-st.closed { background: #eef7f1; color: #0f7b52; }
/* 展开的简版信息 */
.se-more-row.warn .mr-tag { background: #fff7ed; color: #b45309; }
.se-more-row .mr-text .muted { color: var(--muted); }
#se-copilot-drawer.open { display: block; }
/* 月度核算摘要 */
.sum-body { font-size: 12.8px; line-height: 1.7; }
.sum-head { display: flex; gap: 16px; flex-wrap: wrap; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.sum-head b { font-size: 14px; }
.sum-sec { margin-top: 10px; }
.sum-sec > .sl { color: var(--muted); font-size: 11.8px; margin-bottom: 2px; }
.sum-items { display: flex; gap: 12px; flex-wrap: wrap; }
.sum-handling { display: flex; flex-direction: column; gap: 3px; }
.sum-sign { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 8px; color: var(--muted); }
.sum-foot { margin-top: 8px; color: var(--muted); font-size: 11.8px; }
.sum-lock { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px;
  padding: 2px 9px; border-radius: 20px; background: #eef7f1; color: #0f7b52; border: 0; }

/* 上传单据弹窗 */
.upd-drop {
  border: 2px dashed var(--border); border-radius: 12px; padding: 24px; text-align: center;
  cursor: pointer; color: var(--muted); font-size: 13px; margin-top: 10px;
}
.upd-drop:hover, .upd-drop.over { border-color: var(--accent); background: #f5f8ff; color: var(--text); }
.upd-name { font-size: 12.5px; margin-top: 8px; }
.upd-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; font-size: 12.5px; }
.upd-note { font-size: 11.8px; color: var(--muted); margin-top: 10px; line-height: 1.6; }
.upd-result { margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 10px; font-size: 12.5px; }
.upd-result .kv { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.upd-result .kv b { font-weight: 640; }
.upd-missing { color: #b45309; font-size: 11.8px; margin-top: 4px; }

/* ---------- 碳核算：顶部期间下拉 + 四段流程 ---------- */
.acc-top { margin-bottom: 12px; }
.acc-top .input { min-width: 300px; }
.at-badge { font-size: 10.5px; padding: 1px 6px; border-radius: 20px; background: #f3f4f6; color: #6b7280; }
.at-badge.high { background: #fee2e2; color: #b91c1c; }

.acc-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* 页签：与诊断报告的 .edr-ev-tabbar 同一套视觉，下划线 + 徽标 */
.acc-tabbar { display: flex; gap: 16px; border-bottom: 1px solid var(--line); margin-bottom: 2px; }
.acc-tabbar .acc-tab { border: 0; background: none; padding: 8px 2px; font-size: 13px;
  cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.acc-tabbar .acc-tab:hover { color: var(--fg, #111827); }
.acc-tabbar .acc-tab.active { color: var(--fg, #111827); font-weight: 600;
  border-bottom-color: var(--accent-2, #10b981); }
.acc-tabbar .acc-tab-badge { font-style: normal; font-size: 11px; font-weight: 600;
  margin-left: 5px; padding: 1px 6px; border-radius: 999px;
  background: #fff7ed; color: #b45309; }
.acc-tabbar .acc-tab-badge.bad { background: #fee2e2; color: #b91c1c; }
.acc-pane { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.acc-pane[hidden] { display: none; }

.acc-bar { padding: 13px 16px; }
.acc-bar .ab-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.acc-bar .ab-title { font-size: 15px; font-weight: 700; }
.acc-bar .ab-pill { font-size: 11.5px; padding: 2px 9px; border-radius: 20px; background: var(--panel-2);
  border: 0; }
.acc-bar .ab-pill.warn { background: #fff7ed; color: #b45309; }
.acc-bar .ab-pill.bad { background: #fee2e2; color: #b91c1c; }
.acc-bar .ab-pill.ok { background: #eef7f1; color: #0f7b52; }
.acc-bar .ab-line { font-size: 12px; color: var(--muted); margin-top: 6px; }
.acc-bar .ab-note { font-size: 11.5px; color: var(--muted); margin-top: 5px; }

/* 异常卡 */
.acc-anom { border: 0; border-radius: 13px; background: var(--panel);
  box-shadow: var(--shadow); margin-bottom: 12px; overflow: hidden; }
.acc-anom.high { border-left: 4px solid #ef4444; }
.acc-anom.medium { border-left: 4px solid #f59e0b; }
.acc-anom.low { border-left: 4px solid #94a3b8; }
.acc-anom.ignored { opacity: .62; }
.an-head { padding: 13px 16px 8px; }
.an-title { font-size: 13.8px; font-weight: 680; }
.an-detail { font-size: 12.3px; color: var(--text); margin-top: 5px; line-height: 1.6; }
.an-impact { font-size: 12px; color: #b45309; margin-top: 5px; }
.an-kv { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 7px; }
.an-kv b { color: var(--text); font-weight: 620; }
.an-acts { display: flex; gap: 7px; flex-wrap: wrap; padding: 0 16px 13px; }
.an-reason { font-size: 11.5px; color: var(--muted); padding: 0 16px 12px; }

/* 核算行 */
.acc-row { border: 0; border-radius: 11px; padding: 11px 13px; margin-bottom: 8px;
  background: var(--panel); }
.acc-row.empty { border-style: dashed; }
.ar-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ar-name { font-size: 13.4px; font-weight: 660; }
.ar-cal { font-size: 12.5px; color: var(--muted); flex: 1; min-width: 0; }
.ar-cal b { color: var(--text); font-weight: 680; }
.ar-em { font-size: 14.5px; font-weight: 700; }
.ar-em small { font-size: 11px; font-weight: 500; color: var(--muted); }
.ar-acts { display: flex; gap: 6px; }
.ar-more { border-top: 1px dashed var(--border); margin-top: 9px; padding-top: 9px;
  display: flex; flex-direction: column; gap: 8px; }
.ar-sub { font-size: 11.5px; color: var(--muted); }
.ar-list { display: flex; flex-direction: column; gap: 5px; }
.ar-item { font-size: 12.2px; display: flex; gap: 8px; align-items: baseline; }
.ar-item .ai-name { flex: 1; min-width: 0; }
.ar-item .ai-meta { color: var(--muted); font-size: 11.5px; }
.ar-factor { font-size: 12px; background: var(--panel-2); border-radius: 9px; padding: 8px 10px; }
.ar-cands { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.ar-cand { font-size: 11.5px; padding: 3px 9px; border-radius: 7px; border: 0;
  background: var(--panel); cursor: pointer; }
.ar-cand:hover { border-color: var(--accent); }
.ar-cand.rec { background: #eef7f1; color: #0f7b52; }

/* 提交条 */
.acc-submit { padding: 13px 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.acc-submit .as-total { font-size: 20px; font-weight: 700; }
.acc-submit .as-total small { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.acc-submit .as-checks { display: flex; gap: 12px; flex-wrap: wrap; flex: 1; min-width: 0; font-size: 12px; }
.acc-submit .as-check { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); }
.acc-submit .as-check.ok { color: #0f7b52; }
.acc-submit .as-check.no { color: #b45309; }
.acc-submit .as-acts { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 能碳驾驶舱 ---------- */
/* ---------- 驾驶舱：经营总览（五块，一屏） ---------- */
#view-cockpit { overflow: hidden; }
.ov-top {
  display: flex; align-items: center; gap: 8px; padding: 2px 2px 8px;
  border-bottom: 1px solid var(--line); margin-bottom: 8px;
}
.ov-title { font-size: 14.5px; font-weight: 600; margin-right: 4px; }
.ov-top .input { width: auto; min-width: 112px; }
.ov-set { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.ov-set .input { width: 128px; min-width: 96px; }

.ov { display: grid; grid-template-rows: auto minmax(0, 3fr) auto; gap: 10px; height: 100%; min-height: 0; }
.ov-pane {
  background: var(--panel); border: 0; border-radius: 12px;
  padding: 10px 14px; min-height: 0; overflow: hidden;
}
.ov-qhead {
  display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600;
  color: var(--muted); margin-bottom: 8px;
}
.ov-qhead .muted { font-weight: 400; font-size: 11.5px; }
.ov-warn { color: #b45309; margin-left: 2px; }

/* ① 四张维度卡：白底 + 1px 浅灰边 + 8px 圆角；异常卡左侧 3px 橙条（不整卡变色） */
#ov-quad { background: transparent; border: 0; padding: 0; overflow: visible; }
.ov-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; height: 100%; }
.ov-card {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
  background: #fff; border: 0; border-radius: 8px; padding: 20px;
}
.ov-card.warn { border-left: 3px solid #f59e0b; padding-left: 17px; }
.ov-ct { font-size: 12px; color: #8f959e; letter-spacing: .12em; }
.ov-cv { font-size: 26px; font-weight: 700; color: #1f2329; line-height: 1.3; letter-spacing: -.01em; }
.ov-cv .ov-warn { font-size: 15px; margin-left: 4px; vertical-align: 2px; }
.ov-cd { font-size: 13px; color: #8f959e; display: flex; align-items: center; gap: 5px; }
.ov-cd.bad { color: #b91c1c; } .ov-cd.ok { color: #0f7b52; } .ov-cd.warn { color: #b45309; }
.ov-cdi { font-style: normal; font-size: 13px; line-height: 1.35; }
.ov-cf {
  font-size: 12px; color: #9aa0a6; margin-top: auto;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: help;
}

/* 图表容器：SVG 绝对定位铺满，按真实像素重绘，永远不被拉伸 */
.chart-box { position: relative; overflow: hidden; }
.chart-box > svg { position: absolute; inset: 0; display: block; }
/* 驾驶舱图表图例：● 实心 / ○ 空心 / ─ 虚线，13px 灰（用专属类，避开其它页图例规则） */
.ov-legend { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-size: 13px; color: #8f959e; padding-top: 9px; }
.ov-legend i { display: inline-block; margin-right: 6px; vertical-align: middle; }
.ov-legend .lg-dot { width: 9px; height: 9px; border-radius: 50%; }
.ov-legend .lg-dot.hollow { background: #fff; border: 1.5px solid; }
.ov-legend .lg-line { width: 12px; height: 0; border-top: 1px dashed #9aa0a6; }
.ov-legend .lg-line.fc { border-top-style: dashed; border-top-width: 1.5px; }

/* 统计周期切换：日 / 月 / 季 / 年 */
.ov-tabs { display: flex; gap: 2px; padding: 2px; background: var(--panel-2); border-radius: 8px; }
.ov-tabs .btn { border: 0; background: transparent; min-width: 34px; }
.ov-tabs .btn.active { background: var(--panel); border: 0; font-weight: 600; }

/* ② 趋势图通栏（原本与「需要处理的事」左右分栏，待办已移入新的问题发现页） */
.ov-trend-pane { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
/* 经营中心（P0）：一行四个数 + 一条待办清单，不做能源驾驶舱。
   数字用主色留白、待办按 level 上色，全页只有一个强调色 */
.oc-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.oc-kpi { display: flex; flex-direction: column; gap: 3px; min-width: 0;
  padding: 10px 12px; border: 0; border-radius: 10px; background: #fff; }
.oc-kt { font-size: 11.5px; color: var(--muted); }
.oc-kv { font-size: 19px; font-weight: 700; letter-spacing: .2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oc-ks { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oc-kpi.bad .oc-ks { color: #b42318; }
.oc-kpi.warn .oc-ks { color: #b54708; }
.oc-kpi.ok .oc-ks { color: #087443; }
/* 待办清单：一条一行，右侧写明点过去哪儿；超过 12 条只列前 12 条 */
#oc-todo { max-height: 214px; overflow: auto; }
.oc-tdrows { display: flex; flex-direction: column; gap: 6px; }
.oc-td { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 9px; background: #fff;
  font: inherit; text-align: left; cursor: pointer; transition: .15s; }
.oc-td:hover { border-color: var(--accent); background: #f6fdf9; }
.oc-td-lv { flex: 0 0 auto; font-size: 11px; padding: 1px 8px; border-radius: 999px;
  background: #f4f5f7; color: #667085; }
.oc-td-lv.high { background: #fef2f2; color: #b42318; }
.oc-td-lv.medium { background: #fff7ed; color: #b54708; }
.oc-td-lv.low { background: #f0f9ff; color: #175cd3; }
.oc-td-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.oc-td-main b { font-size: 12.5px; font-weight: 600; }
.oc-td-main i { font-style: normal; font-size: 11px; color: var(--muted); }
.oc-td-go { margin-left: auto; flex: 0 0 auto; font-size: 12px; color: var(--accent-2); }
@media (max-width: 900px) { .oc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* 图表吃掉全部剩余高度，无边框透明底（简洁：面板即容器） */
#ov-chart-box {
  flex: 1; min-height: 120px; margin-top: 2px;
  background: transparent; border: 0; border-radius: 0; padding: 0; box-shadow: none;
}
.ov-ttl { font-size: 13.5px; font-weight: 600; color: var(--text); }
.ov-ttl .muted { font-weight: 400; }
#ov-switch { margin-left: auto; display: flex; gap: 4px; }
#ov-switch .btn.active { background: var(--panel); border-color: var(--line); font-weight: 500; }

/* 协作页：问题发现 + 审核队列 */
.se-todo-wrap { margin-bottom: 14px; }
.sd-group { margin-bottom: 10px; }
.sd-gbar { display: flex; align-items: center; justify-content: space-between;
           background: #f2f3f5; border-radius: 8px; padding: 8px 14px;
           font-size: 13px; color: #3c4450; cursor: pointer; user-select: none; }
.sd-gbar:hover { background: #eceef1; }
.sd-gr { display: flex; align-items: center; gap: 8px; }
.sd-gn { font-size: 11px; color: #9aa3ad; }
.sd-caret { color: #9aa3ad; font-size: 11px; }
.sd-row { display: flex; align-items: flex-start; gap: 10px;
          padding: 10px 8px; border-bottom: 1px solid var(--line); cursor: pointer; }
.sd-row:last-child { border-bottom: 0; }
.sd-row:hover { background: #f7f8fa; border-radius: 8px; }
.sd-ico { flex: none; font-size: 14px; line-height: 1.5; }
.sd-main { flex: 1; min-width: 0; }
.sd-t1 { font-size: 13.5px; color: #1f2733; overflow: hidden;
         text-overflow: ellipsis; white-space: nowrap; }
.sd-t1 b { font-weight: 600; }
/* 协作页可点标题：点标题与点「查看」等价，所以要长得像能点 */
.sd-link { cursor: pointer; transition: color .15s; }
.sd-link:hover { color: var(--accent); text-decoration: underline; }
.sd-sep { color: #b6bdc7; margin: 0 5px; }
.sd-sub { color: #7b8494; font-size: 12px; }
.sd-t2 { font-size: 12px; color: #8b94a3; margin-top: 2px; overflow: hidden;
         text-overflow: ellipsis; white-space: nowrap; }
.sd-pill { flex: none; font-size: 11px; border-radius: 999px; padding: 2px 9px; margin-top: 1px; }
.sd-pill.sd-task { background: #e8f0fe; color: #1a5cd6; }
.sd-pill.sd-alert { background: #fdeef3; color: #c0357c; }
.sd-pill.sd-notice { background: #eef1f4; color: #5b6470; }
/* 报告页：月份分组 + 卡片网格（工件库样式） */
.rp-caret { color: #9aa3ad; font-size: 11px; }
.rp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
           gap: 18px; margin-top: 14px; }
/* ---- 柔性用电页（原生 Agent：对话为主，看板为辅） ---- */
.fx-agent { display: flex; flex-direction: column;
            border: 0; border-radius: 10px;
            background: #fff; padding: 10px 12px; margin-top: 8px; }
.fx-msgs { display: flex; flex-direction: column; gap: 10px;
           max-height: 52vh; min-height: 180px; overflow-y: auto;
           padding: 4px 2px 8px; }
.fx-msg { display: flex; }
.fx-msg-b { max-width: 88%; padding: 8px 12px; border-radius: 10px;
            font-size: 13.5px; line-height: 1.7; white-space: pre-wrap;
            word-break: break-word; }
.fx-msg-user { justify-content: flex-end; }
.fx-msg-user .fx-msg-b { background: var(--accent, #2563eb); color: #fff; }
.fx-msg-assistant .fx-msg-b { background: #f3f4f6; color: #111827; }
.fx-msg-assistant .fx-msg-b table { margin: 6px 0; font-size: 13px; }
.fx-msgs > .fx-msg:first-child .fx-msg-b { background: #eff6ff; color: #1e3a8a; }
/* 工具调用折叠卡：把 Agent 调了什么、工具回了什么摊开给人核对 */
.fx-tool { border: 1px dashed var(--border); border-radius: 8px;
           background: #fafafa; padding: 6px 10px; font-size: 12.5px; }
.fx-tool > summary { cursor: pointer; color: #374151; }
.fx-tool > summary .muted { margin-left: 6px; font-size: 11.5px; }
.fx-tool-pre { margin: 6px 0 0; max-height: 220px; overflow: auto;
               background: #fff; border: 0;
               border-radius: 6px; padding: 8px; font-size: 12px;
               white-space: pre-wrap; word-break: break-all; }
.fx-thinking { display: flex; align-items: center; gap: 4px;
               font-size: 12.5px; color: #6b7280; padding: 2px 4px; }
/* 输入区常驻列底：消息自己滚，dock 固定在下面，不跟着滚走 */
.fx-dock { flex: 0 0 auto; margin-top: 6px; padding-top: 8px;
           border-top: 1px solid var(--line); background: #fff; }
/* 快捷问题收成一行横着滚：竖着堆几行会把输入框顶出可视区，
   发话前先找框是这一列最烦的一件事 */
.fx-sug { display: flex; gap: 6px; margin: 0 0 8px;
          overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.fx-chip { flex: 0 0 auto; font-size: 12.5px; padding: 4px 10px;
           border-radius: 999px; border: 0;
           background: #f9fafb; color: #374151; cursor: pointer;
           white-space: nowrap; }
.fx-chip:hover { background: #eff6ff; }
/* .fx-row 本身是 wrap，这里要盖它：发送键被挤到下一行等于把输入区撑高一倍 */
.fx-row.fx-input-row { align-items: flex-end; flex-wrap: nowrap; margin-top: 0; }
.fx-input-row textarea { flex: 1 1 0; min-width: 0; resize: none; min-height: 66px;
                         max-height: 118px; overflow-y: auto;
                         /* 通用 .input 有 max-width:240px，不解除的话对话列再宽，
                            输入框也只长到 240，右边留一块按不动的空白 */
                         max-width: none; }
/* 免责小字收进角标：默认只占一行「ⓘ 数据口径」，点开才给全文 */
.fx-foot { font-size: 12px; margin-top: 6px; color: #6b7280; }
.fx-foot > summary { cursor: pointer; list-style: none;
                     display: inline-flex; align-items: center; gap: 5px; }
.fx-foot > summary::-webkit-details-marker { display: none; }
.fx-foot > summary:hover { color: #374151; }
.fx-foot-i { width: 14px; height: 14px; border-radius: 999px; flex: 0 0 auto;
             border: 0; font-size: 10px; font-style: normal;
             line-height: 13px; text-align: center; color: #6b7280; }
.fx-foot[open] > summary { margin-bottom: 3px; }
.fx-board { margin-top: 10px; border: 0;
            border-radius: 10px; background: #fff; padding: 8px 12px; }
.fx-board-h { display: flex; gap: 10px; align-items: baseline;
              cursor: pointer; font-size: 13px; font-weight: 600; }
/* 看板头一行就把「哪个任务、走到哪、下一步点什么」说完，不用翻开 */
.fx-board-tip { display: flex; align-items: baseline; gap: 6px;
                flex: 1 1 auto; min-width: 0; overflow: hidden;
                font-size: 12px; font-weight: 400; color: #6b7280; }
.fx-board-id { font-size: 11.5px; color: #9aa3ad; white-space: nowrap;
               max-width: 15ch; overflow: hidden; text-overflow: ellipsis; }
.fx-board-step { min-width: 0; overflow: hidden; white-space: nowrap;
                 text-overflow: ellipsis; }
/* 操作条：切任务 + 推进到下一步占第一行，后端允许的工序按钮整行走第二行。
   和工序按钮挤同一行时会把它们顶得满屏换行，主操作反而找不着 */
.fx-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
          margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }
.fx-bar .fx-row { flex: 1 1 100%; margin-top: 0; }
.fx-task-sel { flex: 0 0 auto; width: auto; min-width: 132px; max-width: 210px;
               font-size: 12px; padding: 4px 8px; }

/* ---- 柔性用电页 ---- */
.fx-row { display: flex; gap: 8px; align-items: center; margin-top: 8px;
          flex-wrap: wrap; }
.fx-row .input { flex: 1 1 auto; min-width: 180px; }
.fx-card { border: 0; border-radius: 10px;
           padding: 12px 14px; margin: 10px 0; background: #fff; }
.fx-card-h { font-size: 13px; font-weight: 600; margin-bottom: 8px;
             color: var(--fg, #111827); }
.fx-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 4px 16px; }
.fx-kv-r { display: flex; gap: 8px; font-size: 13px; padding: 2px 0; }
.fx-k { color: #6b7280; min-width: 96px; flex: 0 0 auto; }
/* 只在真的放不下时才断词：break-all 会把「电价」「tari f」从中间劈开，
   读起来像乱码 */
.fx-v { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
/* 时间窗口独占一行：它最长，塞进三列网格必然折成两段 */
.fx-win { display: flex; gap: 8px; font-size: 13px; padding: 2px 0 6px;
          margin-bottom: 6px; border-bottom: 1px dashed var(--border); }
.fx-win b { font-weight: 600; }
/* 分组行（数据源）：标签与内容同一行，窄了换行而不是从词中间断 */
.fx-grp { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
          font-size: 13px; padding: 2px 0 8px; margin-bottom: 6px;
          border-bottom: 1px dashed var(--border); }
/* 六路数据源各占一枚芯片：拼成一行会被窄列折断成「tari fff:」 */
.fx-src { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 auto; min-width: 0; }
.fx-src-i { display: inline-flex; align-items: center; gap: 4px;
            padding: 2px 4px 2px 8px; border: 0;
            border-radius: 6px; background: #f9fafb; font-size: 12.5px;
            white-space: nowrap; }
.fx-src-i i { font-style: normal; color: #4b5563; }
.fx-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.fx-li { font-size: 13px; line-height: 1.6; padding: 6px 8px;
         background: #f9fafb; border-radius: 6px; }
/* 柔性资源：一个主数 + 一排计数，再往下是列对齐的设备清单。
   原来五个数平铺成五格会把注意力摊平，设备行糊成一坨没法扫 */
.fx-res-sum { display: flex; align-items: baseline; gap: 8px 18px;
              flex-wrap: wrap; padding-bottom: 8px; margin-bottom: 6px;
              border-bottom: 1px dashed var(--border); }
.fx-res-big { display: flex; align-items: baseline; gap: 5px; }
.fx-res-big b { font-size: 24px; font-weight: 700; line-height: 1.1;
                color: var(--fg, #111827); }
.fx-res-big span { font-size: 12px; color: #6b7280; }
.fx-res-cnt { display: flex; align-items: baseline; gap: 4px 14px;
              flex-wrap: wrap; font-size: 12.5px; color: #6b7280; }
.fx-res-cnt b { font-weight: 600; color: var(--fg, #111827); }
.fx-res { display: flex; flex-direction: column; }
.fx-res-r { display: grid; align-items: baseline; gap: 4px 10px;
            grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1.3fr) auto;
            font-size: 12.5px; line-height: 1.6; padding: 5px 0;
            border-bottom: 1px solid var(--line); }
.fx-res-r:last-child { border-bottom: 0; }
.fx-res-id { min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.fx-res-t { min-width: 0; color: #4b5563; }
.fx-res-c { min-width: 0; }
.fx-res-f { display: inline-flex; align-items: baseline; gap: 6px;
            justify-self: end; white-space: nowrap; }
@media (max-width: 1500px) {
  /* 窄列里四列网格会挤成一团：标志位换到下一行，其余三列照旧对齐 */
  .fx-res-r { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.3fr); }
  .fx-res-f { grid-column: 1 / -1; justify-self: start; }
}
/* 状态徽标：颜色 + 文字，不单靠颜色区分 */
.fx-b { display: inline-block; padding: 1px 8px; border-radius: 999px;
        font-size: 12px; border: 1px solid transparent; white-space: nowrap; }
.fx-b.ok   { background: #ecfdf5; color: #047857; }
.fx-b.warn { background: #fffbeb; color: #92400e; }
.fx-b.bad  { background: #fef2f2; color: #b91c1c; }
.fx-b.info { background: #eff6ff; color: #1d4ed8; }
.fx-b.sim  { background: #f5f3ff; color: #6d28d9; }

/* ---------- 柔性用电：流程在对话里停下等人（补参数 / 审核 / 改参数重跑） ---------- */
.fx-human {
  margin-top: 10px; padding: 12px 14px; border: 1px solid var(--accent);
  border-radius: 10px; background: #f6fdf9;
}
.fx-human-h {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  margin-bottom: 10px; font-size: 13.5px;
}
.fx-human-h .muted { font-size: 12px; }
.fx-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
           gap: 10px 14px; }
.fx-form-row { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fx-form-row label { font-size: 12px; color: #4b5563; }
.fx-req { font-style: normal; font-size: 11px; color: var(--danger); }
.fx-in { width: 100%; }
.fx-act-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

/* ---------- 能效诊断：任务卡内的组织机构选择（园区 → 建筑）与审核区 ----------
   选项就摆在任务卡里：结论贴着过程，人改参数时看得见自己在改什么。 */
.ed-org { display: flex; flex-direction: column; gap: 8px; }
.ed-org select[size] { height: auto; min-height: 170px; padding: 4px 0; width: 100%; }
.ed-org select[size] optgroup { padding-top: 6px; font-style: normal;
  font-weight: 600; color: #6b7280; }
.ed-org select[size] option { padding: 5px 10px; font-size: 12.5px; }
.ed-org-sum { font-size: 12.5px; line-height: 1.7; padding: 8px 12px;
              border: 0; border-radius: 10px; background: #f9fafb; }
.ed-rv-box { display: flex; flex-direction: column; gap: 8px; }
.ed-rv-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.ed-note2.ok { background: #ecfdf5; color: #047857; }

/* 页签栏：交付页（按类型）与协作页（审批/问题）共用一套样式 */
.rp-tabs, .se-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 2px; }
.rp-tab, .se-tab { border: 0; background: #fff; color: #4b5563;
          border-radius: 999px; padding: 4px 12px; font-size: 12px; cursor: pointer; }
.rp-tab:hover, .se-tab:hover { border-color: var(--accent); color: var(--accent); }
.rp-tab.on, .se-tab.on { background: var(--accent); border-color: var(--accent); color: #fff; }
/* 页签上的计数：进页面就知道哪类有东西，不用逐个点开看 */
.rp-tab-n, .se-tab-n { margin-left: 6px; font-size: 11px; opacity: .7; font-variant-numeric: tabular-nums; }
.rp-tab.zero, .se-tab.zero { opacity: .5; }
/* 数据中心板块切换（数据源 / 单据 / 设备台账 / 数据集 / 报告）：
   比报告的类型页签重一档——它决定看哪一类东西，类型页签只是筛选 */
.dc-tabs { gap: 6px; margin: 12px 0 0; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.dc-tab { font-size: 12.5px; padding: 5px 14px; font-weight: 600; }
/* 四档数据资产共用一张只读表：字段规整、一眼看完，不做可编辑的第二套后台 */
.dc-card { padding: 0; overflow: auto; }
.dc-note { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 12px 0 8px; font-size: 12.5px; color: var(--muted); }
.dc-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.dc-table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 11.5px;
  padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.dc-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.dc-table tr:last-child td { border-bottom: 0; }
.dc-sub { margin-top: 2px; font-size: 11px; color: var(--muted); }

/* 数据源表单字段：新增数据源浮层（#dcs-mask）里的网格与点位输入。
   板块顶部只留「新增数据源」按钮那一行（.dcs-actions） */
.dcs-actions { display: flex; justify-content: flex-end; margin: 12px 0 2px; }
.dcs-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.dcs-grid label, .dcs-pts { display: flex; flex-direction: column; gap: 5px;
  font-size: 12px; color: var(--muted); }
.dcs-grid .input { max-width: none; }
.dcs-pts textarea { resize: vertical; min-height: 88px; font-family: inherit; }
#dcs-err { color: var(--danger); }
@media (max-width: 760px) { .dcs-grid { grid-template-columns: 1fr; } }
.dc-mono { font-variant-numeric: tabular-nums; color: #4b5563; }
.dc-st { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; white-space: nowrap; }
.dc-st.ok { background: #ecfdf3; color: #087443; }
.dc-st.bad { background: #fef2f2; color: #b42318; }
.dc-st.todo { background: #f4f5f7; color: #667085; }
/* 系统配置：三个页签共用一个页面，页签条下面是一条操作栏（说明 + 按钮） */
.cfg-bar { display: flex; align-items: center; gap: 10px; margin: 10px 0 12px; }
.cfg-bar .muted { margin-right: auto; font-size: 12.5px; }

/* 权限与租户：表单按字段竖排，别把六个控件挤在一行 */
.cfg-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 12px; margin-bottom: 12px; }
.cfg-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.cfg-field > span { font-size: 12px; color: var(--muted); }
.cfg-field-btn { justify-content: flex-end; }

/* 租户表：ID 徽章化、用户数计重、全称窄列省略，行 hover 提示可交互 */
#access-tenants tbody tr { transition: background .12s; }
#access-tenants tbody tr:hover { background: rgba(16,185,129,.04); }
#access-tenants td { vertical-align: middle; }
.tn-id { display: inline-block; padding: 1px 8px; border-radius: 999px;
         background: #f4f5f7; border: 0;
         font-size: 11.5px; color: #6b7280; }
.tn-count { display: inline-block; min-width: 22px; text-align: center;
            padding: 1px 7px; border-radius: 999px; font-size: 12px; font-weight: 600;
            background: rgba(16,185,129,.1); color: var(--accent); }
.tn-full { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tn-acts { white-space: nowrap; }
.tn-in { min-width: 150px; padding: 4px 8px; font-size: 12.5px; }

/* 碳核算任务卡：检查行 / 结果条形 / 报告节，与能效诊断卡同一套视觉 */
.task-total-l { font-size: 12.5px; color: var(--muted); }
.task-note { font-size: 12px; color: var(--muted); line-height: 1.6; }
.task-chk:last-child { border-bottom: none; }
.task-chk-ico.ok { background: rgba(16,185,129,.12); color: var(--accent-2); }
.task-chk-ico.warn, .task-chk-ico.bad { background: #fef3e2; color: #d97706; }
.task-chk-st.ok { color: var(--accent-2); }
.task-chk-st.warn, .task-chk-st.bad { color: #d97706; }
.task-rep-ico { font-size: 17px; }
.task-rep:hover { color: var(--accent); }
.task-kv > span { color: var(--muted); }
/* ---------------- 碳核算报告（原生交互） ---------------- */
.rp-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.rp-head > div:first-child { flex: 1; }
.rp-acts { display: flex; gap: 6px; }
.rp-sub { font-size: 12px; color: var(--muted); line-height: 1.7; }
.rp-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 12px 0; }
.rp-kpi { padding: 10px 12px; border: 0; border-radius: 10px; background: #f8f9fb; }
.rp-kpi span { display: block; font-size: 11.5px; color: var(--muted); }
.rp-kpi b { display: block; font-size: 19px; margin: 2px 0 1px; }
.rp-kpi i { font-style: normal; font-size: 11px; color: var(--muted); }
.rp-kpi.up b { color: #d97706; }
.rp-kpi.down b { color: var(--accent-2); }
.rp-hint { font-size: 11.5px; color: var(--muted); margin: -4px 0 12px; }
.rp-sec { font-size: 12.5px; font-weight: 600; margin: 16px 0 8px; }
.rp-sec .muted { font-weight: 400; margin-left: 8px; }
.rp-svg { width: 100%; height: 168px; display: block; }
.rp-gl { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 3; }
.rp-gl-t, .rp-xl { font-size: 10px; fill: var(--muted); }
.rp-gl-t { text-anchor: end; }
.rp-xl { text-anchor: middle; }
.rp-xl.on { fill: var(--accent-2); font-weight: 600; }
.rp-line { stroke: var(--accent-2); stroke-width: 2; }
.rp-pt { cursor: pointer; }
.rp-pt circle { fill: #fff; stroke: var(--accent-2); stroke-width: 2; }
.rp-pt.on circle { fill: var(--accent-2); }
.rp-bar { display: flex; height: 22px; border-radius: 6px; overflow: hidden; background: #eef0f3; }
.rp-seg { cursor: pointer; transition: opacity .15s; }
.rp-seg.s1 { background: #ef9a9a; }
.rp-seg.s2 { background: #90caf9; }
.rp-seg.s3 { background: #a5d6a7; }
.rp-seg.on { box-shadow: inset 0 0 0 2px rgba(17, 24, 39, .2); }
.rp-leg { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; font-size: 12px; }
.rp-lg { cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.rp-lg.on { background: rgba(17, 24, 39, .07); font-weight: 600; }
.rp-lg i { font-style: normal; color: var(--muted); }
.rp-srcs { border: 0; border-radius: 10px; overflow: hidden; }
.rp-src + .rp-src { border-top: 1px solid var(--line); }
.rp-src-h { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; font-size: 12.5px; }
.rp-src-h:hover { background: #f8f9fb; }
.rp-caret { color: var(--muted); width: 10px; }
.rp-nm { min-width: 84px; }
.rp-track { flex: 1; height: 6px; background: #eef0f3; border-radius: 3px; overflow: hidden; }
.rp-track i { display: block; height: 100%; background: var(--accent-2); }
.rp-src-h b { min-width: 62px; text-align: right; }
.rp-src-h i { font-style: normal; color: var(--muted); min-width: 96px; text-align: right; }
.rp-src-b { padding: 8px 12px 12px; background: #f8f9fb; border-top: 1px dashed var(--border); }
.rp-f { font-size: 12px; color: #374151; line-height: 1.9; }
.rp-alist { margin-top: 6px; }
.rp-a { display: flex; gap: 10px; padding: 4px 0; font-size: 11.5px; color: #4b5563; border-top: 1px dashed var(--border); }
.rp-a span:first-child { min-width: 76px; color: var(--muted); }
.rp-a span:nth-child(2) { flex: 1; }
.rp-a b { min-width: 62px; text-align: right; }
.rp-a i { font-style: normal; color: var(--muted); min-width: 120px; }
.rp-hls { display: flex; flex-direction: column; gap: 6px; }
.rp-hl { padding: 8px 10px; border: 0; border-radius: 8px; font-size: 12px; }
.rp-hl b { margin-right: 8px; }
.rp-hl span { color: var(--accent-2); }
.rp-hl i { display: block; font-style: normal; color: var(--muted); margin-top: 3px; }
.rp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.rp-q { font-size: 12px; color: #374151; line-height: 1.9; }
.rp-sign { display: flex; gap: 10px; flex-wrap: wrap; }
.rp-sg { padding: 4px 10px; border-radius: 999px; background: #f4f5f7; color: var(--muted); font-size: 11.5px; }
.rp-sg.ok { background: rgba(16, 185, 129, .12); color: var(--accent-2); }
.rp-empty { padding: 10px 0; font-size: 12px; color: var(--muted); }
.rp-clr { margin-left: auto; }

/* 结论徽标：可用 / 部分可用 / 不可用 —— 与问题严重度共用一套色 */
.rp-tag.ok { color: #047857; background: #ecfdf5; }
.rp-tag.warn { color: #b45309; background: #fffbeb; }
.rp-tag.no { color: #b91c1c; background: #fef2f2; }
/* 导出 PDF：只印报告本身，导航、工具条、其它视图全部让开 */
@media print {
  .sidebar, .topbar, .ck-bar, .acc-submit, .rp-acts, #acc-anomalies, .view-header,
  
  .view { display: none !important; }
  .view.active { display: block !important; }
  /* 核算页分了页签：打印只出「报告」，页签条本身和其余页签都让开。
     报告页签即便当前没被选中（带 hidden）也要强制显示，否则打印是空白。 */
  .acc-tabbar { display: none !important; }
  .acc-pane[data-acc-pane="work"], .acc-pane[data-acc-pane="anom"] { display: none !important; }
  .acc-pane[data-acc-pane="report"] { display: flex !important; }
  #acc-bar, #acc-rows { break-inside: avoid; }
  .rp-src-b { display: block !important; }
  .rp-kpis, .rp-grid { break-inside: avoid; }
}

/* 数据质量任务：体检过程按「调了什么工具」逐步展开，结论在下 */
.dq-run { margin-top: 10px; }
.dq-steps { display: flex; flex-direction: column; gap: 5px; }
.dq-step { font-size: 12px; padding: 6px 9px; border: 0;
  border-radius: 8px; background: var(--panel-2); }
.dq-step.ok { background: #f0fdf4; }
.dq-step b { margin-right: 8px; }
.dq-step-d { color: var(--muted); font-size: 11.5px; word-break: break-all; }
.dq-raw { margin-top: 4px; }
.dq-raw pre { max-height: 160px; overflow: auto; font-size: 11px;
  background: #fff; padding: 6px; border-radius: 6px; }
.dq-ans { margin-top: 10px; font-size: 13.5px; line-height: 1.75; white-space: pre-wrap; }
.dq-acts { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 12px; padding: 9px 12px;
  border-radius: 9px; background: #fffbeb; }
.dq-acts-t { flex: 1; min-width: 200px; font-size: 12.5px; color: #92400e; }

/* 用户/矩阵表格通栏：铺满卡片，别挤在半边 */
#view-config .table-wrap table { width: 100%; }

/* 新建/编辑用户弹框：两列字段，用户名占整行 */
.au-card { width: 520px; max-width: 94vw; }
.au-form { grid-template-columns: 1fr 1fr; }
.au-form .cfg-field:first-child { grid-column: 1 / -1; }
.au-card .input.ro { background: #f7f8fa; color: #6b7280; }
.au-hint { margin: 0; font-size: 12px; }

/* 用户行：头像 + 账号（显示名作为副标题），比两列分开更紧凑 */
.ac-who { display: flex; align-items: center; gap: 8px; }
.avatar-sm { width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%;
             background: linear-gradient(135deg, var(--accent), var(--accent-2));
             color: #fff; font-size: 12px; font-weight: 600;
             display: flex; align-items: center; justify-content: center; }
.ac-who-name { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.ac-who-name > .muted { font-size: 11.5px; }

/* 角色：表格里直接改，不能改的显示为标签 */
.role-sel { padding: 3px 6px; font-size: 12px; width: auto; min-width: 108px; }
.role-tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; border: 0; }
.role-tag.role-admin { background: #eef2ff; color: #3730a3; }
.role-tag.role-operator { background: #e7f8f1; color: var(--accent-2); }
.role-tag.role-viewer { background: #f4f5f7; color: #6b7280; }
.tag-me { margin-left: 5px; font-size: 11px; color: var(--accent-2); }
.perm-yes { color: var(--accent-2); font-weight: 700; }
.perm-no { color: #c3c8d0; }
/* 报告页：全量清单按列表显示（封面卡片一屏放不下几条，翻找太慢） */
.rp-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.rp-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px;
          border: 0; border-radius: 10px; background: var(--panel);
          cursor: pointer; transition: border-color .15s, background .15s; }
.rp-row:hover { border-color: var(--accent); background: var(--panel-2); }
.rp-row-ico { flex: none; width: 34px; height: 34px; border-radius: 9px;
              display: flex; align-items: center; justify-content: center;
              background: #f4f5f7; font-size: 16px; }
.rp-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rp-row-t { font-size: 13.5px; color: var(--text);
            overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-row-s { font-size: 11.5px; color: var(--muted);
            overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 行尾的审核状态：全量列出后，哪份能对外出具必须一眼可见。
   这里只定义 flex:none，颜色/字号统一走操作条那一套（同名规则只留一份，避免打架） */
.rp-state { flex: none; }
/* 审核页：复用行式列表，动作按钮成组右对齐 */
.rv-acts { flex: none; display: flex; gap: 6px; align-items: center; margin-top: 1px; }
.rv-row .sd-pill { margin-right: 2px; }
/* 问题发现：状态徽标 / 工单号 / 已闭环置灰 */
.iss-tk { margin-left: 6px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.iss-done { color: var(--muted); }
.iss-row.iss-closed { opacity: .68; }
.iss-row.iss-closed .sd-main b { font-weight: 400; }
.sd-pill.iss-open { background: #fdecec; color: #c0392b; }
.sd-pill.iss-handling { background: #fff4e0; color: #b26a00; }
.sd-pill.iss-closed { background: #e8f6ee; color: #1f8a4c; }
/* 处理结果弹层 */
.iss-mask { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center;
            background: rgba(17, 20, 24, .38); }
.iss-box { width: min(440px, calc(100vw - 32px)); background: var(--panel);
           border: 0; border-radius: 12px; padding: 16px;
           box-shadow: 0 18px 46px rgba(0, 0, 0, .22); }
.iss-title { font-size: 14px; font-weight: 600; }
.iss-sub { margin: 6px 0 10px; font-size: 12px; color: var(--muted); line-height: 1.5; }
.iss-box .input { width: 100%; }
.iss-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

/* 报告正文：不要框——不留圆角、不留阴影，靠白底和留白与页面区分 */
#rp-frame { width: 100%; height: calc(100vh - 150px); border: 0;
            border-radius: 0; background: #fff; box-shadow: none; }

/* 报告信息卡：元数据在 iframe 外、正文之上，信息与正文分层 */
#rp-meta { margin: 0 auto 12px; padding: 0 4px 12px; max-width: 1180px;
           border: 0; border-radius: 0; background: transparent; }
#rp-meta[hidden] { display: none; }
.rp-meta-hd { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.rp-meta-title { font-size: 15.5px; font-weight: 650; color: var(--ink); }
.rp-meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
                gap: 4px 22px; }
.rp-meta-k { font-size: 12px; color: var(--muted); }
.rp-meta-v { font-size: 12.5px; font-weight: 550; color: var(--ink); }
.rp-meta-v.st-approved { color: #15803d; }
.rp-meta-v.st-rejected { color: #b91c1c; }
.rp-meta-v.st-pending { color: #b45309; }

/* ---------- 报告：操作条 + 所见即所得编辑 ---------- */
/* 类名不能叫 .rp-bar / .rp-tag：这两个已被旧组件占用（分段条/结论徽标），
   同名规则会叠加生效——操作条之前就被旧规则的 height:22px 压扁再裁掉溢出 */
.rp-opbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
          padding: 9px 12px; margin-bottom: 10px; border: 0;
          border-radius: 10px; background: var(--panel); }
.rp-bar-meta { font-size: 12px; color: var(--muted); }
.rp-state { font-size: 11.5px; padding: 3px 9px; border-radius: 20px; font-weight: 600; }
.rp-state.st-approved { background: #e7f6ec; color: #1d7a3d; }
.rp-state.st-rejected { background: #fdeaea; color: #b42318; }
.rp-state.st-pending { background: #fff4e0; color: #a35a00; }
.rp-state.st-none { background: #eef0f3; color: #5c6470; }

/* 版本 / 正式版标记（.rp-vtag：.rp-tag 是旧结论徽标的类，不能撞） */
.rp-vtag { flex: none; font-size: 11px; padding: 2px 7px; border-radius: 5px;
           background: #eef0f3; color: #5c6470; white-space: nowrap; }
.rp-vtag.warn { background: #fff4e0; color: #a35a00; }
.rp-vtag.ok { background: #e7f6ec; color: #1d7a3d; }

.rp-editor { display: flex; flex-direction: column; gap: 8px; }
.rp-tb { display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
         padding: 7px 9px; border: 0; border-radius: 10px;
         background: var(--panel); position: sticky; top: 0; z-index: 2; }
.rp-tb-sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }
.rp-sel { height: 26px; border: 0; border-radius: 6px;
          background: var(--panel-2); color: var(--text); font-size: 12px; padding: 0 4px; }
/* 编辑纸面：刻意做成白纸的样子，让人一眼看出"这里改完就是发出去的那份" */
.rp-page { min-height: calc(100vh - 250px); background: #fff; border: 1px solid var(--line);
           border-radius: 12px; padding: 34px 38px; outline: none;
           box-shadow: 0 2px 10px rgba(0,0,0,.06);
           font: 14px/1.85 -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
           color: #1f2430; }
.rp-page:focus { border-color: var(--accent); }
.rp-page h1 { font-size: 21px; margin: 20px 0 10px; color: #1f4e79; }
.rp-page h2 { font-size: 17px; margin: 18px 0 8px; color: #1f4e79; }
.rp-page h3 { font-size: 14.5px; margin: 15px 0 6px; color: #1f4e79; }
.rp-page p, .rp-page div { margin: 0 0 8px; }
.rp-page ul, .rp-page ol { margin: 0 0 10px; padding-left: 24px; }
.rp-page table { border-collapse: collapse; width: 100%; margin: 12px 0; }
.rp-page th, .rp-page td { border: 1px solid var(--line); padding: 6px 10px;
                           text-align: left; font-size: 13px; }
.rp-page thead th { background: #f4f6f8; }
/* ③ 汇报摘要 */
.ov-sum-wrap { display: flex; align-items: center; gap: 10px; }
.ov-sum { flex: 1; min-width: 0; font-size: 13px; line-height: 1.5; }

.ck-spacer { flex: 1; }
.ck-gran { margin-left: auto; display: flex; gap: 4px; }

/* ---------- 设备详情：单设备工作台（五标签，只读，扁平通栏） ----------
   去掉卡片盒（背景/圆角/阴影/内边距），内容直接铺在页面上；devd-row 收成单列通栏，
   区块之间靠 pane/grid 的 12px gap 分隔。devd-card>b 用 inline-block 留出标题下距，
   同时保住「柔性能力」标题与右侧徽标同行。devd-grid 主数仍四列，devd-note 提示块保留。 */
#view-device.active { flex-direction: column; overflow: hidden; }

.devd { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; overflow: auto; }
.devd-head { padding: 2px 2px 0; }
.devd-crumb { font-size: 12px; margin-bottom: 8px; }
.devd-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.devd-sel { width: 200px; min-width: 0; padding: 5px 10px; font-size: 12.5px; }
.devd-title { margin: 0; font-size: 22px; font-weight: 700; color: var(--text); }
.devd-tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 3px 10px;
  border-radius: 999px; background: #f3f4f6; color: #6b7280; vertical-align: middle; }
.devd-tag.on { background: #e9f8f1; color: #079b6d; }
.devd-tag.warn { background: #fff5e9; color: #c88735; }
.devd-sub { font-size: 12.5px; margin-top: 8px; }

.devd-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.devd-tab { border: 0; background: none; padding: 11px 14px; font: inherit; font-size: 13px;
  color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; }
.devd-tab.active { color: var(--accent-2); border-color: var(--accent-2); font-weight: 600; }

.devd-pane { display: none; flex-direction: column; gap: 12px; }
.devd-pane.active { display: flex; }
.devd-card { background: none; border: 0; border-radius: 0; padding: 0; box-shadow: none; }
.devd-card > b { display: inline-block; margin-bottom: 4px; font-size: 13.5px; font-weight: 650; color: var(--text); }
.devd-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.devd-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.devd-row { display: grid; grid-template-columns: 1fr; gap: 12px; }
.devd-mlabel { font-size: 12px; color: var(--muted); }
.devd-mval { font-size: 24px; font-weight: 650; letter-spacing: -.5px; color: var(--text); margin: 6px 0 2px; }
.devd-mval small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.devd-msub { font-size: 11.5px; color: var(--muted); }
.devd-kv { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0;
  border-bottom: 1px solid var(--line); font-size: 12.5px; }
.devd-kv:last-child { border-bottom: 0; }
.devd-kv span:last-child { color: var(--text); text-align: right; }
.devd-qhead { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700;
  color: var(--text); margin-bottom: 8px; }
.devd-qhead .muted { font-weight: 400; font-size: 11.5px; }
.devd-chart { min-height: 120px; }
.devd-chart svg { display: block; }
.devd-note { background: #f0faf5; border-radius: 8px; padding: 11px 13px; color: #627b70;
  font-size: 12px; line-height: 1.7; margin-bottom: 6px; }
.devd-tbl { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 10px; }
.devd-tbl th, .devd-tbl td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); }
.devd-tbl th { color: var(--muted); font-weight: 500; }
.devd-empty { padding: 16px 4px; font-size: 13px; }
@media (max-width: 900px) {
  .devd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 点位补录 */
.dv-pt { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; flex: 1 0 100%; margin-top: 6px; }
.dv-pt-i { width: 64px; min-width: 56px; }

/* ---------- 负荷中心：版式镜像数据中心（ov-top + dc-tabs + dc-note + dc-card/dc-table）----------
   页面骨架与表格全部复用数据中心的 dc-* 类，这里只留添加表单字段与筛选条的专属样式。 */
.dvm-addgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.dvm-addgrid label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); }
.dvm-addgrid .input { max-width: none; }
.dvm-check { flex-direction: row !important; align-items: center; gap: 8px !important; color: var(--text) !important; }
#da-err { color: var(--danger); }

.dvm-filters { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.dvm-search { flex: 1; min-width: 180px; max-width: none; }
.dvm-flt { width: auto; min-width: 120px; max-width: none; }
@media (max-width: 900px) {
  .dvm-addgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .dvm-addgrid { grid-template-columns: 1fr; }
}

@media (max-width: 1180px) { .dev-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.chart-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); margin-top: 6px; flex-wrap: wrap; }
.chart-legend i { display: inline-block; width: 16px; height: 2px; vertical-align: middle; margin-right: 5px; }
.draft {
  margin-top: 10px; border: 1px dashed var(--border); border-radius: 12px; padding: 11px 13px;
  background: #fbfcfc; font-size: 12.5px;
}
.draft.reject { border-color: #fecaca; background: #fef7f7; }
.draft ul { margin: 6px 0 0; padding-left: 18px; }

@media (max-width: 1180px) { .dev-ops { grid-template-columns: 1fr; } }
.ops-card h3 { font-size: 13px; margin-bottom: 8px; }
.ops-row:last-child { border-bottom: 0; }
/* 右：AI 建议 */
.ai-card h3 { font-size: 13.5px; display: flex; align-items: center; gap: 7px; margin-bottom: 4px; }
.ai-tag { font-size: 11px; padding: 2px 8px; border-radius: 20px; background: #eef7f1; color: #0f7b52; }
.ai-tag.warn { background: #fff7ed; color: #b45309; } .ai-tag.bad { background: #fef2f2; color: #b91c1c; }
.ai-causes .rank { flex: 0 0 16px; height: 16px; border-radius: 5px; background: #eef4ff; color: #1d4ed8;
  font-size: 10.5px; display: grid; place-items: center; font-weight: 700; }
.ai-causes .ev { font-size: 11.5px; color: var(--muted); }
.ai-sugg .muted { font-size: 11.5px; margin-top: 3px; }
.btn.tiny { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); }
.table th { color: var(--muted); font-weight: 600; font-size: 12px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--accent); border: 1px solid var(--accent); color: #fff;
  padding: 10px 18px; border-radius: 10px; opacity: 0; pointer-events: none; transition: .2s;
  box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #dcdde1; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #c9cbd1; }
::-webkit-scrollbar-track { background: transparent; }

/* ========== 紧凑模式（矮屏）：必须放在文件最末尾，才能覆盖上面的基础规则 ========== */
@media (max-height: 940px) {
  .ov { gap: 7px; }
  .ov-pane { padding: 9px 12px; }
  .ov-cards { gap: 12px; }
  .ov-card { padding: 13px 15px; }
  .ov-card.warn { padding-left: 12px; }
  .ov-cv { font-size: 22px; }
  #ov-chart-box { min-height: 110px; }
  .ov-sum { font-size: 12.4px; }
}

/* ---------- 核算 Agent 原生卡片（任务书 4.2） ---------- */
/* 卡片由工具返回的真实业务数据渲染：内容来自核算服务，状态取自任务服务 */
.cb-cards { display: flex; flex-direction: column; gap: 10px; }
.cb-card {
  border: 0; border-radius: 12px;
  background: #fff; padding: 12px 14px; box-shadow: var(--shadow);
}
.cb-head { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 8px; }
.cb-mock {
  margin-left: auto; font-size: 11px; color: #8a6d00; background: #fdf3e0;
  border: 0; border-radius: 999px; padding: 2px 8px; white-space: nowrap;
}
.cb-body { font-size: 13px; }
.cb-kvs { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 2px 16px; }
.cb-kv {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 3px 0; border-bottom: 1px dashed #eef0f3;
}
.cb-kv span { color: var(--muted); white-space: nowrap; }
.cb-kv b { font-weight: 600; text-align: right; word-break: break-all; }
.cb-list { margin-top: 4px; }
.cb-li {
  display: flex; align-items: center; gap: 8px; padding: 4px 0;
  border-bottom: 1px dashed #eef0f3; font-size: 13px; flex-wrap: wrap;
}
.cb-li.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px; color: #3c4043; }
.cb-meta { font-size: 11.5px; color: var(--muted); padding: 0 0 4px; }
.cb-sub { margin: 8px 0 2px; font-size: 12px; color: var(--muted); font-weight: 600; }
.cb-tag { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: #f1f3f5; color: #5b6572; }
.cb-tag.ok { background: #e6f4ea; color: #1e7d34; }
.cb-tag.warn { background: #fdf3e0; color: #8a6d00; }
.cb-tag.bad { background: #fdecec; color: #b3261e; }
.cb-note {
  margin-top: 8px; font-size: 12.5px; color: #5b6572;
  background: #f7f8fa; border-radius: 8px; padding: 6px 9px;
}
.cb-note.warn { background: #fdf6e8; color: #7a5c00; }
.cb-note.bad { background: #fdecec; color: #b3261e; }
.cb-foot { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
/* 产出卡嵌进核算卡里就是第三层框：在 .cb-card 内脱掉描边，用分隔线分段。
   工作区里 .cb-card 自带框，两张产出卡是它内部的两段，不再各自描边 */
.cb-card .agxc, .cb-card .agvd {
  border: 0; border-radius: 0; background: none; padding: 0;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line);
}
.cb-card .agvd-side { padding-left: 16px; }
.cb-card > .cb-body > .agvd:first-child,
.cb-card > .cb-body > .agxc:first-child { margin-top: 0; padding-top: 0; border-top: 0; }

/* ---------- 三栏工作台：中栏自然语言交互 + 右栏流程/能力展示 ---------- */
.agx2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  align-items: start;
}
.agx-rail {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.agx-rail .card { padding: 14px; }
.agx-prog .panel-head { margin-bottom: 8px; }
.agx-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: agxstep;
}
.agx-steps li {
  counter-increment: agxstep;
  position: relative;
  padding: 7px 0 7px 30px;
  font-size: 12.5px;
  color: #6b7280;
}
.agx-steps li::before {
  content: counter(agxstep);
  position: absolute;
  left: 0;
  top: 6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #eef0f3;
  color: #6b7280;
  font-size: 11px;
  line-height: 20px;
  text-align: center;
  font-weight: 600;
}
.agx-steps li.active { color: #111418; font-weight: 600; }
.agx-steps li.active::before { background: #111418; color: #fff; }
.agx-steps li.done::before { background: #d9f2e5; color: #0f7b4f; content: "\2713"; }
.agx-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.agx-cards .quick-card { padding: 10px; }
.agx-cards .quick-card b { font-size: 12px; }
.agx-cards .quick-card span { font-size: 11px; }
/* 工作台（对话页）的右栏：ed-wrap 是 flex，直接给右栏定宽 */
.ed-wrap .agx-rail { width: 300px; flex: none; }
@media (max-width: 1200px) {
  .agx2 { grid-template-columns: 1fr; }
  .agx-rail { position: static; }
  .agx-cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* ---------- 工作台精简：分组折叠 / 顶栏 / 右栏要点 ---------- */
.fx-sec { margin-bottom: 10px; }
.fx-sec > summary {
  cursor: pointer;
  padding: 6px 0;
  font-size: 12.5px;
  font-weight: 600;
  color: #111418;
  list-style: none;
}
.fx-sec > summary::before { content: "\25B8  "; color: #6b7280; }
.fx-sec[open] > summary::before { content: "\25BE  "; }
.fx-sec[open] > summary { margin-bottom: 6px; }

/* 诊断工作台：对象与周期压成顶部一行 */
.ed-topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.ed-topbar .ed-b-ico { font-size: 15px; }
.ed-topbar .ed-b-name { font-weight: 600; }
.ed-topbar .ed-b-sub { font-size: 11.5px; }
.ed-topbar .ed-label { margin: 0; }
.ed-topbar select { min-width: 120px; }
.ed-wrap > .ed-main { flex: 1; min-width: 0; }

/* 碳核算工作台：右栏要点 + 折叠流转记录 */
.acc-kv {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 0;
  font-size: 12.5px;
  border-bottom: 1px dashed #f1f3f5;
}
.acc-kv:last-child { border-bottom: 0; }
.acc-kv span { color: #6b7280; }
.acc-kv b { font-weight: 600; }
.acc-rail-acts { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.ab-hist { margin-top: 4px; font-size: 11.5px; color: #6b7280; }
.ab-hist > summary { cursor: pointer; }

/* ---------- 全局顶栏（3AM 式） ---------- */
.g-topbar {
  flex: none;
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  height: 52px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.g-crumbs { font-size: 12.5px; color: #6b7280; white-space: nowrap; min-width: 0; }
.g-crumbs i { font-style: normal; margin: 0 7px; color: #c3c8d0; }
.g-crumbs b { color: #111418; font-weight: 600; }
/* 交付页当前 Agent 名：跟在面包屑后，带同样的分隔符（页面内不再有内置页头） */
.g-agent-crumb {
  font-size: 12.5px;
  font-weight: 600;
  color: #111418;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.g-agent-crumb::before {
  content: "/";
  font-weight: 400;
  color: #c3c8d0;
  margin: 0 7px;
}
/* 返回上一级：顶栏最左那颗，名字由 renderTopCrumbs 写成面包屑左边那一段。
   跟页面里的 .edl-back 是同一个意思、同一个样子，只是住在顶栏，所以矮一档 */
.g-back { display: inline-flex; align-items: center; gap: 6px;
  border: 0; border-radius: 999px; background: var(--panel-2);
  padding: 5px 12px; font: inherit; font-size: 12.5px; color: var(--muted);
  cursor: pointer; white-space: nowrap; transition: color .15s, background .15s; }
.g-back svg { width: 14px; height: 14px; flex: none; }
.g-back:hover { background: #e9ebef; color: var(--text); }
.g-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
/* 报告详情态：时钟/帮助/头像让位给「刷新/返回列表」——
   盯报告的时候这三个无关紧要，却占着最右上角 */
.g-right.rp-mode .g-clock,
.g-right.rp-mode .g-ico,
.g-right.rp-mode .g-user { display: none; }
.g-clock { font-size: 12px; color: #6b7280; }
.g-ico {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #4b5563;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.g-ico:hover { background: #f4f5f7; }
.g-user { position: relative; }
.g-pop { right: 0; left: auto; top: 36px; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }

/* 内容页自己的面包屑与全局面包屑重复，收掉（右侧的工作区/用户信息保留） */
.home-topbar .crumbs, .view-header .crumbs { display: none; }

/* 3AM 式小节标签：右栏卡片标题统一小号加粗带字距 */
.agx-rail .panel-head h3 {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  color: #8a919c;
}

/* 圆点状态徽章：● + 文字浅底，按状态配色（对齐 Proven/Observed 的表达） */
.ab-pill { position: relative; padding-left: 15px; }
.ab-pill::before {
  content: "\25CF";
  position: absolute;
  left: 4px;
  font-size: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: #9aa1ab;
}
.ab-pill.ok::before { color: #22a06b; }
.ab-pill.warn::before { color: #e5a13c; }
.ab-pill.bad::before { color: #d9564a; }


/* ---------- 首页简洁模式（默认页 = 交付页空态：问候语 + 同一个对话框） ---------- */
/* 默认页同样垂直居中：单个 flex 子项用 margin:auto 居中，矮屏时也不会裁顶 */
.home-wrap-clean { max-width: 720px; margin: auto; padding: 0 4px 24px; }
.home-wrap-clean .home-hero { padding-top: 0; }
/* 问候语与对话页 #hero-title 同口径（renderHeroTitle 一处生成两处渲染） */
.home-wrap-clean .home-title {
  margin: 0; font-size: 28px; line-height: 1.4; font-weight: 700; letter-spacing: .2px;
}
.home-wrap-clean .home-title b { font-weight: 720; }
/* 交付页 #composer 搬进来时的宿主与定位：与对话页空态同宽居中。
   跟副标题之间那 30px 也在这里给——工作台首页和用电数据首页共用这一格宿主，
   不再各按 view 的 id 写一份（那两页原来一个 30 一个 6，差出一档）。 */
.home-composer-host { width: 100%; }
.home-composer-host .composer { margin-top: 30px; }
/* 「你可以试试」：附图那套「图标 + 一句话」的圆角片，规格和优化、巡检两页的
   问法共用一份（见上面「四个主页的输入框」那一节）。
   点击切入口并把描述填进输入框（不自动发送）。工作台那三条每次进页随机抽，
   池子在 app.js 的 HOME_TRY；用电数据首页那三条写在 index.html 里 */
.home-try-h { margin: 30px 0 10px; font-size: 13px; color: var(--muted); }
/* 区块标题右边挂「查看全部」：小链接，不跟标题抢字号 */
.home-recent-h { display: flex; align-items: center; gap: 8px; }
.home-more { margin-left: auto; border: 0; background: none; padding: 0; cursor: pointer;
  font: inherit; font-size: 12px; color: var(--accent-2); }
.home-more:hover { text-decoration: underline; }
/* 最近任务：任务中心那份清单的头五条，右侧只标 Agent 归属，不编状态 */
.home-recent { display: flex; flex-direction: column; gap: 6px; }
.hrec-row {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px;
  border: 0; border-radius: 9px; background: var(--panel);
  color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: .15s;
}
.hrec-row:hover { border-color: var(--accent); background: #f6fdf9; }
.hrec-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.hrec-main b { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hrec-main i { font-style: normal; font-size: 11.5px; color: var(--muted); }
@media (max-width: 768px) {
  .home-wrap-clean { padding: 0 16px 20px; }
  .home-wrap-clean .home-title { font-size: 24px; }
}

/* 工作台首页（附图）：派活 + 四个 Agent 入口 + 任务动态。
   只作用于 #view-home，另外四个 Agent 首页继续用上面的 home-wrap-clean 规格 */
#view-home .home-wrap-clean { max-width: 860px; }
#view-home .home-try-h { margin: 28px 0 12px; }
#view-home .home-try-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px; margin-top: 0; }
#view-home .home-try-grid .try-row { justify-content: space-between; border: 1px solid var(--line);
  border-radius: 10px; background: var(--panel); box-shadow: none; padding: 12px 14px; }
#view-home .home-try-grid .try-row::after { content: '↗'; color: var(--muted); font-size: 14px; }
#view-home .home-try-grid .try-row .qc-ico { display: none; }

.home-divider { height: 1px; background: var(--line); margin: 26px 0 20px; }
.home-section-h { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.home-agents { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.home-agent-row { display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); font: inherit; text-align: left; cursor: pointer;
  transition: color .15s, box-shadow .15s, transform .15s; }
.home-agent-row:hover { color: var(--accent-2); box-shadow: var(--shadow-lg); transform: translateY(-1px); }
@media (max-width: 768px) { .home-agents { grid-template-columns: 1fr; } }
.ha-ico { flex: none; width: 22px; height: 22px; display: grid; place-items: center; color: var(--text); }
.ha-ico svg { width: 21px; height: 21px; }
.ha-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ha-main b { font-size: 14px; font-weight: 650; color: var(--text); }
.ha-main i { font-style: normal; font-size: 12px; color: var(--muted); }
.ha-arrow { color: var(--muted); font-size: 19px; }

.home-feed-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px;
  border-bottom: 1px solid var(--line-soft, var(--line)); }
.hf-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.hf-main b { font-size: 13.5px; font-weight: 500; color: var(--text); }
.hf-who { font-size: 12px; color: var(--muted); }
.hf-status { flex: none; font-size: 11px; padding: 4px 10px; border-radius: 999px;
  background: var(--bg-soft); color: var(--muted); }
.hf-status.ok { background: #dcfce7; color: #15803d; }
.hf-status.warn { background: #ffedd5; color: #c2410c; }
.hf-status.bad { background: #fee2e2; color: #b42318; }
.home-empty { padding: 14px 4px; }

/* 首页输入框：附图里左下写「上传账单或能源数据」，右下写「开始执行 ↑」 */
#view-home .ci-attach { display: inline-flex; width: auto; margin-left: 0; gap: 6px; }
#view-home .ci-attach::after { content: '上传账单或能源数据'; font-size: 12px; color: var(--muted); }
#view-home .send-btn { width: auto; height: 32px; padding: 0 14px; border-radius: 999px;
  background: #e5e7eb; color: #4b5563; gap: 4px; }
#view-home .send-btn::before { content: '开始执行'; font-size: 12px; }
#view-home .send-btn svg { width: 14px; height: 14px; }
#view-home .send-btn:hover { background: #d1d5db; }

/* ==========================================================================
   Agent 统一页面框架
   左导航（.sidebar，224px） | 中间对话区（.agx-chat） | 右侧工作区（.agx-work）
   对话固定占中间一列，Agent 的取数、求解与产出全部落到右侧工作区：
   对话不会因为看板变长被挤窄，看板也不会跟着对话滚动。
   ========================================================================== */
.agx3 { display: flex; gap: 16px; min-height: 0; align-items: flex-start; }

/* 宽主区变体：向导页 / 核算工作台。中间是宽表主区，右栏是要点与进度 */
.agx3.is-wide { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.agx3.is-wide > .agx-main { min-width: 0; }
.agx3.is-wide > .agx-rail { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* 对话型变体：中间对话列定宽，右侧工作区吃掉剩余宽度 */
.agx3.is-chat { height: 100%; align-items: stretch; }
.agx3.is-chat > .agx-chat {
  position: relative; width: 380px; flex: 0 0 380px; min-width: 0; min-height: 0;
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border: 0; border-radius: 16px;
  box-shadow: 0 1px 2px rgba(23, 24, 26, .04);
}
.agx3.is-chat > .agx-work {
  flex: 1; min-width: 0; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px; padding: 2px 4px 8px 2px;
}

/* 对话列：标题栏 / 内容区（输入框沿用既有悬浮规则吸附在列底） */
.agx-chat-hd {
  flex: 0 0 auto; display: flex; align-items: center; gap: 9px;
  padding: 11px 14px; border-bottom: 1px solid var(--line); background: #fff;
}
/* 列头：机器人头像 + 是谁。头像四家共用一张（金碳AI 的形象），名字才区分得开。
   .agx-ico / .agx-hd-sub 仍留给诊断、柔性两张工作台页的列头——它们不在对话列里，
   这一轮只改对话列，不把那两个页面一起拖走 */
.agx-chat-hd .agx-avatar {
  width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%;
  object-fit: contain; background: #f1f4f7;
}
.agx-chat-hd .agx-ico {
  width: 26px; height: 26px; border-radius: 8px; flex: 0 0 26px;
  display: grid; place-items: center; background: #e7f8f1; color: var(--accent-2); font-size: 14px;
}
.agx-chat-hd .agx-ico svg { width: 15px; height: 15px; }
.agx-chat-hd b { font-size: 13.5px; font-weight: 600; color: var(--text); }
.agx-chat-hd .agx-hd-sub { font-size: 11.5px; color: var(--muted); }

.agx-chat-bd { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
/* 空态：问候语与输入框在对话列内垂直居中；有消息后滚动交给 #chat-scroll */
.agx-chat-bd:not(:has(.msg.user, .msg.assistant)) {
  overflow-y: auto; justify-content: center; justify-content: safe center;
}
.agx-chat .hero { padding: 18px 0 10px; }
.agx-chat .hero h1 { font-size: 20px; line-height: 1.45; }
.agx-chat .chips { margin-top: 10px; }
.agx-chat .composer { margin: 10px auto 0; }
.agx-chat .composer-bar { flex-wrap: wrap; padding: 6px 12px 12px; }
.agx-chat .chat-jump { bottom: 150px; }

/* ---------------- 对话页：会话单列 / 四个 Agent 三栏 ----------------
   会话（通用助手）：#agx-chat-col 用 display:contents 透传，子元素直接参与
   #view-chat 的排布，和单列时期一模一样；
   四个领域 Agent：导航（侧栏） | 对话区 3 | 工作区 7，对话区只做文字对话，
   取数、工序、产出都在工作区——宽度按 3:7 分，屏幕越宽工作区给得越多 */
#view-chat #agx-chat-col { display: contents; }
#view-chat #agx-chat-hd { display: none; }
#agx-work[hidden] { display: none; }

#view-chat.is-agent {
  flex-direction: row; align-items: stretch; overflow: hidden; padding: 0; gap: 0;
  justify-content: flex-start;
}
/* 与上面的单列规则同权重、但写在后面：空态居中 / 内边距这些单列设定要被三栏覆盖 */
#view-chat.is-agent:not(:has(.msg.user, .msg.assistant)) { justify-content: flex-start; }
#view-chat.is-agent #agx-chat-col {
  position: relative;                    /* 回底按钮贴住对话列，不飘到工作区中间 */
  display: flex; flex-direction: column;
  width: 30%; flex: 0 0 30%; min-width: 0; min-height: 0;
  background: #fff; border-right: 1px solid var(--line);
}
#view-chat.is-agent #agx-chat-hd { display: flex; }
#view-chat.is-agent #chat-hero { order: 1; flex: 0 0 auto; }
#view-chat.is-agent:not(:has(.msg.user, .msg.assistant)) #chat-hero { padding: 16px 14px 6px; }
#view-chat.is-agent #chat-hero h1 { font-size: 18px; }
#view-chat.is-agent #hero-chips { order: 2; flex: 0 0 auto; padding: 0 14px; margin-top: 10px; }
#view-chat.is-agent #chat-home-extra { order: 3; flex: 0 0 auto; }
#view-chat.is-agent #chat-scroll {
  order: 4; flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 12px 14px;
}
#view-chat.is-agent:has(.msg.user, .msg.assistant) #chat-scroll { padding-bottom: 12px; }
/* 输入框吸在对话列底部（不再 absolute 浮在消息流上）：
   工作区不再放「资料上传」面板，附件按钮和附件条就留在输入框这里 */
#view-chat.is-agent #composer,
#view-chat.is-agent:has(.msg.user, .msg.assistant) #composer {
  order: 5; position: static; inset: auto; width: auto; max-width: none; margin: 0;
  padding: 10px 12px 12px; background: #fff; border-top: 1px solid var(--line); z-index: 1;
}
#view-chat.is-agent .chat-jump { bottom: 104px; }
#view-chat.is-agent #agx-work:not([hidden]) {
  flex: 1 1 auto; min-width: 0; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px; padding: 16px 18px;
}
/* 列头要说清「谁在跟你说话」：三栏下头像与名字都比会话单列大一档 */
#view-chat.is-agent .agx-chat-hd { padding: 14px 16px; gap: 11px; }
#view-chat.is-agent .agx-chat-hd .agx-avatar {
  width: 34px; height: 34px; flex: 0 0 34px;
}
#view-chat.is-agent .agx-chat-hd b { font-size: 16px; font-weight: 650; }
/* 回答气泡：灰底、不描边，左上角画一个标识——「谁在说」写在气泡上而不是靠位置猜。
   内块的白底（表格/代码）在灰底上仍读得出边界，所以外框可以去掉 */
#view-chat.is-agent .msg.assistant {
  border: 0; box-shadow: none; padding: 14px 16px 14px 43px;
  background: #f4f5f7 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234b5563' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.2l1.85 4.55L18.4 9.6l-4.55 1.85L12 16l-1.85-4.55L5.6 9.6l4.55-1.85z'/%3E%3Cpath d='M17.6 15.2l.75 1.9 1.9.75-1.9.75-.75 1.9-.75-1.9-1.9-.75 1.9-.75z'/%3E%3C/svg%3E")
    16px 17px / 17px 17px no-repeat;
}
/* 输入框：360px 上下的对话列塞不下「图标 + 文字」两颗胶囊按钮，收成小圆钮，
   文字转成 title/aria-label（markup 里本来就带着），读屏不受影响 */
#view-chat.is-agent .composer-bar { padding: 4px 10px 10px; gap: 7px; }
#view-chat.is-agent .composer #btn-attach,
#view-chat.is-agent .send-btn {
  width: 34px; height: 34px; padding: 0; border-radius: 999px;
  justify-content: center; gap: 0;
}
#view-chat.is-agent .send-btn { width: 38px; height: 38px; }
#view-chat.is-agent .composer #btn-attach span,
#view-chat.is-agent .send-btn span { display: none; }
/* 输入框要说工作页的语言。入口页那套「26px 大圆角 + 薄荷描边 + 重投影 + 黑色实心发送键」
   是照参考稿抄来的，放进工作页的交互列就像贴上去的另一件东西——这一列是一叠卡片
   （软底、1px var(--border)、14px 圆角、不投影），输入框照同一套画才读得出是本列的一块。
   四个 Agent 的交互列共用同一份 #composer（mountChatNodes 搬节点），所以两套宿主一起改：
   #view-chat.is-agent（质量 / 核算）与 .agx-chat（巡检执行、巡检结果）。
   黑色按钮换成系统主色（.btn.primary 那一档），一页只留这一处强调色。 */
#view-chat.is-agent .composer-box,
.agx-chat .composer-box {
  background: #f4f5f7; border: 0;
  border-radius: 14px; box-shadow: none;
}
#view-chat.is-agent .composer-box:focus-within,
.agx-chat .composer-box:focus-within {
  border-color: var(--accent-2); box-shadow: 0 0 0 3px rgba(16, 185, 129, .10);
}
/* 拖入文件时的落点：用提问气泡那层绿底，不用入口页的薄荷实底 */
#view-chat.is-agent .composer-box.drag,
.agx-chat .composer-box.drag {
  background: #e6f7f0; border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, .10);
}
#view-chat.is-agent .composer textarea,
.agx-chat .composer textarea {
  min-height: 44px; padding: 10px 14px 2px 38px; font-size: 13.5px;
}
/* 还没说话的三栏首页同样在本页里：留一点高度给人写清任务，但别回到入口页那种大框 */
#view-chat.is-agent:not(:has(.msg.user, .msg.assistant)) .composer textarea { min-height: 64px; }
/* ✨ 是彩色 emoji，跟页面里那枚 ✦ 标识（三栏回答气泡左上角就是它）不是一家；
   换成同一枚 SVG、同一支灰墨，输入框就不再是从别处借来的装饰 */
#view-chat.is-agent .ci-spark,
.agx-chat .ci-spark {
  top: 13px; left: 14px; width: 16px; height: 16px; font-size: 0;
  opacity: 1; filter: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234b5563' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3.2l1.85 4.55L18.4 9.6l-4.55 1.85L12 16l-1.85-4.55L5.6 9.6l4.55-1.85z'/%3E%3C/svg%3E")
    center / 16px 16px no-repeat;
}
#view-chat.is-agent .send-btn,
.agx-chat .send-btn { background: var(--accent); }
#view-chat.is-agent .send-btn:hover:not(:disabled),
.agx-chat .send-btn:hover:not(:disabled) { background: var(--accent-2); transform: none; }
/* ---------------- 对话详情页：整页单列，一段对话一页显示 ---------------- */
#view-conv { overflow: hidden; padding: 0; }
.conv-wrap {
  display: flex; flex-direction: column; flex: 1 1 auto; height: 100%; min-height: 0;
  width: 100%; max-width: 960px; margin: 0 auto;
}
.conv-head {
  flex: 0 0 auto; display: flex; align-items: flex-start; gap: 12px;
  padding: 18px 24px 14px; border-bottom: 1px solid var(--line);
}
.conv-head-main { min-width: 0; }
.conv-title {
  margin: 0; font-size: 16px; font-weight: 650; color: var(--text); line-height: 1.4;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.conv-meta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.conv-meta > span[hidden] { display: none; }
.conv-head .ck-spacer { flex: 1; }

/* 空态：还没有任何往来时，问候语与常用任务居中 */
.conv-empty {
  flex: 1 1 auto; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 20px; padding: 24px; text-align: center;
}
.conv-empty h2 { margin: 0; font-size: 22px; font-weight: 600; color: var(--text); }
.conv-empty h2 svg { vertical-align: -3px; }
.conv-chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-width: 620px; }

/* 消息区自己滚，输入框吸在页底——一页到底，不分栏也不分页 */
.conv-msgs {
  flex: 1 1 auto; min-height: 0; position: relative;
  display: flex; flex-direction: column; overflow: hidden;
}
#view-conv #chat-scroll { order: 0; flex: 1 1 auto; min-height: 0; padding: 18px 24px; }
.conv-composer-host {
  flex: 0 0 auto; padding: 10px 24px 16px;
  background: #fff; border-top: 1px solid var(--line);
}
#view-conv #composer { order: 0; position: static; inset: auto; width: 100%; max-width: none; margin: 0; padding: 0; }
#view-conv .chat-jump { bottom: 22px; }

/* 能源单据上传（单独一页）：版式跟巡检执行页同一套——
   左交互列（往来气泡 + 全站共用的 #composer，文件从这颗回形针或拖进输入框进来），
   右工作列（在册单据条 + 吸顶导轨 + 四步工序流）。
   这一页不再有队列列、拖放区与底栏：三样都被上面两样接走了。
   这里只补这一页特有的：单据条的横向行、空态卡、正文 660 那一档，
   以及导轨吸顶后工序的让位距离。 */
.bl-collect { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.65; }
/* 在册单据条：横着排、排不下就换行。竖向列会把工序流往下推一整屏，
   而这一条报的只是「几张、各自走到第几步、聚焦哪张」，不值得占一栏 */
.blz-strip-h { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.blz-strip-h b { font-size: 15px; font-weight: 650; color: var(--text); }
.blz-strip-h .muted { font-size: 12px; }
.blz-queue { display: flex; flex-wrap: wrap; gap: 8px; }
/* 底色交给全站那一层 L1 面板规则（末尾 .blz-row 那一条）：这里再写一个近似灰，
   就有两个「浅灰」，鼠标一移才知道哪个生效 */
.blz-row { display: flex; align-items: center; gap: 8px; text-align: left;
  border: 0; border-radius: 10px; padding: 7px 12px;
  cursor: pointer; transition: background .15s, color .15s; }
/* 悬停只往深一档，不往白里去（那边是这一页卡面的底色）；
   写在 .on 之前，选中那一片的绿底因此不会被悬停盖掉——聚焦态是状态，不该被鼠标改 */
.blz-row:hover { background: #eceef2; }
.blz-row.on { background: #f2fbf7; }
.blz-row.on .blz-row-name { color: var(--accent-2); }
.blz-row.done { opacity: .72; }
.blz-row-main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.blz-row-name { font-size: 12.5px; font-weight: 600; color: var(--text);
  max-width: 190px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.blz-row-sub { font-size: 11px; color: var(--muted); }
.blz-row-right { display: flex; align-items: center; gap: 4px; flex: none; }
.blz-dot { width: 7px; height: 7px; border-radius: 50%; background: #d7dbe2; display: inline-block; }
.blz-dot.done { background: var(--accent-2); }
.blz-dot.running { background: #f0a500; animation: blz-blink 1.1s ease-in-out infinite; }
.blz-dot.bad { background: #e03131; }
.blz-dot.ready { background: #93b4f5; }
.blz-done-tick { color: var(--accent-2); font-size: 12px; font-weight: 700; }
@keyframes blz-blink { 50% { opacity: .35; } }

/* 右工作列的工序流卡：卡头一行要装下单名、引擎、状态与操作，允许换行；
   成段的正文按全站同一档收到 660，宽表在卡里横向滚，不把卡撑破 */
.blz-detail { min-width: 0; }
#dqb-detail .agxw-card-hd { flex-wrap: wrap; }
#dqb-detail .agxw-card-hd + .ed-steps { margin-top: 0; }
#dqb-detail .bld-brief, #dqb-detail .bld-narr, #dqb-detail .bld-todo { max-width: 660px; }
/* 从导轨跳到某一道：行首要让开吸顶那张导轨卡，否则第一道正好压在它下面 */
#dqb-detail .ed-pstep { scroll-margin-top: 210px; }
.bld-name { max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bld-acts { display: inline-flex; align-items: center; gap: 8px; margin-left: 4px; }
.bld-review { padding: 2px 0 6px; overflow-x: auto; }
/* 一张单子都没有时的空态：只说下一步做什么，不摆成拖放区（这一页的口子在左边交互框） */
.blz-detail.is-empty { display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 8px; min-height: 320px; text-align: center;
  background: #fbfcfd; color: var(--muted); }
.blz-detail.is-empty svg { width: 30px; height: 30px; color: var(--accent-2); }
.blz-detail.is-empty b { font-size: 14px; color: var(--text); }
.blz-detail.is-empty span { font-size: 12px; max-width: 380px; line-height: 1.6; }
/* 识别中：三行假装的读数在扫，配合工序节点呼吸，让人知道模型正在看这张单 */
.bld-scan { display: flex; flex-direction: column; gap: 5px; max-width: 420px; margin: 2px 0 6px; }
.bld-scan span { height: 8px; border-radius: 4px;
  background: linear-gradient(90deg, #eef1f5 25%, #dfe6ef 37%, #eef1f5 63%);
  background-size: 400% 100%; animation: blz-scan 1.3s ease-in-out infinite; }
.bld-scan span:nth-child(1) { width: 82%; }
.bld-scan span:nth-child(2) { width: 58%; animation-delay: .12s; }
.bld-scan span:nth-child(3) { width: 70%; animation-delay: .24s; }
@keyframes blz-scan { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* AI 简报卡：结论 chip + 关键数 + 逐段浮现的大模型解读 + 出处 */
.bld-brief { display: flex; flex-direction: column; gap: 8px; }
.bld-brief-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bld-chip { font-size: 12px; font-weight: 650; color: var(--muted); border-radius: 999px;
  padding: 2px 11px; border: 0; background: #f6f7f9; }
.bld-chip.ok { color: var(--accent-2); background: #f2fbf7; }
.bld-chip.review { color: #b7791f; background: #fffaf0; }
.bld-chip.bad, .bld-chip.blocked { color: #e03131; background: #fff5f5; }
.bld-src { font-size: 10.5px; color: var(--muted); }
.bld-metrics { display: flex; gap: 10px; flex-wrap: wrap; }
.bld-metric { display: flex; flex-direction: column; gap: 1px; padding: 6px 12px;
  border: 0; border-radius: 10px; background: #fbfcfd; min-width: 96px; }
.bld-metric span { font-size: 10.5px; color: var(--muted); }
.bld-metric b { font-size: 15px; font-weight: 700; color: var(--text); }
.bld-narr p { margin: 0 0 6px; font-size: 13px; line-height: 1.75; color: #374151; }
.bld-reveal { opacity: 0; animation: blz-reveal .5s ease-out forwards; }
@keyframes blz-reveal { from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; } }
.bld-stray { margin: 2px 0 0; font-size: 11.5px; line-height: 1.6; color: #b7791f; }
.bld-todo, .bld-hint { font-size: 12px; line-height: 1.6; color: var(--muted); margin: 0; }
/* 生成中：占位文案 + 光标，跟工序节点同一套呼吸节奏 */
.bld-brief.streaming .bld-brief-scan { font-size: 13px; color: #5b6472; }
.bld-brief.streaming .bld-brief-scan::after { content: ''; display: inline-block;
  width: 6px; height: 15px; margin-left: 3px; vertical-align: -2px;
  background: var(--accent, #10b981); animation: ed-caret 1s steps(1) infinite; }
/* 窄屏（≤1280）系统那套框架自己会把两列堆成上下，这里只把交互列收短：
   堆起来之后 62vh 的对话列会把右栏挤出首屏 */
@media (max-width: 1280px) {
  #view-bill_land { overflow: auto; }
  #view-bill_land .agx-chat { height: auto; }
}

.dqb-tag { font-size: 11px; color: var(--muted); border: 0;
  border-radius: 999px; padding: 1px 8px; }
.dqb-tag.ok { color: var(--accent-2); background: #f2fbf7; }
.dqb-tag.bad { color: #e03131; background: #fff5f5; }

/* 电费单版式的只读展示：把识别结果照单据分栏摆开，看着像一张单而不是键值堆。
   只读——要改仍走上面那排可编辑字段，入库以那排为准。 */
.bl-bill { margin-top: 10px; border: 0; border-radius: 12px;
  background: #fcfcfd; overflow: hidden; }
.bl-bill-hd { padding: 8px 14px; font-size: 12.5px; font-weight: 700; letter-spacing: 4px;
  color: #374151; background: #f1f3f6; border-bottom: 1px solid var(--line); text-align: center; }
.bl-sums { display: flex; gap: 12px; padding: 12px 14px; border-bottom: 1px dashed var(--border); }
.bl-sum { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.bl-sum span { font-size: 11.5px; color: var(--muted); }
.bl-sum b { font-size: 22px; font-weight: 750; color: var(--text); line-height: 1.1; }
.bl-sum i { font-style: normal; font-size: 11px; color: var(--muted); }
.bl-sum.fee b { color: #b42318; }
.bl-sec { padding: 10px 14px; border-top: 1px solid var(--line); }
.bl-sec:first-of-type { border-top: 0; }
.bl-sec-h { font-size: 11.5px; font-weight: 650; color: var(--muted); margin-bottom: 6px; }
.bl-cells { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 18px; }
.bl-cell { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px;
  padding: 3px 0; border-bottom: 1px dotted #eceef1; min-width: 0; }
.bl-cell > span { color: var(--muted); flex: none; }
.bl-cell > b { font-weight: 600; color: var(--text); text-align: right; overflow-wrap: anywhere; }
table.bl-fee { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.bl-fee td { padding: 5px 2px; border-bottom: 1px solid var(--line); color: #374151; }
.bl-fee td.num { text-align: right; font-variant-numeric: tabular-nums; }
.bl-fee tr.total td { font-weight: 700; color: var(--text); border-top: 1px solid var(--line);
  border-bottom: 0; padding-top: 7px; }
.bl-fee tr.total td.num { color: #b42318; }
.bl-fee-note { margin: 6px 0 0; font-size: 11px; line-height: 1.6; color: var(--muted); }
/* 工商业电费是 ①~⑤ 的小计：上面压一道实线，一眼看出它是「一组的头」而不是又一项 */
.bl-fee tr.sub td { font-weight: 650; color: var(--text); border-top: 1px solid var(--line); padding-top: 7px; }
/* 金额自检点名的字段：单上就这两个数最容易被认错，标出来让人只看该看的 */
.bl-cell.susp, .bl-fee tr.susp td, .bl-sum.susp { background: #fff5f5; }
.bl-cell.susp > b, .bl-fee tr.susp td.num, .bl-sum.susp b { color: #b42318; }

/* 金额自检卡：合计与分项加不拢就不许悄悄入库。四种语气分开——
   自洽是安心话（弱），参考是提醒（黄），待核对是拦路（红），未校验是实话（灰） */
.bl-check { margin: 10px 0 6px; border: 0; border-radius: 10px;
  padding: 9px 11px; background: #fafbfc; }
.bl-check.ok { background: #f4fbf8; }
.bl-check.warn { background: #fffaef; }
.bl-check.diff { background: #fff6f6; }
.bl-check.partial { background: #fafbfc; }
.bl-check-h { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.bl-check-h b { font-weight: 700; }
.bl-check-h .muted { font-size: 11.5px; font-weight: 400; text-align: right; }
.bl-check-h .sp { flex: 1; }
.bl-check-badge { flex: none; font-size: 11px; padding: 1px 8px; border-radius: 999px;
  border: 0; color: var(--muted); background: #fff; }
.bl-check.ok .bl-check-badge { color: #0b7a44; }
.bl-check.warn .bl-check-badge { color: #9a6700; }
.bl-check.diff .bl-check-badge { color: #b42318; font-weight: 700; }
table.bl-check-t { width: 100%; border-collapse: collapse; font-size: 11.5px; margin-top: 8px; }
.bl-check-t th { text-align: left; color: var(--muted); font-weight: 600; padding: 3px 4px;
  border-bottom: 1px solid var(--line); white-space: nowrap; }
.bl-check-t td { padding: 4px; border-bottom: 1px solid var(--line); color: #374151; vertical-align: top; }
.bl-check-t th.num, .bl-check-t td.num { text-align: right; font-variant-numeric: tabular-nums; }
.bl-check-t td.num.bad { color: #b42318; font-weight: 700; }
.bl-check-t td > s { text-decoration: none; color: var(--muted); display: block; font-size: 10.5px; }
.bl-check-mark { font-style: normal; margin-right: 5px; color: var(--muted); }
.bl-check tr.ok .bl-check-mark { color: #0b7a44; }
.bl-check tr.bad .bl-check-mark { color: #b42318; }
.bl-check-force { margin-top: 8px; font-size: 11.5px; color: #9a6700;
  border: 1px dashed #f3d9a8; border-radius: 8px; padding: 5px 8px; background: #fffaef; }
.bl-check .btn.tiny { margin-top: 8px; }
/* 全部识别数据：摘要之外那一整段——单据每个角落的数都摊在这儿，逐段可查 */
.bl-all { background: #fafbfc; }
.bl-all .dqb-items-grp { margin-top: 8px; }
.bl-all .dqb-items-grp:first-child { margin-top: 0; }
table.bl-mt { width: 100%; border-collapse: collapse; font-size: 11.5px; margin-top: 2px; }
.bl-mt th, .bl-mt td { padding: 4px 6px; border: 1px solid var(--line); text-align: left;
  vertical-align: baseline; overflow-wrap: anywhere; }
.bl-mt th { background: #f1f3f6; color: var(--muted); font-weight: 600; white-space: nowrap; }
.bl-mt th.num, .bl-mt td.num { text-align: right; font-variant-numeric: tabular-nums; }
.bl-mt td:first-child { color: #374151; }
.bl-key { font-style: normal; font-size: 10.5px; color: var(--accent-2);
  border: 0; background: #f2fbf7; border-radius: 999px; padding: 0 6px;
  margin-left: 5px; white-space: nowrap; }
/* 抬头三格照票面：本期电量 / 本期电费 / 交费截止日期各占一格，描边包住才像单上那三个框。
   截止日期是日期不是金额，字号收小，也不跟着电费一起标红。 */
.bl-sum { border: 0; border-radius: 8px; padding: 8px 10px; background: #fff; }
.bl-sum.due b { font-size: 16px; font-weight: 650; }
/* 本期电量明细：一块电能表一个分组，组头那行「电能表编号…电价…」灰底接住表格 */
.bl-meter-g { margin-top: 10px; }
.bl-meter-g:first-of-type { margin-top: 0; }
.bl-meter-t { font-size: 11.5px; font-weight: 650; color: #374151; background: #f1f3f6;
  border: 0; border-bottom: 0; border-radius: 6px 6px 0 0; padding: 4px 8px; }
.bl-meter-t + table.bl-mt { margin-top: 0; }
.bl-meter-foot { margin: 8px 0 0; padding-top: 6px; font-size: 11.5px; line-height: 1.7;
  color: #374151; border-top: 1px dashed var(--border); }
/* 本期电费明细三栏：大项黑字加粗，小项缩成灰字往右退一格，层级一眼分得开 */
.bl-fee3 th { text-align: left; font-size: 11.5px; font-weight: 650; color: var(--muted);
  background: #f1f3f6; border-bottom: 1px solid var(--line); padding: 5px 4px; }
.bl-fee3 th.num { text-align: right; font-variant-numeric: tabular-nums; }
.bl-fee3 tr.head td { font-weight: 650; color: var(--text); }
.bl-fee3 tr.kid td { font-size: 11.5px; color: #6b7280; }
.bl-fee3 tr.kid td:first-child { padding-left: 16px; }
/* 第三层（①~⑤ 下面各自的明细行）再退一格：层级靠缩进分，不靠颜色 */
.bl-fee3 tr.kid2 td:first-child { padding-left: 32px; }
/* 用能分析：票面右侧那五条，序号成圆点、句子照票面原文，峰谷那条下面接柱图 */
.bl-an { background: #fbfdfc; }
.bl-an-i { display: flex; gap: 8px; padding: 6px 0; border-bottom: 1px dotted #eceef1; min-width: 0; }
.bl-an-i:last-child { border-bottom: 0; }
.bl-an-no { flex: none; width: 17px; height: 17px; margin-top: 2px; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; }
.bl-an-name { font-size: 12px; font-weight: 700; color: var(--text); }
.bl-an-t { margin: 2px 0 0; font-size: 12px; line-height: 1.75; color: #374151; }
.bl-an-t b { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.bl-ratio { margin: 8px 0 2px; }
.bl-ratio-lg { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); }
.bl-ratio-lg i { width: 9px; height: 9px; border-radius: 2px; }
.bl-ratio-lg i.cur { background: var(--accent); }
.bl-ratio-lg i.prev { background: #cfd4db; margin-left: 8px; }
.bl-rb-row { display: flex; gap: 6px; margin-top: 6px; }
.bl-rb { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center;
  gap: 2px; border: 0; border-radius: 8px; padding: 6px 4px; background: #fff; }
.bl-rb-bars { display: flex; align-items: flex-end; gap: 3px; height: 72px; }
.bl-rb-bars span { width: 13px; min-height: 2px; border-radius: 3px 3px 0 0; }
.bl-rb-bars span.cur { background: var(--accent); }
.bl-rb-bars span.prev { background: #cfd4db; }
.bl-rb b { font-size: 11.5px; font-weight: 650; color: #374151; }
.bl-rb i { font-style: normal; font-size: 11px; color: var(--text); font-variant-numeric: tabular-nums; }
.bl-rb s { text-decoration: none; font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
@media (max-width: 720px) {
  .bl-cells { grid-template-columns: 1fr; }
  .bl-mt { font-size: 11px; }
  .bl-sums { flex-wrap: wrap; }
  .bl-sum { flex: 1 1 45%; }
  .bl-rb-bars { height: 54px; }
  .bl-rb-bars span { width: 9px; }
  .bl-fee3 tr.kid td:first-child { padding-left: 8px; }
  .bl-fee3 tr.kid2 td:first-child { padding-left: 18px; }
}

.dqb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 12px; margin: 10px 0 4px; }
.dqb-grid label { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px;
  color: var(--muted); }
.dqb-grid input {
  border: 0; border-radius: 8px; padding: 5px 8px;
  font-size: 12.5px; color: var(--text); background: #fff;
}
.dqb-grid input:focus { outline: none; border-color: var(--accent-2); }
.dqb-grid input.changed { border-color: #f0a500; background: #fffaf0; }

/* 比对分三组：单据自洽 / 与库内同期 / 与采集实测——一组说一件事，
   采集那组还要带上用的哪种口径，不能只留一个勾 */
.dqb-grp { display: flex; flex-direction: column; gap: 4px; margin: 8px 0 6px;
  border-top: 1px dashed var(--border); padding-top: 8px; }
.dqb-grp-h { display: flex; align-items: center; gap: 8px; font-size: 11.5px;
  color: var(--muted); }
.dqb-grp-h b { font-size: 12px; color: var(--text); }

/* 采集对象：户号对不到电表，这一层由人选，选完按户号记住 */
.dqb-scope { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 6px 0 2px; }
.dqb-scope-l { display: flex; align-items: center; gap: 6px; font-size: 11.5px;
  color: var(--muted); }
.dqb-bld { border: 0; border-radius: 8px; padding: 4px 6px;
  font-size: 12px; color: var(--text); background: #fff; max-width: 190px; }
.dqb-chips { display: flex; gap: 5px; flex-wrap: wrap; }
.dqb-chip { border: 0; border-radius: 999px; padding: 2px 9px;
  font-size: 11.5px; color: var(--muted); background: #fff; cursor: pointer; }
.dqb-chip.on { color: var(--accent-2); background: #f2fbf7; }
.dqb-mapped { color: #b7791f; }
.dqb-stale { font-size: 11px; color: #b7791f;
  border-radius: 999px; padding: 1px 8px; background: #fffaf0; }

.dqb-verdict { margin: 2px 0 0; font-size: 12px; line-height: 1.6; color: var(--text); }
.dqb-verdict b { margin-right: 6px; }
.dqb-verdict.ok b { color: var(--accent-2); }
.dqb-verdict.review b { color: #b7791f; }
.dqb-verdict.bad b, .dqb-verdict.blocked b { color: #e03131; }
.dqb-th { margin: 2px 0 0; font-size: 11px; color: var(--muted); }
.dqb-ai { margin: 4px 0 0; font-size: 12px; line-height: 1.65; color: var(--text);
  border-left: 1px solid var(--line); padding-left: 8px; }
.dqb-ai i { color: #b7791f; font-style: normal; }

.dqb-row { display: flex; align-items: baseline; gap: 8px; font-size: 12px; }
.dqb-row span:first-child { color: var(--muted); min-width: 84px; }
.dqb-row b { font-weight: 600; }
.dqb-row.warn b, .dqb-row.warn i { color: #b7791f; }
.dqb-row.bad b, .dqb-row.bad i { color: #e03131; }
.dqb-row i { font-style: normal; font-size: 11.5px; color: var(--muted); }
.dqb-hints { font-size: 11.5px; color: var(--muted); line-height: 1.65; }

.dqb-items-grp { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; }
.dqb-items-grp .dqb-grp-h i { font-style: normal; color: var(--muted); }
/* 用能分析五段并在这一个标题下面，排在全部识别数据的最后：标题和段里的小标题差一级 */
.dqb-an { margin-top: 12px; padding-top: 4px; border-top: 1px dashed var(--border); }
.dqb-an-h { margin-bottom: 2px; }
.dqb-an-h b { font-size: 12.5px; }
.dqb-an .dqb-items-grp:first-of-type { margin-top: 0; }
.dqb-item { display: flex; align-items: baseline; gap: 8px; font-size: 12px; line-height: 1.55; }
.dqb-item > b { font-weight: 500; color: var(--text); min-width: 150px; }
.dqb-item > b i { font-style: normal; color: var(--muted); margin-left: 4px; font-size: 11px; }
.dqb-item > span { font-weight: 600; }
.dqb-item > span i { font-style: normal; color: var(--muted); font-weight: 400; margin-left: 3px; }
.dqb-item em { font-style: normal; font-size: 10.5px; color: var(--accent-2);
  border: 0; background: #f2fbf7; border-radius: 999px; padding: 0 7px; }
.dqb-grp > .dqb-grp-h i { font-style: normal; color: var(--muted); }
.dqb-raw { margin-top: 8px; font-size: 11.5px; }
.dqb-raw summary { cursor: pointer; color: var(--muted); }
.dqb-raw pre { white-space: pre-wrap; word-break: break-all; margin: 6px 0 0;
  padding: 8px 10px; border: 0; border-radius: 8px;
  background: #f8faf9; font-size: 11px; line-height: 1.6; max-height: 260px; overflow: auto; }

/* ---------------- 导航「核算」的第一屏：说明 + 对话框 + 三个问法 + 三个去处 ----------------
   对话框就是 #composer 本体（脚本搬进来的），这里只给它入口页的高度口径；
   交互框正下方那排 .cal-chips 与另外三个 Agent 共用上面的快捷问法规格，
   下面三张卡是纯入口，版式跟数据 Agent 工作页的入口卡同一套留白与描边，只是竖排两行 */
#view-carbon_land { align-items: center; justify-content: center; }
.cal-wrap { width: 100%; max-width: 720px; margin: 0 auto; padding: 0 4px; text-align: center; }
.cal-title { margin: 0 0 22px; font-size: 26px; line-height: 1.4; font-weight: 700; color: var(--text); }
#view-carbon_land .composer { margin-top: 0; }
/* 输入框的卡面与多行高度由 .composer.is-hero 一处规定，这一页不再各写一份。
   三段间距拉开层级：标题贴住输入框一组；问法片贴输入框但留出呼吸；
   入口卡再退一步，别和问法片挤成一片 */
.cal-chips { margin-top: 20px; }
.cal-chips .cal-chip {
  padding: 9px 15px; font-size: 13.5px; color: #374151;
  border: 1px solid transparent;
}
.cal-chips .cal-chip .qc-ico { color: var(--accent-2); }
.cal-chips .cal-chip.is-picked {
  color: var(--accent-2); border-color: var(--accent-2);
  background: #f4fbf7;
}
.cal-cards {
  margin: 34px auto 0; max-width: 720px;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px;
}
/* 三张入口卡跟主页输入框、快捷片同一档卡面：白底 + 软阴影，不描边。
   第二行是接口读回来的真实计数，不并进快捷问法那一套（那是一套一句话） */
.cal-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  border: 0; border-radius: 16px; background: var(--panel); box-shadow: var(--shadow);
  padding: 16px 14px; cursor: pointer; font: inherit; text-align: center;
  transition: box-shadow .15s, transform .15s;
}
.cal-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.cal-card b { font-size: 14px; font-weight: 600; color: var(--text); }
.cal-card > span { font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.cal-card > span b { color: var(--text); font-weight: 650; margin-left: 3px; }
.cal-card .ok b { color: var(--accent-2); }
.cal-card .run b { color: #d97706; }
/* 任务那一格是几条计数并排：横向排开、放不下就换行，不靠字符串里的空格撑间距 */
#cal-task-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
@media (max-width: 768px) {
  .cal-title { font-size: 21px; }
  .cal-cards { grid-template-columns: 1fr; }
}

/* ---------------- 导航「优化」的第一屏：提问 + 对话框 + 三个问法 + 当下情况 ----------------
   对话框是 #composer 本体（脚本搬进来的），这里只给入口页的宽度与高度口径；
   下面那张卡的内容全来自接口，读不到就写读不到，不拿 0 或「—」冒充结论。
   垂直居中用 margin:auto 而不是 justify-content:center：这一屏比核算那屏高，
   视口矮时 center 会把标题顶出可滚动范围（flex 溢出时 auto margin 自动归 0） */
#view-flex_land { align-items: center; justify-content: flex-start; }
.fxl-wrap { width: 100%; max-width: 720px; margin: auto 0; padding: 0 4px; }
.fxl-title { margin: 0 0 26px; font-size: 26px; line-height: 1.4; font-weight: 700;
  color: var(--text); text-align: center; }
#view-flex_land .composer { margin-top: 0; }
/* 卡面、多行高度、快捷问法都由 .composer.is-hero 与主页那一套规格规定，这一屏不再各写一份。
   发送键上原先那句「开始分析」的伪元素文字随附图一起撤掉：这一屏发的仍是对话
   （真正的整轮分析在 01 页底部那颗 #fxt-start），键和其余三屏一样是圆形箭头 */

.fxl-card { margin-top: 22px; border: 0; border-radius: 16px;
  background: #fff; padding: 20px 22px; }
.fxl-sec + .fxl-sec { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.fxl-sec-head { display: flex; align-items: center; gap: 12px; }
.fxl-sec-head > b { font-size: 15px; font-weight: 650; color: var(--text); }
.fxl-sec-head > span:last-child { margin-left: auto; }
.fxl-scope { font-size: 12px; color: var(--muted); }
.fxl-head-acts { display: flex; align-items: center; gap: 10px; }

/* 今日优化概览：三格等宽。机会数大于 0 才染绿，0/— 保持素色，不拿颜色冒充「有戏」 */
.fxl-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px 24px; margin-top: 14px; }
.fxl-metrics-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.fxl-metric { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fxl-mlabel { font-size: 12px; color: var(--muted); }
.fxl-mval { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.25; }
.fxl-mval.ok { color: var(--accent); }
.fxl-mval.pending { font-size: 18px; font-weight: 650; color: var(--muted); }
.fxl-mval-state { font-size: 19px; }
.fxl-msub { font-size: 12px; color: var(--muted); line-height: 1.5; }

.fxl-badge { font-size: 12px; color: var(--muted); }
.fxl-badge.run { color: #b7791f; background: #fff7ed; border-radius: 999px; padding: 3px 10px; }
.fxl-badge.ok { color: #047857; background: #ecfdf5; border-radius: 999px; padding: 3px 10px; }
.fxl-badge.warn { color: #b7791f; background: #fff7ed; border-radius: 999px; padding: 3px 10px; }
.fxl-badge.bad { color: #b42318; background: #fef3f2; border-radius: 999px; padding: 3px 10px; }
.fxl-pill { font-size: 11px; color: #b7791f; background: #fff7ed; border-radius: 999px; padding: 2px 8px; }

/* 最近优化任务：灰卡里的一片白（L2，底色见文末表面系统）。标题是任务来由原文，
   长句单行截断、悬停看全；三行参数左标签右值；去处是一颗通栏描边胶囊 */
.fxl-recent { margin-top: 12px; }
.fxl-rc { border: 0; border-radius: 12px; padding: 16px 18px; }
.fxl-rc-hd { display: flex; align-items: center; gap: 9px; min-width: 0; }
.fxl-rc-title { flex: 1 1 auto; min-width: 0; font-size: 15px; font-weight: 650;
  color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fxl-rc-hd .fxl-badge, .fxl-rc-hd .fxl-pill { flex: 0 0 auto; }
.fxl-rc-sub { margin-top: 6px; font-size: 12px; color: var(--muted); }
.fxl-rc-kv { margin-top: 14px; display: flex; flex-direction: column; gap: 9px; }
.fxl-rc-r { display: flex; align-items: baseline; gap: 12px; font-size: 13px; }
.fxl-rc-r > span { flex: 0 0 64px; color: var(--muted); }
.fxl-rc-r > b { flex: 1 1 auto; min-width: 0; font-weight: 550; color: var(--text); }
.fxl-rc-go { display: block; width: 100%; margin-top: 16px; padding: 10px 14px;
  border: 1px solid var(--accent); border-radius: 999px; background: transparent;
  color: var(--accent); font: inherit; font-size: 13.5px; font-weight: 600;
  text-align: center; cursor: pointer; transition: background .15s; }
.fxl-rc-go:hover { background: rgba(16, 185, 129, .08); }
.fxl-empty { font-size: 12.5px; color: var(--muted); line-height: 1.7;
  border: 1px dashed var(--border); border-radius: 12px; padding: 16px; }
@media (max-width: 768px) {
  .fxl-title { font-size: 21px; }
  .fxl-card { padding: 16px; }
  .fxl-metrics-3 { grid-template-columns: 1fr; gap: 14px; }
  .fxl-flabel { font-size: 10.5px; }
}

/* ---------------- 用电巡检 Agent 三页（edl-*） ----------------
   框架与碳核算 / 柔性用电 Agent 同一条三栏：左导航（.sidebar）| 中交互（.agx-chat 对话列）
   | 右内容（.agx-work 工作区）。对话列只说事、不放数据：
   巡检的取数、工序、异常事件每条都带处理动作，全部摆在右侧一栏才不挤成两行，
   也不会跟着对话一起滚走。 */
.edl-hero { padding: 16px 16px 2px; }
.edl-hero h1 { margin: 0; font-size: 18.5px; line-height: 1.45; font-weight: 700; color: var(--text); }
.edl-hero p { margin: 6px 0 0; font-size: 12.5px; line-height: 1.65; color: var(--muted); }
.edl-title { margin: 0; font-size: 26px; line-height: 1.4; font-weight: 700;
  color: var(--text); text-align: center; }
/* 对话列里搬进来的消息流与输入框：列宽只有 380，
   对话页那套 720 居中留白会吃掉大半宽度，这一列里改成贴边的 16px */
.edl-chat-msgs { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.edl-chat-msgs .chat-scroll { padding: 0 16px; }
#edrun-composer-host, #edres-composer-host, #dqb-composer-host { padding: 0 16px 14px; }
/* 落地页的输入框是这一屏的主角：左右留白由 .edh 统一给，宿主不再叠一层，
   否则 720 的上限被压成 688，跟标题和胶囊对不齐 */
#edl-composer-host { width: 100%; padding: 0; }
#view-ediag_land .composer { margin-top: 0; }
/* 这一屏按下起的是算法任务：说明写在发送键的悬停提示里（app.js edlComposerChrome），
   键身用主色点一下，图标留着——附图那一屏也是圆形图标键 */
/* 下面两条只管巡检追问那一排（.edl-asks）；第一屏的三条问法跟另外两页共用
   「图标 + 一句话」那套规格，见 .composer.is-hero 后面那一节 */
.edl-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; padding: 0 16px; }
.edl-chip { border: 0; border-radius: 999px; background: #fff;
  padding: 7px 16px; font: inherit; font-size: 13px; color: var(--text); cursor: pointer;
  transition: border-color .15s, color .15s, background .15s; }
.edl-chip:hover { border-color: var(--accent-2); color: var(--accent-2); background: #f4fbf7; }
/* 追问页的快捷问句：贴在输入框上方，左右留白跟消息流与输入框同一档（16px） */
.edl-asks { padding: 0 16px; margin-top: 4px; }
.edl-asks .edl-chip { font-size: 12.5px; padding: 6px 13px; }
/* 追问底下那句「谁答的 / 哪些数不在实测里」：比正文小一档，别抢结论的话 */
.edl-chat-by { margin: 8px 0 0; font-size: 11.5px; line-height: 1.6; color: #9aa3ad; }

/* 任务执行 / 巡检结果是独立两页：顶部一条返回 + 小标题，替代第一屏居中的大标题 */
.edl-pagebar { display: flex; align-items: center; gap: 14px; margin: 4px 0 2px; }
.edl-title-sm { margin: 0; font-size: 19px; text-align: left; }
.edl-back { border: 0; border-radius: 999px; background: #fff;
  padding: 5px 14px; font: inherit; font-size: 12.5px; color: var(--muted); cursor: pointer;
  transition: border-color .15s, color .15s; }
.edl-back:hover { border-color: var(--accent-2); color: var(--accent-2); }
/* 大模型叙述层（AI 播报 / AI 巡检总结）：底色淡一点，跟算法结果一眼分开，
   坏了这一栏整条不显示——它只是把实测数字说成顺话，不是新的一层结论 */
.edl-ai { margin-top: 14px; border: 0; border-radius: 12px;
  background: #f7faff; padding: 12px 14px; }
.edl-ai-h { font-size: 12px; font-weight: 650; color: #4f6ef7; margin-bottom: 4px; }
.edl-ai-text { margin: 0; font-size: 13px; line-height: 1.75; color: #374151; }
.edl-ai-text.muted { color: var(--muted); }
.edl-ai-stray { margin: 6px 0 0; font-size: 11.5px; line-height: 1.6; color: #b7791f; }
.edl-scope { font-size: 12px; color: var(--muted); }
/* 三段各自成卡之后，卡头自带 14px 下边距：紧跟其后的第一块不再自己顶上距，
   否则结论前面空出两层 */
#view-ediag_result .agxw-card-hd + * { margin-top: 0; }

/* 结果阶段的结论句 + 三张统计卡（照附图的结果页：一句话结论 + 大数字） */
.edl-concl { margin-top: 12px; font-size: 13.5px; line-height: 1.7; color: #374151; }
.edl-concl.bad { color: #b42318; }
.edl-concl p { margin: 0; }
.edl-concl span { display: block; margin-top: 4px; font-size: 11.5px; color: var(--muted); }
.edl-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px; margin-top: 14px; }
.edl-stat { display: flex; flex-direction: column; gap: 4px; min-width: 0;
  border: 0; border-radius: 12px; padding: 14px 16px; background: #fff; }
.edl-stat > span { font-size: 12px; color: var(--muted); }
.edl-stat > b { font-size: 26px; font-weight: 700; color: var(--text); line-height: 1.15; }
.edl-stat > i { font-style: normal; font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.edl-stat.run > b { color: #b7791f; }
.edl-stat.bad > b { color: #b42318; }
.edl-basis { margin: 14px 0 0; font-size: 11.5px; line-height: 1.6; color: var(--muted); }
.edl-basis.warn { color: #d97706; }
/* 开始配置卡的表单：对象/时间两格一排，窄了各占一行 */
.edl-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px; margin-top: 16px; }
.edl-field { display: flex; flex-direction: column; gap: 5px; }
.edl-field > span { font-size: 12px; color: var(--muted); }
.edl-field .edl-sel { max-width: 100%; padding: 7px 10px; font-size: 13px; color: var(--text); }
.edl-checks { display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin-top: 16px; padding: 12px 14px; border: 0; border-radius: 12px; }
.edl-checks-h { font-size: 12px; color: var(--muted); }
.edl-check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px;
  color: var(--text); cursor: pointer; }
.edl-check input { accent-color: var(--accent-2); width: 15px; height: 15px; }
.edl-avail { margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.edl-avail summary { cursor: pointer; color: var(--muted); }
.edl-avail-body { margin: 6px 0 0; font-size: 12px; line-height: 1.65; color: var(--muted); }
/* 「原始数据 / 谁判断的」这类说明行统一走 .edl-note，旧的摘要卡样式随落地页改版删掉 */

/* 对象与周期两个选择器摆在卡头：整页（总览 / 事件 / 证据）都跟着这一个口径走 */
.edl-sel { border: 0; border-radius: 8px; background: #fff;
  padding: 3px 8px; font: inherit; font-size: 12px; color: var(--muted); max-width: 260px; }
.edl-sel:disabled { opacity: .6; cursor: not-allowed; }
.edl-badge { font-size: 12px; color: var(--muted); }
.edl-badge.run { color: #b7791f; background: #fff7ed; border-radius: 999px; padding: 3px 10px; }
.edl-badge.bad { color: #b42318; background: #fef3f2; border-radius: 999px; padding: 3px 10px; }
.edl-more { border: 0; background: none; padding: 0; font: inherit; font-size: 12px;
  color: var(--muted); cursor: pointer; }
.edl-more:hover { color: var(--accent-2); }

.edl-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.edl-tab { border: 0; border-radius: 999px; background: #fff;
  padding: 5px 14px; font: inherit; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.edl-tab i { font-style: normal; color: var(--text); margin-left: 4px; font-weight: 650; }
.edl-tab.on { border-color: var(--text); color: var(--text); background: #f6f7f9; }

.edl-events { margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.edl-ev { border: 0; border-radius: 12px; padding: 14px 16px; }
.edl-ev-h { display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  font-size: 14px; color: var(--text); }
.edl-ev-h > b { font-weight: 650; }
.edl-ev-meta { margin-top: 4px; font-size: 12px; color: var(--muted); }
/* 风险与处理状态都是徽标：颜色之外一定带着字，不单靠色相分辨 */
.edl-lv { font-size: 11.5px; border-radius: 999px; padding: 2px 9px;
  background: #eef1f4; color: #5b6470; }
.edl-lv.lv-high { background: #fef3f2; color: #b42318; }
.edl-lv.lv-medium { background: #fff7ed; color: #b7791f; }
.edl-lv.lv-low { background: #f2f4f7; color: #56606b; }
.edl-state { margin-left: auto; font-size: 11.5px; border-radius: 999px; padding: 2px 9px; }
.edl-state.st-open { background: #fff7ed; color: #b7791f; }
.edl-state.st-handling { background: #eff6ff; color: #1d4ed8; }
.edl-state.st-closed { background: #ecfdf5; color: #047857; }
.edl-ev-num { display: flex; align-items: baseline; gap: 10px; margin-top: 10px; }
.edl-ev-num b { font-size: 21px; font-weight: 700; color: var(--text); }
.edl-ev-num span { font-size: 12.5px; color: var(--muted); }
.edl-ev-sec { margin-top: 10px; font-size: 12.5px; color: #374151; line-height: 1.7; }
.edl-ev-sec > b { display: block; font-size: 12px; color: var(--muted); font-weight: 650; }
.edl-ev-sec ul { margin: 4px 0 0; padding-left: 18px; }
.edl-ev-sec li.bad { color: #b42318; }
.edl-ev-sec li.warn { color: #b7791f; }
.edl-ev-sec li.more { color: var(--muted); list-style: none; margin-left: -18px; }
.edl-ev-act { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.edl-res-input { flex: 1 1 220px; min-width: 0; max-width: 340px; border: 0;
  border-radius: 8px; padding: 5px 9px; font: inherit; font-size: 12.5px; }
.edl-done { font-size: 12px; color: var(--muted); }
/* 巡检事件卡：类别徽标跟等级徽标分开放，两者都只写字不靠颜色区分 */
.edl-kind { font-size: 11.5px; border-radius: 999px; padding: 2px 9px;
  background: #eef1f4; color: #5b6470; }
.edl-lv.lv-unknown { background: #f2f4f7; color: #98a2b3; }
.edl-ev-sub { font-size: 11.5px; color: var(--muted); line-height: 1.65; }
.edl-ev-sub.warn { color: #b7791f; }
.edl-ev-sub.bad { color: #b42318; }
/* 巡检期口径与阈值状态：这行决定下面的 0 条该怎么读，不能省 */
.edl-note { font-size: 11.5px; color: var(--muted); line-height: 1.65;
  border-left: 1px solid var(--line); padding: 2px 0 2px 10px; }

.edl-runs { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.edl-run { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  border: 0; border-radius: 10px; background: #fff; padding: 10px 14px;
  font: inherit; cursor: pointer; }
.edl-run:hover { border-color: var(--accent-2); background: #f4fbf7; }
/* 巡检任务行没有可点开的会话，去掉 hover 反馈免得看着像能点 */
.edl-run.is-task { cursor: default; }
.edl-run.is-task:hover { border-color: var(--line); background: #fff; }
.edl-rmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.edl-rmain b { font-size: 13.5px; font-weight: 600; color: var(--text);
  overflow-wrap: anywhere; }
.edl-rmain span { font-size: 12px; color: var(--muted); }
/* 记录行的失败原因折着，点开的整句仍留在这一栏里，不另开弹窗 */
.edl-run-err { display: block; margin-top: 3px; }
.edl-run-err p { margin: 4px 0 0; }
.edl-pill { flex: none; font-size: 11px; color: #047857; background: #ecfdf5;
  border-radius: 999px; padding: 2px 8px; }
.edl-pill.bad { color: #b42318; background: #fef3f2; }
.edl-empty { font-size: 12.5px; color: var(--muted); line-height: 1.7;
  border: 1px dashed var(--border); border-radius: 12px; padding: 16px; }

/* 任务执行视图：四步工序 + 当前发现 + 实时日志 + 进度脚（照附图的任务执行卡） */
/* 任务执行那一栏的四步卡已被框架页的五道工序块取代（.edf-*），
   这里只留错误/空态那句话的样式 */
.edl-find-text { margin: 0; font-size: 12.5px; line-height: 1.7; color: #374151;
  border-left: 1px solid var(--line); padding-left: 10px; }
.edl-find-text.bad { color: #b42318; }
/* 正在跑的那一轮：记录列表和任务执行卡说的是同一轮，用同一条边对上 */
.edl-run.is-task.live { border-color: #fdba74; background: #fffbeb; }
/* ---------------- 巡检第一屏（图1）与任务卡（图2 顶） ----------------
   第一屏不摆表单：标题 → 一句话输入卡 → 三个常用问法 → 最近任务，一列居中，
   宽度跟输入卡那条 720 上限对齐。范围/周期/检查内容的核对与修改挪到框架页的
   任务卡上做，那里改完重新下发，改的是新参数，不是已经落盘的这一轮留痕。 */
.edh { width: 100%; max-width: 720px; margin: 0 auto; padding: 40px 4px 30px;
  display: flex; flex-direction: column; gap: 24px; }
.edh-in { display: flex; flex-direction: column; align-items: center; }
.edh-title { margin: 0; font-size: 30px; line-height: 1.35; font-weight: 700; color: var(--text); }
.edh-sub { margin: 12px 0 20px; max-width: 560px; font-size: 13px; line-height: 1.75;
  color: var(--muted); text-align: center; }
/* 标题 → 巡检对象选择区 30px，与其他第一屏同一档；
   副标题已撤掉，这里给选择区留足呼吸，避免标题贴着控件 */
.edh-in .edl-object-pick { margin-top: 30px; }
/* 巡检对象选择区 → 输入框 16px，保持二者成一组 */
.edh-in .edh-box { margin-top: 16px; }
/* 当前巡检对象：左标签 + 右连接徽标，下方是宽下拉 */
.edl-object-pick { width: 100%; max-width: 640px; }
.edl-object-hd { display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px; padding: 0 2px; }
.edl-object-label { font-size: 13.5px; font-weight: 600; color: var(--text); }
.edl-object-conn { font-size: 12px; font-weight: 500; color: #067647;
  background: #e7f7ee; border: 1px solid #a6e7c4; border-radius: 999px;
  padding: 2px 10px; line-height: 1.6; }
.edl-object-conn.off { color: #b42318; background: #fef3f2; border-color: #fecdca; }
.edl-object-sel { width: 100%; max-width: none; height: 48px; padding: 0 40px 0 15px;
  border: 1px solid var(--border, #d1d5db); border-radius: 12px;
  background: #fff; color: var(--text); font-size: 14px; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
.edl-object-sel:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(16,185,129,.14); outline: none; }
.edl-object-sel:disabled { color: var(--muted); cursor: not-allowed; background-color: #f8fafc; }
.edh-chips { justify-content: center; margin-top: 16px; padding: 0; }
/* 最近任务读的是巡检服务自己那份留痕：状态徽标和报数并列，
   点一条就接着看那一轮的工序与事件（跑着的和已跑完都点得开） */
#view-ediag_land .edh-recent { border: 0; border-radius: 16px;
  background: #fff; padding: 16px 18px 18px; }
.edh-recent-hd { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.edh-recent-hd > b { font-size: 14px; font-weight: 650; color: var(--text); }
.edh-more { margin-left: auto; border: 0; background: none; padding: 0; font: inherit;
  font-size: 12px; color: var(--muted); cursor: pointer; }
.edh-more:hover { color: var(--accent-2); }
.edh-tasks { display: flex; flex-direction: column; gap: 8px; }
.edh-task { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  border: 0; border-radius: 12px; background: #fff; padding: 10px 14px;
  font: inherit; cursor: pointer; transition: border-color .15s, background .15s; }
.edh-task:hover { border-color: var(--accent-2); background: #f4fbf7; }
.edh-task.live { border-color: #fdba74; background: #fffbeb; }
.edh-task-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.edh-task-main b { font-size: 13.5px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
/* 最近任务标题不加粗：保留字号/颜色，去掉 b 的 600 字重 */
.edh-task-main .edh-task-title { font-size: 13.5px; font-weight: 400; color: var(--text); overflow-wrap: anywhere; }
.edh-task-main em { font-style: normal; font-size: 12px; color: var(--muted); }
.edh-task-main em.bad { color: #b42318; }
.edh-task-empty { margin: 0; font-size: 12.5px; line-height: 1.7; color: var(--muted); }

/* 落地页三张概览卡：白卡贴在灰底上，沿用这一屏现有的卡面分量。
   图标 / 一句话 / 按钮各占一行，异常卡多一条由真实异常分画出的迷你折线。 */
.edh-snapshot-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.edh-snap-card { display: flex; flex-direction: column; align-items: flex-start; gap: 9px;
  min-width: 0; border: 0; border-radius: 14px; background: var(--panel); padding: 15px 16px; }
.edh-snap-hd { display: flex; align-items: center; gap: 9px; }
.edh-snap-ico { flex: none; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; }
.edh-snap-ico svg { width: 17px; height: 17px; }
.tone-ok .edh-snap-ico { background: #dcfce7; color: #15803d; }
.tone-warn .edh-snap-ico { background: #ffedd5; color: #c2410c; }
.tone-info .edh-snap-ico { background: #dbeafe; color: #1d4ed8; }
.edh-snap-title { font-size: 14px; font-weight: 650; color: var(--text); }
.edh-snap-sub { margin: 0; font-size: 12px; line-height: 1.6; color: var(--muted); min-height: 19px; }
.edh-snap-spark { width: 100%; max-width: 130px; height: 28px; color: #10b981; }
.edh-snap-btn { margin-top: auto; border: 0; border-radius: 999px; background: #f1f5f9;
  color: #334155; padding: 6px 12px; font: inherit; font-size: 12px; cursor: pointer;
  transition: background .15s; }
.edh-snap-btn:hover { background: #e2e8f0; }
@media (max-width: 900px) { .edh-snapshot-grid { grid-template-columns: 1fr; } }

/* 任务参数就地改：范围三行由 edlRenderTaskCard 拼成 .task-flow（和碳核算、
   柔性用电那张任务卡同一套行），点行尾「修改」在这一页展开表单，
   改完重新下发——这里改的是新参数，不是已经落盘的这一轮留痕 */
.edh-task-edit { margin-top: 14px; border-top: 1px dashed var(--border); padding-top: 14px; }
.edh-rerun { margin-top: 14px; height: 34px; padding: 0 18px; border: 0; border-radius: 999px;
  background: #17181a; color: #fff; font: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background .15s; }
.edh-rerun:hover { background: #000; }

/* ---------------- 巡检工作页：吸顶导轨 + 五道工序时间轴 ----------------
   版式跟碳核算、柔性用电同一套：顶上吸住的是 .agxw-sticky 里的导轨（走到哪了），
   下面 .ed-steps 那道时间轴是每一步查出什么的细读，右下角「看工序 / 看结论」
   把两种读法合成一次切换，切档不重新取数。工序状态、耗时、报数与算法分段
   全由服务端折好带回来，这一栏只负责摊开。 */
/* 中列 380 之外，右栏左右各留 18：跟另外两个 Agent 的工作列同一档，
   吸顶的导轨背景才盖得住整幅（左右不对称的话滚过的卡片从边上露出来） */
.agx3.is-chat > .edl-work { padding: 0 18px 16px; }
/* 点导轨跳下来的那一道要让开吸顶块（实测高 194px），否则第一道工序压在它下面 */
#edf-steps .ed-pstep { scroll-margin-top: 210px; }
/* 参数行尾那句来路（模型点的 / 关键词对的 / 没人判断走了默认）比值小一档 */
.task-step-h .task-sub { font-size: 11px; color: var(--muted); font-weight: 400; }
/* 原始数据里那张宽表不能让工序块被撑破：就地横向滚 */
.edl-work .ed-pstep-body { overflow-x: auto; }
/* 工作列在 1440 屏能铺到 900+，成段的话通铺一行六十字，看到行尾找不回行首。
   卡片满幅（跟 图3 一样：外框对齐，收的是正文），只把说的话收进 660 */
#edf-sub, #edf-note, #edf-steps .ed-pstep-d, #edf-steps .edf-line,
#edf-steps .ed-pstep-ai, #edh-task-src, #edl-concl, #edl-ai-summary { max-width: 660px; }

.edf-line { margin: 10px 0 0; font-size: 13.5px; line-height: 1.7; color: var(--text); }
.edf-items { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.edf-item { display: inline-flex; align-items: baseline; gap: 6px; font-size: 11.5px;
  color: var(--muted); border: 0; border-radius: 8px;
  padding: 4px 10px; background: #fbfcfd; }
.edf-item > b { font-size: 13px; font-weight: 650; color: var(--text); }
.edf-notes { margin: 10px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; }
.edf-notes li { font-size: 12px; line-height: 1.65; color: #b7791f; }
/* 分段留痕：11 段算法里落进这一道工序的那几段，各自的状态与实测耗时 */
.edf-segs { list-style: none; margin: 12px 0 0; padding: 0; display: flex;
  flex-direction: column; gap: 4px; }
.edf-seg { display: flex; align-items: baseline; gap: 8px; font-size: 11.5px;
  color: var(--muted); border-top: 1px dashed var(--border); padding-top: 4px; }
.edf-seg > i { flex: none; font-style: normal; color: #374151; }
.edf-seg > span { flex: none; }
.edf-seg > em { font-style: normal; color: #b42318; overflow-wrap: anywhere; }
.edf-seg.st-ok > span { color: #047857; }
.edf-seg.st-failed > span, .edf-seg.st-blocked > span { color: #b42318; }
.edf-seg.st-disabled > span { color: #98a2b3; }
.edf-raw { margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 8px; }
.edf-raw summary { cursor: pointer; font-size: 12px; color: var(--muted); }
.edf-raw summary:hover { color: var(--accent-2); }
.edf-raw-hint { margin: 0; font-size: 11.5px; line-height: 1.65; color: var(--muted); }
.edf-raw-seg > b { font-size: 12px; color: var(--text); font-weight: 650; }
.edf-raw-seg > span { font-size: 11.5px; color: var(--muted); margin-left: 8px; }
/* 原始数据是留痕原文：等宽、可滚、给个上限高度，别把整块工作区撑长 */
.edf-pre { margin: 6px 0 0; max-height: 260px; overflow: auto; background: #f8fafc;
  border: 0; border-radius: 10px; padding: 10px 12px;
  font-family: var(--mono, ui-monospace, SFMono-Regular, Consolas, monospace);
  font-size: 11.5px; line-height: 1.6; color: #374151; white-space: pre-wrap;
  overflow-wrap: anywhere; }

/* 看工序 / 看结论：吸在工作列右下角，滚到哪儿都能切回来。
   它是工作列的直接子元素——sticky 的行程只到所属容器为止，塞进卡里就只剩原位 */
.edf-switch { position: sticky; bottom: 12px; display: flex; justify-content: flex-end;
  width: 100%; max-width: 980px; margin-top: -2px; }
.edf-switch[hidden] { display: none; }
.edf-mode { border: 0; background: #fff;
  padding: 6px 16px; font: inherit; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.edf-switch > .edf-mode:first-child { border-radius: 999px 0 0 999px; }
.edf-switch > .edf-mode:last-child { border-radius: 0 999px 999px 0; border-left: 0; }
.edf-mode.on { color: var(--text); background: #f6f7f9; font-weight: 600; }
.edf-concl { border: 0; border-radius: 14px; background: #fff;
  padding: 16px 18px; }
.edf-concl-lead { margin: 0; font-size: 14px; line-height: 1.75; color: var(--text); }
.edf-concl-list { list-style: none; margin: 14px 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 10px; }
.edf-concl-list li { border-top: 1px dashed var(--border); padding-top: 8px; }
.edf-concl-list b { font-size: 13px; color: var(--text); }
.edf-concl-list span { font-size: 11.5px; color: var(--muted); margin-left: 8px; }
.edf-concl-list p { margin: 3px 0 0; font-size: 12.5px; line-height: 1.7; color: #374151; }
.edf-concl-go { margin: 14px 0 0; }

@media (max-width: 768px) {
  .edl-hero h1 { font-size: 17px; }
  .edl-stats { grid-template-columns: 1fr; }
  .edl-fields { grid-template-columns: 1fr; }
  .edl-sel { flex: 1 1 100%; min-width: 0; max-width: 100%; }
  /* 窄屏上第一屏还是那一列：标题缩一号 */
  .edh { padding: 20px 0 24px; gap: 18px; }
  .edh-title { font-size: 24px; }
  .edh-sub { margin-bottom: 16px; }
  /* 参数行的「值 / 来路 / 修改」在窄列里换行：来路自己占一行，
     「修改」跟着换到第二行也比挤掉读数好 */
  .task-step-h { flex-wrap: wrap; }
  .task-step-h .task-sub { flex: 1 1 100%; }
}

/* ---------------- 碳核算 Agent 工作页：核算任务清单 ---------------- */
.cbt-wrap { width: 100%; max-width: 1080px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.cbt-head { display: flex; align-items: flex-end; gap: 16px; }
.cbt-head > div { flex: 1; min-width: 0; }
/* 标题区吃掉剩余宽度，右侧按钮组不能被同一条 flex:1 拉长（选择器要多一级才压得住） */
.cbt-head .cbt-acts { flex: none; display: flex; align-items: center; gap: 8px; }
.cbt-title { margin: 0; font-size: 19px; font-weight: 650; color: var(--text); }
.cbt-stats {
  display: flex; flex-wrap: wrap; gap: 20px; align-items: center;
  background: #fff; border: 0; border-radius: 14px;
  padding: 14px 18px; font-size: 12.5px; color: var(--muted);
}
.cbt-stats b { color: var(--text); font-size: 16px; margin-left: 4px; }
.cbt-stats .ok b { color: var(--accent-2); }
.cbt-stats .run b { color: #d97706; }
.cbt-list {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 6px 16px; overflow-x: auto;
}
.cbt-list:has(.home-empty) { padding: 22px 16px; text-align: center; }
.cbt-list table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.cbt-list th {
  text-align: left; font-weight: 600; color: var(--muted); white-space: nowrap;
  padding: 10px 10px; border-bottom: 1px solid var(--line);
}
.cbt-list td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.cbt-list tr:last-child td { border-bottom: none; }
.cbt-list td b { color: var(--text); }
.cbt-mono { font-variant-numeric: tabular-nums; white-space: nowrap; color: #374151; }
.cbt-st { display: inline-block; font-size: 11.5px; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.cbt-st.ok { background: #e7f8f1; color: var(--accent-2); }
.cbt-st.run { background: #fdf3e3; color: #b45309; }
.cbt-st.todo { background: #eef2f6; color: #475569; }
.cbt-st.bad { background: #fdeaea; color: #b91c1c; }
/* 任务中心跳进来时高亮那一条任务，避免只切页不定位 */
.cbt-list tr.is-focused td { background: #fff8e6; box-shadow: inset 0 0 0 1px rgba(217,119,6,.45); }

/* ---------------- 工作区：流程 / 任务卡 / 数据图表 / 解读 ---------------- */
.agxw-card {
  background: #fff; border: 0; border-radius: 16px;
  padding: 18px 20px; box-shadow: 0 1px 2px rgba(23, 24, 26, .04);
}
.agxw-card-hd { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.agxw-card-hd h3 { margin: 0; font-size: 15px; font-weight: 650; color: var(--text); }
.agxw-card-hd .muted { font-size: 12px; }
.agxw-card-hd .ck-spacer { flex: 1; }

/* ① 步骤条：圆点 + 连接线，完成/进行中用主色，未开始是灰的 */
.agxw-steps { display: flex; align-items: flex-start; overflow-x: auto; padding-bottom: 2px; }
.agxw-step { display: flex; align-items: flex-start; flex: 1 1 0; min-width: 0; }
.agxw-step:last-child { flex: 0 0 auto; }
.agxw-step .agxw-col {
  display: flex; flex-direction: column; align-items: center; gap: 6px; width: 58px;
}
.agxw-dot {
  width: 24px; height: 24px; border-radius: 999px; display: grid; place-items: center;
  font-size: 11.5px; font-weight: 600; background: var(--panel-2);
  color: var(--muted); border: 0;
}
.agxw-step.done .agxw-dot { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.agxw-step.on .agxw-dot { background: #fff; border-color: var(--accent-2); color: var(--accent-2); }
.agxw-lbl { font-size: 11px; color: var(--muted); white-space: nowrap; }
.agxw-step.done .agxw-lbl { color: var(--text); }
.agxw-step.on .agxw-lbl { color: var(--accent-2); font-weight: 600; }
.agxw-line { flex: 1; height: 1px; background: var(--border); margin: 12px 4px 0; }
/* 真实工序节点：节点名是工序名，圆点是工序代号，bad 未通过 / skip 未执行 */
.agxw-steps.is-node { flex-wrap: nowrap; }
.agxw-steps.is-node .agxw-step { flex: 0 0 auto; }
.agxw-step.node .agxw-col { width: auto; min-width: 72px; max-width: 96px; }
.agxw-step.node .agxw-dot { font-size: 10.5px; padding: 0 4px; width: auto; min-width: 24px; }
.agxw-step.node .agxw-lbl {
  white-space: normal; text-align: center; line-height: 1.35; font-size: 10.5px;
}
.agxw-step.bad .agxw-dot { background: #fff; border-color: #e03131; color: #e03131; }
.agxw-step.bad .agxw-lbl { color: #e03131; }
.agxw-step.skip { opacity: .55; }
.agxw-step.skip .agxw-dot { background: #f1f3f5; border-color: var(--line); color: #adb5bd; }
.agxw-prog {
  height: 4px; border-radius: 999px; background: var(--panel-2);
  margin-top: 12px; overflow: hidden;
}
.agxw-prog > i { display: block; height: 100%; background: var(--accent-2); transition: width .3s; }

/* 跑动中跟手 ①：流程块吸在工作区顶部，产出往下长时进度与工序状态不跟着滚走。
   滚动容器的上留白挪到 sticky 自己身上——留着 padding 的话吸住时卡片会浮在半空 */
#view-chat.is-agent #agx-work:not([hidden]) { padding: 0 18px 16px; }
#view-chat.is-agent #agx-work.is-land { padding-top: 16px; }
.agxw-sticky {
  position: sticky; top: 0; z-index: 4;
  padding: 16px 0 14px; margin-bottom: -14px;   /* 抵掉 flex gap：吸住时下沿不留一道缝 */
  background: var(--bg);
}

/* 跑动中跟手 ②：产出长到一屏装不下时，才给「回工序 / 看结论」两颗锚点 */
.agxw-dock {
  position: sticky; bottom: 0; align-self: flex-end; z-index: 4;
  display: flex; gap: 8px;
}
.agxw-dock[hidden] { display: none; }
.agxw-jump {
  font: inherit; font-size: 12px; color: var(--text); cursor: pointer;
  background: #fff; border: 0; border-radius: 999px;
  padding: 6px 14px; box-shadow: 0 2px 8px rgba(23, 24, 26, .10);
}
.agxw-jump:hover { border-color: var(--accent-2); color: var(--accent-2); }
.agxw-jump[hidden] { display: none; }
/* 跳过来的位置要让开吸顶的流程块（实测高 194px），否则第一道工序正好被压在它下面 */
#agx-task .ed-pstep, #agx-task .dq-step, #agx-task .ed-pipe-report,
#agx-work .agxw-out > * { scroll-margin-top: 210px; }

/* 跑动中跟手 ③：每道工序跑完就地补一句实测（耗时、拿到几项、解读多久）。
   数字全部来自前端真实观测，没收到 step_start 的行不写时长 */
.agxw-ms {
  font-size: 11px; color: var(--muted); background: var(--panel-2);
  border-radius: 999px; padding: 2px 9px; white-space: nowrap;
}
.dq-step .agxw-ms { margin: 0 8px; }

/* 吸顶工序条 = 这一轮真实工序的地图：走通的一段连线染色、正在跑的那颗圆点呼吸、
   节点可点（跳到下面对应那一行并闪一下）。三段状态一起才读得出「跑到哪儿了」 */
.agxw-step.done + .agxw-line {
  background: linear-gradient(90deg, var(--accent-2, #059669), #6ee7b7);
}
.agxw-step.node { cursor: pointer; }
.agxw-step.node:hover .agxw-lbl { color: var(--accent-2); }
.agxw-step.on .agxw-dot { animation: agxw-breath 1.7s ease-in-out infinite; }
@keyframes agxw-breath {
  0%, 100% { box-shadow: 0 0 0 0 rgba(5, 150, 105, .22); }
  50% { box-shadow: 0 0 0 5px rgba(5, 150, 105, .08); }
}
/* 跳过来的那一行闪一圈：不加边框不改布局，闪完自己收，免得留下第二层框 */
.ed-pstep.is-target { animation: ed-pstep-target 1.3s ease-out 1; }
@keyframes ed-pstep-target {
  0%, 55% { background: rgba(16, 185, 129, .07);
    box-shadow: 0 0 0 2px rgba(5, 150, 105, .40); border-radius: 10px; }
  100% { background: transparent; box-shadow: 0 0 0 2px rgba(5, 150, 105, 0); }
}
/* 动效只是状态提示，不是唯一通道：文字状态（进行中/已完成/停工于）本来就在，
   关掉动画后信息一条不少 */
@media (prefers-reduced-motion: reduce) {
  .agxw-step.on .agxw-dot, .ed-pstep.is-target,
  .ed-pstep-ai[data-streaming="1"]::before { animation: none; }
  .ed-pstep-ai[data-streaming="1"]::after { animation: none; }
}

/* ② 任务卡：参数选择框、流程表格、审核、结果。
   外层卡片框和内层 .task-card 框都去掉：工序、选项、表格本来就各自描边，
   再套两层圆角框等于把右栏切成一摞格子；「任务卡」这个标题留着分段，正文通铺 */
.agxw-sec { display: flex; flex-direction: column; }
.agxw-task { display: flex; flex-direction: column; gap: 12px; }
.agxw-task .msg.task { max-width: 100%; }
/* 任务卡通铺到和顶部流程同宽：参数行、工序表、执行区共用一列，右边界只有一条。
   限宽只留给成段的「分析与解读」正文和数据图表（下面两条）——那里一行 60 字
   才真的看到行尾找不回下一行开头；参数行和工序表都是短行，铺开不吃力 */
.agxw-task .task-card {
  border: 0; background: none; padding: 0; box-shadow: none;
}

/* 「分析与解读」按块收，不按整卡收：成段的文字、列表、标题限宽 660，
   表格和图（.chart-box）留在整幅——追问的回答里常有对比表，压进 660 就读不了 */
#view-chat.is-agent .agxw-read > p,
#view-chat.is-agent .agxw-read > ul,
#view-chat.is-agent .agxw-read > ol,
#view-chat.is-agent .agxw-read > h1,
#view-chat.is-agent .agxw-read > h2,
#view-chat.is-agent .agxw-read > h3 { max-width: 660px; }
#view-chat.is-agent .agxw-read { overflow-x: auto; }
/* 任务卡限宽后，报告正文和工序「原始数据」里的宽表不能让卡片被撑破：就地横向滚 */
#view-chat.is-agent .ed-report-body,
#view-chat.is-agent .ed-pstep-body { overflow-x: auto; }
/* 「返回字段」那张键值表跟正文同一档（660），右边界才和任务卡、解读段对齐；
   图表卡（.agxc）和结论卡（.agvd）不在这条里——图和数字就是要摊开 */
#view-chat.is-agent .agxw-data { max-width: 660px; }

/* ③ 数据与图表：一块产出都没有时整卡不出现，不留标题占位置 */
.agxw-st { font-size: 11px; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.agxw-st.run { background: #e7f8f1; color: var(--accent-2); }
.agxw-st.ok { background: #f1f2f4; color: var(--muted); }
.agxw-card:has(> .agxw-out:empty) { display: none; }
.agxw-out { display: flex; flex-direction: column; gap: 12px; }
.agxw-data { border: 0; border-radius: 12px; overflow: hidden; }
.agxw-data-h {
  font-size: 11.5px; color: var(--muted); background: var(--panel-2);
  padding: 6px 10px; border-bottom: 1px solid var(--line);
}
.agxw-data table { width: 100%; border-collapse: collapse; font-size: 12px; }
.agxw-data th, .agxw-data td {
  padding: 5px 10px; border-bottom: 1px solid var(--line); text-align: left;
}
/* 键值表：原来写死 th{width:40%}，660px 的表里一个「factor」也要占掉 264px，
   值被推到最右边。让值列吃满（width:100% 是表格贴内容的老写法），标签列自己收。
   断行只用 break-word：它是「装不下才断」，不改变单元格的最小宽度；
   写成 anywhere 会让 min-content 塌成一个字，标签列直接被挤成 32px 竖排 */
.agxw-data th { color: var(--muted); font-weight: 500; overflow-wrap: break-word; }
.agxw-data td { color: #111827; word-break: break-word; width: 100%; }
/* 问数结果表是多列数据，不是键值表：上面 td{width:100%} 会让首列吃满整张表，
   后面的中文列被挤成逐字竖排。这里还原成按内容分配列宽，窄屏就地横向滚。 */
#view-chat.is-agent .agxw-data.dq-grid-card { max-width: none; overflow-x: auto; }
.agxw-data table.dq-grid { table-layout: auto; }
.agxw-data table.dq-grid th,
.agxw-data table.dq-grid td {
  width: auto; min-width: 72px; white-space: nowrap;
  word-break: normal; overflow-wrap: normal;
}
.agxw-raw { border: 0; border-radius: 12px; overflow: hidden; }
.agxw-raw > summary { cursor: pointer; color: var(--muted); font-size: 11.5px; padding: 6px 10px; }
.agxw-raw > pre {
  margin: 0; padding: 10px; font-size: 11.5px; background: #f6f8f7;
  max-height: 260px; overflow: auto; white-space: pre-wrap; word-break: break-all;
}

/* 图表卡：分段按钮切的是真实系列，口径写在标题行右边，图例跟着这一段走，
   卡脚只留一句「算法/来源」——读图的人自己判断这张图凭什么 */
.agxc { border: 0; border-radius: 12px; background: #fff; padding: 12px 14px; }
.agxc-hd { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.agxc-hd > b { font-size: 13px; font-weight: 650; color: var(--text); }
.agxc-seg { display: flex; gap: 2px; padding: 2px; background: var(--panel-2); border-radius: 999px; }
.agxc-seg button {
  font: inherit; font-size: 11.5px; line-height: 18px; color: var(--muted);
  background: none; border: 0; padding: 1px 10px; border-radius: 999px;
  cursor: pointer; white-space: nowrap;
}
.agxc-seg button.on {
  background: #fff; color: var(--text); font-weight: 600;
  box-shadow: 0 1px 2px rgba(23, 24, 26, .08);
}
.agxc-meta { font-size: 11.5px; color: var(--muted); }
.agxc-pane { display: none; }
.agxc-pane.on { display: block; }
.agxc-fig { margin-top: 10px; }
.agxc-fig svg { display: block; width: 100%; height: auto; }
.agxc-lg {
  display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px;
  font-size: 11.5px; color: var(--muted);
}
.agxc-lg i {
  display: inline-block; width: 9px; height: 9px; border-radius: 3px;
  margin-right: 5px; vertical-align: 1px;
}
.agxc-ft { display: flex; justify-content: flex-end; margin-top: 10px; }
.agxc-badge { font-size: 11px; color: var(--muted); background: var(--panel-2); border-radius: 6px; padding: 3px 8px; }
.agxc-hb { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.agxc-hr {
  display: grid; grid-template-columns: minmax(0, 108px) minmax(0, 1fr) minmax(0, 108px);
  align-items: center; gap: 10px; font-size: 12px;
}
.agxc-lbl { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agxc-track { height: 8px; border-radius: 999px; background: var(--panel-2); overflow: hidden; }
.agxc-track > i { display: block; height: 100%; border-radius: 999px; }
.agxc-val { text-align: right; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.agxc-val em { font-style: normal; font-weight: 400; font-size: 11px; color: var(--muted); margin-left: 3px; }

/* 结论卡：左边一个大数字，右边只挂接口真给了的明细行 */
.agvd {
  border: 0; border-radius: 12px; background: #fff;
  padding: 14px 16px; display: grid; gap: 8px 20px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.agvd-main { min-width: 0; }
.agvd-l { font-size: 12px; color: var(--muted); }
.agvd-v {
  margin-top: 2px; font-size: 28px; line-height: 1.25; font-weight: 700;
  letter-spacing: -.3px; color: var(--text); font-variant-numeric: tabular-nums;
}
.agvd-u { font-size: 12.5px; font-weight: 500; letter-spacing: 0; color: var(--muted); margin-left: 5px; }
.agvd-b {
  display: inline-block; margin-top: 6px; font-size: 12px; font-weight: 600;
  color: var(--accent-2); background: #e7f8f1; border-radius: 999px; padding: 2px 10px;
}
/* 结论不一定是好消息：多花了钱、只有部分结果时不能照样涂绿 */
.agvd-b.warn { color: #8a6d00; background: #fdf6e8; }
.agvd-n { margin-top: 8px; font-size: 11.5px; line-height: 1.5; color: var(--muted); }
.agvd-side {
  min-width: 0; display: flex; flex-direction: column; gap: 7px;
  padding-left: 20px; border-left: 1px solid var(--line); align-self: center;
}
.agvd-r { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; }
.agvd-r span { color: var(--muted); white-space: nowrap; }
.agvd-r b { font-weight: 600; text-align: right; word-break: break-word; font-variant-numeric: tabular-nums; }
/* 窗口很窄时两栏挤成上下：分隔线从竖着改成横着，明细行才不会被数字列压扁 */
@media (max-width: 760px) {
  .agvd { grid-template-columns: 1fr; }
  .agvd-side {
    border-left: 0; padding-left: 0; margin-top: 4px;
    border-top: 1px solid var(--line); padding-top: 10px;
  }
}

/* 数据质量体检结论：读数的两块（大数字 / 图表）复用 .agvd 与 .agxc 的画法，
   这里只补它们覆盖不到的三样——阻断原因、处置建议、问题明细。
   夹在工序时间轴与报告正文之间：先看结论、再看图、最后读整篇报告。 */
.ed-pipe-result:empty { display: none; }
.dqr { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.dqr-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.dqr-h > b { font-size: 13px; font-weight: 650; }
.dqr-meta { font-size: 11.5px; color: var(--muted); }
/* 两张图并排要 380px 一条：660px 的正文宽下并排会把横条挤成 59px，读不出长短 */
.dqr-charts { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); }
.dqr-none { font-size: 12px; color: var(--muted); padding: 6px 0 2px; }
.dqr-blk { border: 0; border-radius: 12px; background: #fff; padding: 12px 14px; }
.dqr-blk > b { display: block; font-size: 13px; font-weight: 650; margin-bottom: 9px; }

/* 阻断与放行是两种话，颜色也得分开：绿底只给真·可用 */
.dqr-block { border: 1px solid #fed7aa; background: #fff8ef; border-radius: 12px; padding: 10px 14px; }
.dqr-block > b { display: block; font-size: 12.5px; font-weight: 650; color: #9a3412; }
.dqr-block ul { margin: 5px 0 0; padding-left: 18px; font-size: 12.5px; line-height: 1.65; }
.dqr-block li + li { margin-top: 3px; }
.dqr-pass { border: 0; background: var(--panel-2); border-radius: 12px;
  padding: 10px 14px; font-size: 12.5px; color: #4b5563; }
.dqr-pass.ok { background: #f0fdf4; color: #065f46; }

.dqr-sugs { display: flex; flex-direction: column; gap: 7px; }
.dqr-sug { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  font-size: 12.5px; padding: 7px 11px; border-radius: 10px;
  background: var(--panel-2); border-left: 3px solid var(--muted); }
.dqr-sug.high { border-left-color: var(--danger); background: #fef6f6; }
.dqr-sug.medium { border-left-color: var(--warn); background: #fffaef; }
.dqr-sug.low { border-left-color: var(--blue); }
.dqr-sug-t { font-weight: 650; }
.dqr-sug-n { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dqr-sug-w { flex: 1; min-width: 160px; font-size: 11.5px; color: var(--muted); }

.dqr-g { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; }
.dqr-g:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.dqr-gh { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; margin-bottom: 7px; }
.dqr-gh > b { font-size: 12.5px; font-weight: 650; }
.dqr-gn, .dqr-gb { font-size: 11.5px; color: var(--muted); }
.dqr-i { padding: 8px 11px; border: 0; border-radius: 10px; background: var(--bg-soft); }
.dqr-i + .dqr-i { margin-top: 6px; }
.dqr-ih { display: flex; align-items: center; gap: 8px; }
.dqr-ih b { font-size: 12.5px; }
.dqr-sev { font-size: 10.5px; color: #fff; border-radius: 999px; padding: 1px 9px; }
.dqr-d { margin-top: 4px; font-size: 12.5px; line-height: 1.6; }
.dqr-sub2 { margin-top: 3px; font-size: 11.5px; color: var(--muted); line-height: 1.55;
  overflow-wrap: anywhere; }

/* ④ 分析与解读：原来 h1/h2/h3 一起压成 14px，正文又只有 13px——
   整块看着像一段没分层的密文。正文抬到 13.5px / 1.8，标题按级差放开，
   最大只到卡头那 15px，不让解读里的标题盖过「分析与解读」本身 */
.agxw-read { font-size: 13.5px; line-height: 1.8; color: #1f2937; }
.agxw-read h1 { font-size: 15px; font-weight: 700; margin: 14px 0 7px; }
.agxw-read h2 { font-size: 14px; font-weight: 650; margin: 13px 0 6px; }
.agxw-read h3 { font-size: 13.5px; font-weight: 650; margin: 11px 0 5px; }
.agxw-read p { margin: 0 0 8px; }
.agxw-read li + li { margin-top: 3px; }
.agxw-read ul, .agxw-read ol { margin: 0 0 8px; padding-left: 20px; }
.agxw-read table { border-collapse: collapse; font-size: 12px; margin-bottom: 8px; }
.agxw-read th, .agxw-read td { border: 1px solid var(--line); padding: 4px 8px; }
.agxw-read pre { background: #f6f8f7; padding: 8px; border-radius: 8px; overflow: auto; }
.agxw-read .chart-box { background: #fff; }
.agxw-sum {
  border: 0; border-radius: 12px; background: #fff;
  padding: 12px 16px; font-size: 12.5px; color: var(--muted);
}
.agxw-sum b { color: var(--accent-2); font-size: 14px; }
.agxw-sum .muted { font-size: 11.5px; }

/* ---------- ⓪ 碳核算 Agent 默认页：还没派活时右栏先看真的事 ----------
   is-land 把 ①~⑤ 整体让位，只留这张待办页；一开口说派活的话就撤类，
   任务流程/任务卡/数据图表回到原位——两套状态在 DOM 里不并存 */
#agx-work.is-land > :not(#agx-land) { display: none; }
.agl-list { padding: 0 2px; }
.agl-list > * + * { border-top: 1px solid var(--line); }
.agl-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 14px;
  align-items: center; padding: 10px 0;
}
.agl-hd { display: flex; align-items: center; gap: 8px; min-width: 0; }
.agl-mon { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.agl-st {
  font-size: 11px; line-height: 1.5; padding: 2px 8px; border-radius: 999px;
  background: #eef2f6; color: #475569; white-space: nowrap;
}
.agl-st.run { background: #eef2ff; color: #4f46e5; }
.agl-st.warn { background: #fffbeb; color: #b45309; }
.agl-st.bad { background: #fef2f2; color: #dc2626; }
.agl-meta { grid-column: 1; font-size: 12px; color: var(--muted); }
.agl-row .agl-go { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
/* 风险行直接复用问题发现那张行（图标 / 标题 / 处理态 / 动作都在那儿定义），
   只把边框换成列表统一的那条分隔线，免得两套行在同一片区域里画出两种线 */
.agx-land .sd-row { border-bottom: 0; padding: 10px 0; cursor: default; }
.agl-none, .agl-more { padding: 8px 0; font-size: 12px; color: var(--muted); }
.agl-note { padding: 8px 0; font-size: 12px; }
.agl-note.bad { color: #b3261e; }
/* 默认页原来两张卡上下叠着各占满幅：一行「2026-11 ……………… 核算这一期」由
   grid 的 1fr/auto 把按钮推到近 900px 外，读一行眼睛要横跨整栏；更要命的是
   八期任务把「合规风险」顶到首屏之外——而这页存在的意义就是先看到风险。
   宽栏时两张并排（各自 440px 起、上限 620px）：横向距离收回来，风险卡当场在眼里。
   这里用 flex 自排而不是 @media：三栏下工作区宽度是对话列之外的部分，
   决定排布的是这一栏自己有多宽，不是屏幕有多宽 */
.agx-land:not([hidden]) {
  display: flex; flex-direction: row; flex-wrap: wrap; gap: 14px;
  align-items: flex-start;
}
.agx-land > .agxw-card {
  flex: 1 1 min(440px, 100%); max-width: 620px; min-width: 0;
}
/* 半栏里风险标题那一行 nowrap + 省略号会把「（2026-10、2026-09…）」截掉，
   这几期正是要点开的东西——默认页内允许它折行，别让人去猜被截的月份 */
.agx-land .sd-t1 { white-space: normal; }
@media (max-width: 900px) {
  .agl-row { grid-template-columns: minmax(0, 1fr); }
  .agl-row .agl-go { grid-column: 1; grid-row: auto; justify-self: start; }
}

/* 工作台里对话列内部：消息流自己滚，输入框吸在列底 */
#view-flex .agx-chat, #view-ediag .agx-chat { display: flex; flex-direction: column; overflow: hidden; }
#view-flex .agx-chat-bd, #view-ediag .agx-chat-bd { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
#view-flex .fx-agent, #view-ediag .ed-main { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
/* 消息区吃掉对话列的剩余高度：原来写死 max-height，套进定宽对话列后会留一大块空白 */
#view-flex .fx-msgs, #view-ediag .ed-msgs {
  flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto;
}

@media (max-width: 1280px) {
  .agx3.is-chat { flex-direction: column; height: auto; }
  .agx3.is-chat > .agx-chat { width: auto; flex: 0 0 auto; height: 62vh; }
  .agx3.is-chat > .agx-work { overflow: visible; }
  #view-flex, #view-ediag { overflow: auto; }
  /* 巡检三页窄屏同样改成上下堆叠：整页可滚，对话列定高、内容列跟在下面 */
  #view-ediag_land, #view-ediag_run, #view-ediag_result { overflow: auto; }
  /* 窄屏放不下三栏：对话区在上、工作区在下，各自整宽 */
  #view-chat.is-agent { flex-direction: column; overflow: auto; }
  #view-chat.is-agent #agx-chat-col { width: auto; flex: 0 0 auto; height: 62vh; }
  #view-chat.is-agent #agx-work:not([hidden]) { overflow: visible; }
}
@media (max-width: 1200px) {
  .agx3.is-wide { grid-template-columns: 1fr; }
  .agx3.is-wide > .agx-rail { position: static; }
}

/* ============================================================
   减线之后：分层靠底色，不靠描边
   —— 全站表面描边已删（见 .tmp/deline.py 的口径），剩下的线只有
      var(--line) 一档：列表行、表格行、页签底边这类内部分隔。
   —— 页面本身是白的，所以原先「白盒子 + 1px 描边」换成「浅灰盒子」：
      L0 白页面 / L1 卡与面板（--bg-soft）/ L2 卡里再套的块（白）/
      控件（--panel-2，比 L1 深一档，贴在白页和灰卡上都看得见）/
      浮层（弹层、登录卡、报告纸面）保持白底 + 阴影，它本来就浮在别的东西上。
   ============================================================ */

/* L1 面板：原来靠描边立住的那一层。
   四个主页的输入卡、快捷问法与核算、用电数据那几页的入口卡不在这里——它们照附图
   是白底 + 软阴影，贴在白页上靠阴影立住，涂成灰反而和页面糊成一片 */
.card, .stat, .sd-card, .task-card, .tool-card, .cb-card,
.fxl-card, .iss-box, .rp-row, .rp-srcs, .rp-hl, .fxt-res,
.ov-pane, .fx-board, .fx-tool-pre, .rm-metric, .rm-trace,
.quick-card, .cf-agent, .hrec-row, .blz-row, .bl-bill,
.bl-check, .dqb-bld, .edl-stat, .edl-run, .edl-ev, .edh-task, .edf-concl,
.edr-event, .ed-evi, .edr-metric, .ed-task, .ed-concl, .ed-issues,
.dqr-blk, .agxw-card, .agxw-sum, .agxw-data, .agxw-raw,
.cbt-stats, .pilot-way, .task-opt, .msg.need, .msg.job, .edl-ai,
.rp-kpi, .bld-metric, .bl-meter-t, .dqr-i, .cf-cand, .task-pilot, .bl-sum,
.ed-step, .edh-type, .tc-row {
  background: var(--bg-soft);
}
/* L2：灰卡里再套的块换回白底，同色就糊成一片了 */
.agxc, .agvd, .fxl-rc, .oc-kpi, .chart-box, .fx-card, .msg.assistant table,
.msg.assistant code, .msg.assistant pre.md-pre, .msg.assistant .md-quote {
  background: var(--panel);
}
/* 灰卡上的悬停也得是白，不然划过没有反应 */
.sd-row:hover, .agl-list > *:hover, .hrec-row:hover {
  background: var(--panel);
}
/* 两处实测出来的「白贴在白上」：左列行、巡检首页右侧那条最近任务 */
.card-list .row, #view-ediag_land .edh-recent { background: var(--bg-soft); }
/* 经营中心：四张 KPI 的格子本身是透明的（#ov-quad 覆盖了 .ov-pane），
   所以底色要落在卡片上；待办行是灰格上的白片，留白就够，不再描边 */
#ov-quad .oc-kpi { background: var(--bg-soft); }
.oc-td { border: 0; background: var(--panel); }

/* 控件：按钮、胶囊、标签、页签。灰一档而不是描边。
   巡检 .edl-chip 只管追问那一排；第一屏的问法跟另外两页一起走白底卡面那套 */
.btn, .chip, .ed-chip, .fxt-chips .chip, .edl-chip, .edl-tab, .edl-back,
.fx-chip, .bld-chip, .dqb-chip, .ar-cand, .role-tag, .rp-tab, .se-tab,
.edl-sel, .edr-tabs button, .attach-chip, .user-chip, .bl-rb, .rp-sel,
.agent-pill, .g-ico, .edl-more {
  background: var(--panel-2); border: 0;
}
.btn:hover, .chip:hover, .ed-chip:hover, .rp-tab:hover, .se-tab:hover,
.edl-tab:hover, .edl-chip:hover, .attach-chip:hover,
.agent-pill:hover, .edr-tabs button:hover, .bld-chip:hover, .dqb-chip:hover {
  background: #e9ebef;
}

/* 输入控件（表单字段，不是自然语言交互框）：灰底，聚焦转白当反馈 */
.input, .editor, .cf-grid input, .cf-grid select, .dqb-grid input {
  background: var(--bg-soft); border: 0;
}
.input:focus, .editor:focus, .cf-grid input:focus, .cf-grid select:focus,
.dqb-grid input:focus { background: var(--panel); }
/* 字段落在灰面（L1 卡）上时反过来：描边不画了，只能靠底色反差说明「这里能填」 */
.card .input, .card .editor, .card .cf-grid input, .card .cf-grid select,
.stat .input, .sd-card .input, .agxc .input,
.fx-board .input, .agxw-card .input { background: var(--panel); }

/* 自然语言交互框：全站一套规格——无底色、无描边、无上传键。
   工作台 / 智能问答 / 四个 Agent 首页与工作页用的是同一个 #composer（app.js mountChatNodes），
   核算台与柔性看板用的是 .atc（composer.js createAgentTaskComposer），
   体检输入 .ed-input、柔性输入 #fx-input、巡检追问 .edl-res-input 也照同一规格来。
   焦点不再画框：靠光标本身，落文件时给一次浅绿底（.composer-box.drag） */
.composer-box, .atc, .ed-input, .fx-input-row .input, .edl-res-input,
.fxt-config .atc, #view-chat.is-agent .composer-box, .agx-chat .composer-box {
  background: transparent; border: 0; box-shadow: none;
}
.composer-box:focus-within, .atc:focus-within { box-shadow: none; }
.composer textarea, .atc-input, .ed-input:focus, .edl-res-input:focus { background: transparent; }
/* 悬浮工具行（发送键、Agent 选择）不跟着透明，否则灰底灰键粘在页面上找不到 */
.composer-bar .send-btn { background: #17181a; }

/* 浮层：白底 + 阴影，不描边 */
.pop-menu, .login-card, .cb-agent-pop, .chat-jump, #rp-frame, .rp-page,
.modal-card, .agxw-jump {
  background: var(--panel); border: 0; box-shadow: var(--shadow-lg);
}
.rp-page { box-shadow: var(--shadow); }

