
/* 0820-i18n-6 防闪烁门控：仅非 zh 时挂 html.i18n-pending（语言包缓存命中或 fetch 进行中），隐藏 body 避免中文初始值闪现；zh 不加 */
html.i18n-pending body { visibility: hidden; }
:root {
  --bg: #f8fafc; --fg: #0f172a; --muted: #64748b;
  --card: #ffffff; --border: #e2e8f0; --accent: #0f172a; --accent-soft: rgba(15,23,42,0.06);
  --green: #16a34a; --gray: #9ca3af; --danger: #dc2626; --danger-hover: #b91c1c;
  --demo-border: #ddd3f5; --demo-card-bg: #fdfbff; --radius-sm: 6px; --radius-md: 10px; --radius-lg: 14px; --radius-xl: 18px; --radius-pill: 999px;
}
[data-theme="dark"] {
  --bg: #0a0e14; --fg: #e2e8f0; --muted: #94a3b8;
  --card: #0e1420; --border: #1e293b; --accent: #e2e8f0; --accent-soft: rgba(226,232,240,0.06);
  --green: #22c55e; --gray: #52525b;
  --demo-border: #4c3d7a; --demo-card-bg: #221c33;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: var(--bg); color: var(--fg); font-family: -apple-system, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 8px 24px 32px; }
header { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.logo svg { width: 26px; height: 26px; color: var(--accent); }
/* logo 图标 = 返回官网首页入口（仅图标可点，文字不受 <a> 的 hover/visited 影响） */
.logo > a.logo-home { display: inline-flex; align-items: center; color: inherit; cursor: pointer; }
.logo > a.logo-home:hover,
.logo > a.logo-home:visited,
.logo > a.logo-home:active { color: inherit; }
.logo > a.logo-home svg { color: var(--accent); }
.logo .sub { color: var(--muted); font-weight: 400; font-size: 13px; margin-left: 4px; }
.hdr-actions { display: flex; align-items: center; gap: 12px; }
.back { font-size: 13px; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--fg); }
.theme-btn { background: var(--card); border: 1px solid var(--border); color: var(--fg); border-radius: var(--radius-md); padding: 6px 12px; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
/* 语言切换器（三站同款，0820 i18n） */
.lang-wrap { position: relative; }
.lang-btn-ico { width: 14px; height: 14px; stroke: currentColor; flex-shrink: 0; }
.lang-cur { min-width: 20px; text-align: center; }
/* ===== RTL（العربية）布局统一 =====
   与 style.css 同款：header 固定按 ltr 布局（logo 左 / 控件右），避免阿语下控件镜像到左侧；
   语言文字单独还原为 rtl。（status / governance / monitor 不引 style.css，故此处需重复一份） */
[dir="rtl"] header { direction: ltr; }
[dir="rtl"] header .lang-cur,
[dir="rtl"] header .lang-opt,
[dir="rtl"] header .gh-link span { direction: rtl; unicode-bidi: isolate; }
[dir="rtl"] header .logo .mono { direction: ltr; unicode-bidi: isolate; }

.lang-menu { position: absolute; top: calc(100% + 6px); inset-inline-end: 0; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 6px; min-width: 158px; display: none; flex-direction: column; gap: 2px; box-shadow: 0 12px 32px rgba(0,0,0,.12); z-index: 50; }
[data-theme="dark"] .lang-menu { box-shadow: 0 12px 32px rgba(0,0,0,.55); }
.lang-menu.open { display: flex; }
.lang-opt { display: flex; align-items: center; gap: 8px; width: 100%; text-align: start; background: none; border: none; color: var(--fg); font-size: 13px; padding: 8px 12px; border-radius: var(--radius-sm); cursor: pointer; }
.lang-opt:hover { background: var(--accent-soft); }
.lang-opt.active { font-weight: 600; }
@media (max-width: 640px) {
  .lang-cur { display: none; }
}
.layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; }
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.panel-head { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.panel-head h2 { font-size: 15px; font-weight: 600; }
.panel-head .hint { font-size: 12px; color: var(--muted); }
#office { width: 100%; display: block; }
.canvas-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; position: relative; }
.feed { max-height: 560px; overflow-y: auto; }
.feed-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 18px; border-bottom: 1px solid var(--border); font-size: 13px; }
.feed-item:last-child { border-bottom: none; }
.feed-item .t { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.feed-item .dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 4px; flex-shrink: 0; }
.feed-item .dot.active { background: var(--green); }
.feed-item .dot.idle { background: var(--gray); }
.feed-item .who { font-weight: 600; white-space: nowrap; }
.feed-item .what { color: var(--muted); flex: 1; min-width: 0; word-break: break-word; overflow-wrap: anywhere; }
.feed-item .what.fail { color: var(--danger); }
.feed-item .what .fail-reason { font-size: 11px; color: var(--muted); font-weight: 400; }
.feed-item .act-tag { font-size: 11px; padding: 1px 6px; border-radius: var(--radius-sm); background: var(--border); color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.feed-item .act-tag.done { background: rgba(22, 163, 74, .14); color: var(--green); }
.feed-item .dot.fail { background: var(--danger); }
.legend { display: flex; gap: 16px; padding: 10px 18px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

/* ===== Tab 导航 ===== */
.tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.tab-btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 16px; background: none; border: none; box-shadow: inset 0 -2px 0 transparent; color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer; transition: color .15s, box-shadow .15s; }
.tab-btn svg { width: 15px; height: 15px; }
.tab-btn:hover { color: var(--fg); }
.tab-btn.active { color: var(--fg); box-shadow: inset 0 -2px 0 var(--accent); font-weight: 600; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ===== Kanban 看板 ===== */
.kb-members { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; padding: 14px 18px; }
.kb-member { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 12px; }
.kb-member .nm { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.kb-member .nm .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gray); }
.kb-member .nm .dot.run { background: var(--green); }
.kb-member .nm .dot.blk { background: var(--danger); }
.kb-member .cnt { font-size: 12px; color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }
.kb-member .latest { font-size: 11.5px; color: var(--muted); margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kb-member .latest::before { content: "最近 · "; color: var(--muted); }
.kb-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 14px 18px; }
.kb-col { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md); min-height: 90px; max-height: min(480px, 60vh); overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(136,136,136,.45) transparent; }
.kb-col::-webkit-scrollbar { width: 6px; }
.kb-col::-webkit-scrollbar-track { background: transparent; }
.kb-col::-webkit-scrollbar-thumb { background: rgba(136,136,136,.45); border-radius: 3px; }
.kb-col::-webkit-scrollbar-thumb:hover { background: rgba(136,136,136,.7); }
.kb-col-head { position: sticky; top: 0; z-index: 1; background: var(--bg); padding: 8px 12px; font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 6px; color: var(--muted); }
.kb-col-head .n { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 500; }
.kb-col-head .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gray); flex-shrink: 0; }
.kb-col-head .dot.run { background: var(--green); }
.kb-col-head .dot.blk { background: var(--danger); }
.kb-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-md); margin: 8px; padding: 10px 12px; }
.kb-card .tt { font-weight: 600; font-size: 12.5px; line-height: 1.45; }
.kb-card .meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 7px; font-size: 11.5px; color: var(--muted); }
.kb-card .meta .who { font-weight: 600; color: var(--fg); display: inline-flex; align-items: center; gap: 4px; }
.kb-card .meta .who svg, .kb-card .meta .tm svg { width: 12px; height: 12px; }
.kb-card .meta .tm { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; }
.kb-card .prio { font-size: 10.5px; padding: 1px 6px; border-radius: var(--radius-sm); background: var(--border); color: var(--muted); font-variant-numeric: tabular-nums; }
.kb-card .why { display: flex; align-items: center; gap: 4px; margin-top: 6px; font-size: 11.5px; color: #b45309; }
.kb-card .why svg { width: 12px; height: 12px; flex-shrink: 0; }
/* 0821-轨A-8: 人在 loop 工作台入口卡片 */
.wb-entry { display: flex; align-items: center; gap: 12px; margin: 14px 18px 6px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: linear-gradient(90deg, var(--accent-soft), transparent 70%); text-decoration: none; color: var(--fg); transition: border-color .15s, background .15s; }
.wb-entry:hover { border-color: var(--accent); }
.wb-entry .wb-ico { width: 20px; height: 20px; color: var(--accent); flex-shrink: 0; }
.wb-entry .wb-txt { flex: 1; min-width: 0; }
.wb-entry .wb-txt b { font-size: 14px; display: block; }
.wb-entry .wb-txt span { font-size: 12px; color: var(--muted); display: block; margin-top: 2px; }
.wb-entry .wb-go { color: var(--muted); font-size: 15px; flex-shrink: 0; }
.kb-summary { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 12px 18px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }
.kb-summary b { color: var(--fg); font-variant-numeric: tabular-nums; font-weight: 600; }
.kb-empty { padding: 26px 18px; text-align: center; color: var(--muted); font-size: 12px; }

/* ===== Kanban demo 分区（22-4：访客体验任务，独立隔离板，视觉区分）===== */
.kb-demo-panel { border: 1px solid var(--demo-border); }
.kb-demo-panel .panel-head { background: linear-gradient(90deg, rgba(124, 58, 237, .06), transparent 55%); }
.kb-demo-panel .panel-head h2 { display: inline-flex; align-items: center; gap: 8px; }
.kb-demo-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; letter-spacing: .04em;
  padding: 2px 8px; border-radius: var(--radius-pill);
  color: #fff; background: linear-gradient(135deg, #7c3aed, #a855f7);
  box-shadow: 0 1px 3px rgba(124, 58, 237, .35);
}
.kb-demo-badge svg { width: 10px; height: 10px; }
.kb-demo-note { font-size: 12px; color: var(--muted); }
.kb-card.demo { border-color: var(--demo-border); border-left: 3px solid #a855f7; background: var(--demo-card-bg); }
.kb-card.demo .tt { display: flex; align-items: flex-start; gap: 6px; }
.kb-card.demo .tt .tt-text { min-width: 0; }
.kb-demo-tag {
  flex-shrink: 0; display: inline-flex; align-items: center;
  font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: var(--radius-sm);
  color: #a855f7; background: rgba(124, 58, 237, .1); border: 1px solid rgba(124, 58, 237, .28);
}
.kb-col-head .dot.demo { background: #a855f7; }

/* ===== 16b: demo 事件实时三块联动 ===== */
/* 潘明工位高亮（DOM 叠层跟随 canvas 坐标，不动 canvas 绘制核心） */
.demo-glow {
  position: absolute; width: 60px; height: 60px; border-radius: 50%;
  border: 3px solid #a855f7; box-shadow: 0 0 14px rgba(168, 85, 247, .55), inset 0 0 10px rgba(168, 85, 247, .18);
  transform: translate(-50%, -50%); pointer-events: none; z-index: 3;
  animation: demo-glow-breathe 1.5s ease-in-out infinite;
}
.demo-bubble {
  position: absolute; transform: translate(-50%, -100%);
  background: var(--card); border: 1px solid var(--demo-border); border-radius: var(--radius-md);
  padding: 5px 10px; font-size: 12px; font-weight: 600; color: var(--fg);
  white-space: nowrap; pointer-events: none; z-index: 3;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .14);
}
.demo-bubble::after {
  content: ""; position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--demo-border);
}
.demo-bubble .who { color: #a855f7; }
@keyframes demo-glow-breathe {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: .95; }
  50% { transform: translate(-50%, -50%) scale(1.15); opacity: .5; }
}
/* demo 新卡出现：高亮闪烁 2 次后稳定 */
.kb-card.demo.flash { animation: demo-card-flash 1.1s ease-out 2; }
@keyframes demo-card-flash {
  0% { box-shadow: 0 0 0 0 rgba(168, 85, 247, .6); background: rgba(168, 85, 247, .16); border-color: #a855f7; }
  100% { box-shadow: 0 0 0 14px rgba(168, 85, 247, 0); background: var(--demo-card-bg); }
}
.kb-card .why.fail { color: var(--danger); }
/* feed 实时条目（demo 事件插入，DEMO 徽标 + 实时标识） */
.feed-item.demo {
  background: linear-gradient(90deg, rgba(124, 58, 237, .06), transparent 75%);
  border-left: 3px solid #a855f7;
}
.feed-item.demo .act-tag { background: rgba(124, 58, 237, .12); color: #a855f7; font-weight: 600; }
.feed-item.demo .act-tag.done { background: rgba(22, 163, 74, .14); color: var(--green); }
.feed-item.demo .dot.active { background: #a855f7; }
.feed-item .demo-tag {
  flex-shrink: 0; margin-left: auto; align-self: center;
  font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: var(--radius-sm);
  color: #a855f7; background: rgba(124, 58, 237, .1); border: 1px solid rgba(124, 58, 237, .28);
  white-space: nowrap;
}
/* 进度条每步事件时间（16b: 弱化「等报告」感） */
.demo-step .tm { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.demo-step.done .tm, .demo-step.cur .tm { color: var(--green); }
.demo-step.fail .tm { color: var(--danger); }


/* ===== Demo 体验（12b）===== */
.tabs .demo-btn {
  margin-left: auto;
  margin-bottom: 13px;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 14px; /* 上下 9px 与 .tab-btn 一致；去掉负 margin，margin box = border box，align-items:center 即内容居中 */
  background: var(--card); color: var(--fg);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.tabs .demo-btn svg { width: 15px; height: 15px; }
.tabs .demo-btn:hover { border-color: var(--accent); }
.modal-mask {
  position: fixed; inset: 0; background: rgba(20, 20, 23, .45);
  display: none; align-items: center; justify-content: center;
  z-index: 100; padding: 24px;
}
.modal-mask.show { display: flex; }
/* 22-7: pop 面板打开时锁定背景滚动（桌面滚轮 + 移动触摸），关闭恢复且不丢位置 */
html.scroll-lock, body.scroll-lock { overflow: hidden; }
.modal-body, .report-pane, #histList, .report-cols { overscroll-behavior: contain; }
.modal {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  width: 100%; max-width: 580px; max-height: 86vh; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .18);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.modal-head h3 svg { width: 16px; height: 16px; }
.modal-close {
  background: none; border: none; color: var(--muted); cursor: pointer;
  display: inline-flex; padding: 4px; border-radius: var(--radius-sm);
}
.modal-close:hover { color: var(--fg); background: var(--bg); }
.modal-close svg { width: 16px; height: 16px; }
.modal-body { padding: 16px 18px; overflow-y: auto; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.demo-card {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--border); border-radius: var(--radius-md); padding: 12px;
  cursor: pointer; background: var(--card); color: var(--fg); font-family: inherit; text-align: left;
  transition: border-color .15s, background .15s;
}
.demo-card:hover { border-color: var(--accent); background: var(--bg); }
.demo-card:disabled { opacity: .55; cursor: not-allowed; }
.demo-card .ic {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: var(--radius-md);
  background: var(--bg); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.demo-card .ic svg { width: 17px; height: 17px; }
.demo-card .tx { min-width: 0; }
.demo-card .tx .t { display: block; font-size: 13px; font-weight: 600; }
.demo-card .tx .d { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
@media (max-width: 520px) { .demo-grid { grid-template-columns: 1fr; } }
.modal-note { font-size: 12.5px; margin-top: 12px; border-radius: var(--radius-md); padding: 8px 12px; display: none; line-height: 1.5; }
.modal-note.err { display: block; color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, transparent); border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent); }
.modal-note.ok { display: block; color: var(--green); background: rgba(22, 163, 74, .08); border: 1px solid rgba(22, 163, 74, .25); }

/* 自由提问交互（体验一下弹窗） */
.demo-intro { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 0 0 14px; }
.demo-ask { display: flex; flex-direction: column; gap: 10px; }
.demo-q {
  width: 100%; resize: vertical; min-height: 72px;
  font-family: inherit; font-size: 13.5px; line-height: 1.6; color: var(--fg);
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 10px 12px; box-sizing: border-box;
  transition: border-color .15s, box-shadow .15s;
}
.demo-q:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.demo-q::placeholder { color: var(--muted); }
.demo-ask-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.demo-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.primary-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--radius-md);
  background: var(--accent); color: #fff; border: none;
  font-family: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: opacity .15s, transform .05s;
}
.primary-btn:hover { opacity: .92; }
.primary-btn:active { transform: translateY(1px); }
.primary-btn:disabled { opacity: .6; cursor: not-allowed; }
[data-theme="dark"] .primary-btn { color: #0f172a; }
.demo-result { margin-top: 14px; }
.demo-result:empty { display: none; }
.demo-answer-banner { margin-bottom: 16px; }
.demo-answer-banner:empty { display: none; }
/* 思考动画 */
.think { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg); }
.think-dots { display: inline-flex; gap: 4px; }
.think-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: inline-block; animation: think-bounce 1.2s infinite ease-in-out both; }
.think-dots i:nth-child(1) { animation-delay: -0.32s; }
.think-dots i:nth-child(2) { animation-delay: -0.16s; }
.think-txt { font-size: 13.5px; color: var(--fg); }
@keyframes think-bounce { 0%, 80%, 100% { transform: scale(0.5); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }
/* 通用回答卡片 */
.ans-card { display: flex; gap: 12px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--card); }
.ans-icon { flex-shrink: 0; width: 34px; height: 34px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--green) 12%, transparent); color: var(--green); }
.ans-icon svg { width: 18px; height: 18px; }
.ans-body { min-width: 0; }
.ans-title { font-size: 14px; font-weight: 600; color: var(--fg); }
.ans-text { font-size: 13.5px; line-height: 1.6; color: var(--fg); margin-top: 4px; }
.ans-note { font-size: 12px; line-height: 1.5; color: var(--muted); margin-top: 8px; }

/* demo 进度条（看板 tab 头部） */
.demo-progress { margin-bottom: 16px; display: none; }
.demo-progress.show { display: block; }
.demo-steps { display: flex; align-items: flex-start; padding: 18px 22px 8px; }
.demo-step { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; position: relative; }
.demo-step .dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--border); background: var(--card); }
.demo-step.done .dot { background: var(--green); border-color: var(--green); }
.demo-step.cur .dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 3px var(--border); animation: demo-pulse 1.6s ease-in-out infinite; }
.demo-step.fail .dot { background: var(--danger); border-color: var(--danger); }
.demo-step .lbl { font-size: 12px; color: var(--muted); white-space: nowrap; }
.demo-step.done .lbl, .demo-step.cur .lbl { color: var(--fg); font-weight: 600; }
.demo-step::after { content: ""; position: absolute; top: 5px; left: calc(50% + 8px); width: calc(100% - 16px); height: 2px; background: var(--border); }
.demo-step:last-child::after { display: none; }
.demo-step.done::after { background: var(--green); }
@keyframes demo-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
.demo-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 18px 16px; font-size: 12px; flex-wrap: wrap; }
.demo-meta .row { display: inline-flex; align-items: center; gap: 6px; }
.demo-meta .row svg { width: 13px; height: 13px; flex-shrink: 0; }
.demo-meta .muted { color: var(--muted); }
.demo-meta .muted::before { content: " · "; color: var(--muted); }

/* 报告弹窗 markdown 渲染 + 历史回看（22-6 左右分栏：左历史列表 + 右报告内容） */
.report-body { font-size: 13.5px; line-height: 1.7; }
.report-body h1, .report-body h2, .report-body h3 { margin: 14px 0 8px; line-height: 1.4; font-weight: 600; }
.report-body h1 { font-size: 17px; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.report-body h2 { font-size: 15px; }
.report-body h3 { font-size: 13.5px; }
.report-body p { margin: 6px 0; }
.report-body ul, .report-body ol { margin: 6px 0; padding-left: 20px; }
.report-body li { margin: 3px 0; }
.report-body a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.report-body code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1px 5px; }
.report-body pre { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 12px; overflow-x: auto; margin: 8px 0; }
.report-body pre code { background: none; border: none; padding: 0; }
.report-body table { border-collapse: collapse; margin: 8px 0; width: max-content; min-width: 100%; font-size: 12.5px; }
.report-body .tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.report-body th, .report-body td { border: 1px solid var(--border); padding: 5px 9px; text-align: left; white-space: nowrap; }
.report-body td.wrap { max-width: 34em; overflow-wrap: anywhere; white-space: normal; }
.report-body th { background: var(--bg); font-weight: 600; }
.report-body blockquote { border-left: 3px solid var(--border); padding-left: 10px; color: var(--muted); margin: 8px 0; }
.report-body hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.report-loading, .report-empty { padding: 28px 18px; text-align: center; color: var(--muted); font-size: 12.5px; }
/* 22-6：报告弹窗加宽以容纳左右分栏（仅报告弹窗，demoModal 不受影响） */
#reportModal .modal { max-width: 860px; }
.report-cols { display: flex; flex: 1; min-height: 0; overflow: hidden; }
.hist-pane {
  width: 250px; flex-shrink: 0; min-height: 0;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
}
.hist-pane .hist-head {
  padding: 12px 16px 8px; font-size: 12px; font-weight: 600; color: var(--muted);
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.hist-pane .hist-head svg { width: 13px; height: 13px; }
#histList { overflow-y: auto; min-height: 0; flex: 1; padding-bottom: 8px; }
.hist-item { display: flex; align-items: center; gap: 8px; padding: 9px 16px; font-size: 12.5px; border-top: 1px solid var(--border); cursor: pointer; }
.hist-item:hover { background: var(--bg); }
.hist-item.selected { background: var(--bg); box-shadow: inset 3px 0 0 var(--accent); }
.hist-item.selected .hist-lbl { font-weight: 600; }
.hist-item svg { width: 13px; height: 13px; flex-shrink: 0; color: var(--muted); }
.hist-item .hist-lbl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-item .tm { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 11.5px; flex-shrink: 0; margin-left: auto; }
.hist-item .st { font-size: 11px; padding: 1px 7px; border-radius: var(--radius-sm); background: var(--border); color: var(--muted); flex-shrink: 0; }
.hist-item .st.ok { background: rgba(22, 163, 74, .14); color: var(--green); }
.hist-item .st.fail { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.report-pane { flex: 1; min-width: 0; overflow-y: auto; padding: 16px 18px; }
/* 0818-aa：报告底部转化 CTA（静态区块，不弹窗不悬浮；黑灰视觉与 .report-body 字体体系一致，禁 emoji） */
.report-cta { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.report-cta .cta-star { font-size: 13.5px; line-height: 1.7; }
.report-cta .cta-star a { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.report-cta .cta-head { margin-top: 18px; font-size: 13.5px; font-weight: 600; }
.report-cta textarea {
  width: 100%; box-sizing: border-box; min-height: 76px; resize: vertical;
  margin-top: 8px; background: var(--card); color: var(--fg);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 9px 11px; font-size: 13px; font-family: inherit; line-height: 1.55;
}
.report-cta textarea:focus { outline: none; border-color: var(--accent); }
.report-cta .cta-mail {
  width: 100%; box-sizing: border-box; margin-top: 8px;
  background: var(--card); color: var(--fg);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 8px 11px; font-size: 13px; font-family: inherit;
}
.report-cta .cta-mail:focus { outline: none; border-color: var(--accent); }
.report-cta .cta-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.report-cta .cta-count { font-size: 12px; color: var(--muted); }
.report-cta .cta-reply {
  margin-top: 12px; padding: 10px 12px;
  background: var(--demo-card-bg); border: 1px solid var(--demo-border);
  border-radius: var(--radius-md); font-size: 13px; line-height: 1.65; white-space: pre-wrap;
}

/* 全局轻提示 */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(10px);
  background: var(--fg); color: var(--bg); font-size: 12.5px;
  padding: 9px 16px; border-radius: var(--radius-md); z-index: 200; opacity: 0;
  pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
/* 连接提示条（SSE 断线/降级时显示，页面不白屏） */
.conn-bar {
  display: none; align-items: center; gap: 8px;
  padding: 8px 14px; margin-bottom: 12px;
  border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent); border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--danger) 6%, transparent); color: var(--danger); font-size: 12.5px;
}
.conn-bar.show { display: flex; }
.conn-bar svg { width: 14px; height: 14px; flex-shrink: 0; }

/* ===== 官网 AI 助理（0818-a P0）：访客问答表单 ===== */
.asst-body { padding: 16px 18px; }
.asst-body textarea {
  width: 100%; min-height: 88px; resize: vertical;
  background: var(--card); color: var(--fg);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 10px 12px; font-size: 13px; font-family: inherit; line-height: 1.55;
}
.asst-body textarea:focus { outline: none; border-color: var(--accent); }
.asst-mail {
  width: 100%; margin-top: 10px;
  background: var(--card); color: var(--fg);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 9px 12px; font-size: 13px; font-family: inherit;
}
.asst-mail:focus { outline: none; border-color: var(--accent); }
.asst-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.asst-hint { font-size: 12px; color: var(--muted); }
.asst-reply {
  margin-top: 14px; padding: 12px 14px;
  background: var(--demo-card-bg); border: 1px solid var(--demo-border);
  border-radius: var(--radius-md); font-size: 13px; line-height: 1.65; white-space: pre-wrap;
}
.asst-reply .asst-note { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; }
@media (max-width: 1100px) { .kb-cols { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .kb-cols { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }

/* ===== 移动端适配（17b）===== */
/* canvas 保持可读比例：窄屏下 1180 位图等比缩放到 560px 宽（不再 100% 压缩到 310px 不可读），
   外层 .canvas-scroll 横向滚动查看，页面本身无横向滚动 */
@media (max-width: 900px) {
  #office { width: 560px; }
}
@media (max-width: 620px) {
  /* header 单行：隐藏副标题（移动端空间有限），返回链接/按钮可点区域 ≥44px */
  .logo .sub { display: none; }
  header { flex-wrap: wrap; gap: 4px 12px; }
  .back { display: inline-flex; align-items: center; min-height: 44px; }
  .hdr-actions { margin-left: auto; }
  .theme-btn { min-height: 44px; }
  /* 0820-hd：actions 组内仍可能超宽（两个 back 长链接 + 语言/主题按钮，de@390 曾 395px 溢出）——
     组内允许换行右对齐（超宽时分两行）+ 主题按钮只留图标（font-size:0 藏文字），零横向溢出 */
  .hdr-actions { flex-wrap: wrap; justify-content: flex-end; row-gap: 4px; }
  .theme-btn { font-size: 0; }
  .tab-btn { min-height: 44px; }
  .tabs .demo-btn { min-height: 44px; }
  /* 弹窗关闭按钮可点区域 ≥44px */
  .modal-close { min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }
  /* 活动流：时间戳/动作标签不再强制不换行，避免窄屏挤压 */
  .feed-item { flex-wrap: wrap; }
  .feed-item .t { white-space: nowrap; }
  .feed-item .what { min-width: 0; flex: 1 1 auto; }
  /* 22-6：报告弹窗窄屏改上下堆叠——历史列表在上（限高滚动），报告在下，不横向溢出 */
  #reportModal .modal { max-width: 100%; }
  .report-cols { flex-direction: column; overflow-y: auto; }
  .hist-pane { width: 100%; border-right: none; border-bottom: 1px solid var(--border); max-height: 200px; }
  #histList { overflow-y: auto; }
  .report-pane { overflow-y: visible; }
}
/* tab 栏窄屏单行（21b）：压缩间距/字号 + 隐藏 tab 后缀文字，375px 下三按钮一行不换行 */
@media (max-width: 520px) {
  .tabs { gap: 4px; }
  .tab-btn { padding: 9px 8px; font-size: 12.5px; gap: 5px; }
  .tab-btn svg { width: 13px; height: 13px; }
  .tab-btn .ts { display: none; }
  .tabs .demo-btn { padding: 8px 10px; font-size: 12.5px; gap: 5px; }
  .tabs .demo-btn svg { width: 13px; height: 13px; }
}
/* 悬浮反馈组件（0820-fb-3，复用 0820-fb-2/fb-2b blog 组件视觉规格）：右下球 + mini 独立反馈表单。
   提交走 /api/feedback(page=opc, source=opc_feedback)，零 LLM；埋点 /api/v1/knock/feedback fire-and-forget；
   独立实现不调用 assistant modal；全文案 data-i18n 7 语；z-index 90 低于 modal-mask(100)；禁 emoji 全 SVG。 */
.fb-ball {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #ffffff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 90;
  box-shadow: 0 6px 20px var(--accent-soft);
  transition: transform .2s ease, box-shadow .2s ease;
}
[data-theme="dark"] .fb-ball { color: #0a0e14; }
.fb-ball:hover { transform: translateY(-2px); box-shadow: 0 10px 26px var(--accent-soft); }
.fb-ball:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fb-ball svg { width: 20px; height: 20px; }

.fb-panel {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  width: 320px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 132px);
  overflow-y: auto;
  z-index: 90;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 48px var(--accent-soft);
  padding: 18px 18px 14px;
  font-size: 13px;
  color: var(--fg);
  opacity: 0; visibility: hidden; transform: translateY(8px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.fb-panel.fb-open { opacity: 1; visibility: visible; transform: none; pointer-events: auto; }
.fb-head { font-size: 14px; font-weight: 700; }
.fb-sub { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 6px 0 12px; }
.fb-ta {
  width: 100%; min-height: 84px; resize: vertical;
  border: 1px solid var(--border); background: var(--bg); color: var(--fg);
  border-radius: var(--radius-md); padding: 9px 12px; font-size: 13px;
  font-family: inherit; line-height: 1.6; outline: none;
  transition: border-color .15s;
}
.fb-ta:focus { border-color: var(--accent); }
.fb-mail {
  width: 100%; margin-top: 10px;
  border: 1px solid var(--border); background: var(--bg); color: var(--fg);
  border-radius: var(--radius-md); padding: 8px 12px; font-size: 13px; outline: none;
  transition: border-color .15s;
}
.fb-mail:focus { border-color: var(--accent); }
.fb-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.fb-count { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.fb-send {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); color: var(--bg); border: none;
  border-radius: var(--radius-md); padding: 8px 16px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: opacity .15s;
}
.fb-send:hover { opacity: .8; }
.fb-send:disabled { opacity: .5; cursor: not-allowed; }
.fb-status { font-size: 12px; margin-top: 10px; color: var(--muted); line-height: 1.5; }
.fb-status.fb-err { color: var(--fg); font-weight: 600; }
@media (prefers-reduced-motion: reduce) {
  .fb-ball, .fb-panel { transition: none; }
}

/* ===== LLM 网关区块（0825-e：当前 provider + 余额/用量 + 切换历史）===== */
.gw-body { display: flex; flex-direction: column; gap: 18px; }
.gw-current { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px; background: var(--card); display: flex; flex-direction: column; gap: 10px; }
.gw-current-head { display: flex; align-items: center; gap: 8px; }
.gw-label { font-size: 12.5px; color: var(--muted); }
.gw-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gray); margin-inline-start: auto; }
.gw-live-dot.on { background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 25%, transparent); }
.gw-live-dot.tripped { background: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 25%, transparent); }
.gw-current-main { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.gw-provider { font-size: 22px; font-weight: 700; letter-spacing: .3px; }
.gw-state { font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: var(--radius-pill); }
.gw-state.healthy { background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); }
.gw-state.tripped { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.gw-state.disabled { background: color-mix(in srgb, var(--gray) 18%, transparent); color: var(--muted); }
.gw-state.unknown { background: color-mix(in srgb, var(--gray) 18%, transparent); color: var(--muted); }
.gw-current-sub { font-size: 12.5px; color: var(--muted); }
.gw-table-wrap { overflow-x: auto; }
.gw-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.gw-table th { text-align: start; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.gw-table td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.gw-table tr:last-child td { border-bottom: none; }
.gw-table td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.gw-pname { font-weight: 600; }
.gw-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: var(--radius-pill); }
.gw-badge.ok { background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); }
.gw-badge.bad { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.gw-badge.gray { background: color-mix(in srgb, var(--gray) 18%, transparent); color: var(--muted); }
.gw-disabled-reason { font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.gw-hist-head { display: flex; align-items: baseline; gap: 10px; margin-top: 4px; }
.gw-hist-head h3 { margin: 0; font-size: 14px; }
.gw-timeline { margin-top: 12px; }
.gw-tl-item { position: relative; padding: 0 0 16px 22px; border-inline-start: 2px solid var(--border); margin-inline-start: 6px; }
[dir="rtl"] .gw-tl-item { padding: 0 22px 16px 0; border-inline-start: none; border-inline-end: 2px solid var(--border); margin-inline-start: 0; margin-inline-end: 6px; }
.gw-tl-item:last-child { border-inline-start-color: transparent; }
[dir="rtl"] .gw-tl-item:last-child { border-inline-end-color: transparent; }
.gw-tl-dot { position: absolute; inset-inline-start: -6px; top: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--bg); border: 2px solid var(--border); }
[dir="rtl"] .gw-tl-dot { inset-inline-start: auto; inset-inline-end: -6px; }
.gw-tl-item.trip .gw-tl-dot { border-color: var(--danger); background: var(--danger); }
.gw-tl-item.recover .gw-tl-dot { border-color: var(--green); background: var(--green); }
.gw-tl-item.failover .gw-tl-dot, .gw-tl-item.startup .gw-tl-dot { border-color: var(--accent); background: var(--accent); }
.gw-tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gw-tl-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.gw-tl-type { font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: var(--radius-pill); }
.gw-tl-type.trip { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.gw-tl-type.recover { background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); }
.gw-tl-type.upstream_error { background: color-mix(in srgb, #d97706 15%, transparent); color: #d97706; }
.gw-tl-type.startup, .gw-tl-type.failover { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.gw-tl-provider { font-weight: 600; font-size: 12.5px; }
.gw-tl-note { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.gw-empty { padding: 36px 0; text-align: center; color: var(--muted); font-size: 13px; }
@media (max-width: 640px) {
  .gw-current-main { flex-direction: column; gap: 6px; }
  .gw-table { font-size: 12px; }
}
