/* ---------------------------------------------------------------
   对话端补充样式。颜色、圆角、阴影全部沿用 app.css 的变量。
   --------------------------------------------------------------- */

/* 流式输出时的光标 */
.md .caret{display:inline-block;width:6px;height:13px;background:var(--brand);border-radius:2px;margin-left:2px;vertical-align:-2px;animation:blink 1s steps(2) infinite}
@keyframes blink{0%,50%{opacity:1}51%,100%{opacity:0}}

/* 只读行（管理员配置的能力） */
.row.ro{background:var(--surface-alt);border:1px solid var(--line);border-radius:11px;padding:11px 13px;margin-bottom:10px}
.row.ro .row-t{display:flex;align-items:center;gap:6px}
.row.ro .badge{font-size:10.5px;color:var(--ink-3);background:var(--surface-tint);border:1px solid var(--line);border-radius:5px;padding:1px 6px;font-weight:400}

/* 分段选择（回答长度） */
.seg3{display:inline-flex;padding:2px;border-radius:9px;background:#f5f5f5;border:1px solid var(--line)}
.seg3 button{padding:4px 10px;border-radius:7px;font-size:12px;color:var(--ink-2);transition:.14s}
.seg3 button.on{background:#fff;color:var(--ink);font-weight:600;box-shadow:0 1px 3px rgba(17,19,24,.08)}

/* 上传进度 */
.upbar{height:4px;border-radius:999px;background:var(--surface-tint);overflow:hidden;margin-top:8px}
.upbar i{display:block;height:100%;background:var(--brand);width:0;transition:width .3s}
.upmeta{font-size:11px;color:var(--ink-3);margin-top:5px;line-height:1.5}

/* 引用折叠按钮（原 .ev-head 已有，这里只补"来源链接"） */
.ev-src{margin-left:auto;font-size:10.5px;color:var(--brand-deep);text-decoration:none}
.ev-src:hover{text-decoration:underline}

/* 检索统计条 */
.ragbar{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.ragbar span{font-size:10.5px;color:var(--ink-3);background:var(--surface-alt);border:1px solid var(--line);border-radius:6px;padding:1px 6px;font-variant-numeric:tabular-nums}
.ragbar span b{color:var(--ink-2);font-weight:600}

/* 无会话提示 */
.empty-conv{padding:26px 10px;text-align:center;font-size:12px;color:#8a8a8a;line-height:1.7}

@media (max-width:600px){
  .seg3 button{padding:4px 7px;font-size:11.5px}
}


/* 常驻聊天记录总结中心 */
.history-center{position:fixed;inset:0;z-index:1200;background:rgba(0,0,0,.48);backdrop-filter:blur(5px);display:grid;place-items:center;padding:18px}
.history-card{width:min(1120px,100%);height:min(820px,calc(100vh - 36px));background:var(--surface);border:1px solid var(--line);border-radius:18px;box-shadow:0 24px 80px rgba(0,0,0,.25);display:flex;flex-direction:column;overflow:hidden}
.history-head{height:68px;flex:0 0 68px;display:flex;align-items:center;justify-content:space-between;padding:0 20px;border-bottom:1px solid var(--line);gap:14px}
.history-head>div:first-child{display:flex;flex-direction:column;gap:4px;min-width:0}
.history-head b{font-size:15px;color:var(--ink)}
.history-head span{font-size:11px;color:var(--ink-3)}
.history-head-actions{display:flex;align-items:center;gap:8px}
.history-btn{height:32px;padding:0 11px;border:1px solid var(--line-2);border-radius:8px;background:var(--surface);color:var(--ink-2);font-size:11.5px;cursor:pointer}
.history-btn.primary{background:var(--brand);border-color:var(--brand);color:white}
.history-btn.danger{color:#555555;border-color:#e5e5e5}
.history-btn:disabled{opacity:.5;cursor:default}
.history-close{width:32px;height:32px;border:0;border-radius:8px;background:var(--surface-alt);font-size:22px;color:var(--ink-2);cursor:pointer}
.history-main{flex:1;min-height:0;display:grid;grid-template-columns:330px minmax(0,1fr)}
.history-list-pane{min-height:0;display:flex;flex-direction:column;border-right:1px solid var(--line);background:var(--surface-alt)}
.history-search{height:38px;flex:0 0 38px;margin:13px;border:1px solid var(--line);border-radius:9px;padding:0 11px;background:var(--surface);font-family:inherit;font-size:12px;outline:none;color:var(--ink)}
.history-search:focus{border-color:var(--brand)}
.history-list{flex:1;min-height:0;overflow:auto;padding:0 9px 12px}
.history-row{width:100%;display:flex;flex-direction:column;gap:5px;text-align:left;padding:12px 11px;margin:0 0 5px;border:1px solid transparent;border-radius:10px;background:transparent;cursor:pointer;color:var(--ink)}
.history-row:hover,.history-row.on{background:var(--surface);border-color:var(--line)}
.history-row b{font-size:12px;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.history-row-meta{font-size:10px;color:var(--ink-4)}
.history-row small{font-size:10.5px;color:var(--ink-3);line-height:1.5;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.history-detail{min-width:0;min-height:0;display:flex;flex-direction:column;padding:18px 20px;overflow:hidden}
.history-detail-head{flex:0 0 auto;display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.history-detail-title{font-size:15px;font-weight:700;color:var(--ink);width:100%}
.history-detail-meta{font-size:10.5px;color:var(--ink-3);flex:1}
.history-detail-actions{display:flex;gap:6px;flex-wrap:wrap}
.history-summary{flex:0 0 auto;margin:14px 0;padding:12px 14px;background:var(--surface-alt);border:1px solid var(--line);border-radius:11px;max-height:170px;overflow:auto}
.history-summary b{font-size:11.5px;color:var(--ink)}
.history-summary p{font-size:11.5px;line-height:1.7;color:var(--ink-2);white-space:pre-wrap;margin:7px 0 0}
.history-transcript{flex:1;min-height:0;overflow:auto;display:flex;flex-direction:column;gap:9px;padding:3px 3px 16px}
.history-message{max-width:88%;padding:10px 12px;border:1px solid var(--line);border-radius:11px;background:var(--surface-alt)}
.history-message.user{align-self:flex-end;background:var(--brand);border-color:var(--brand);color:white}
.history-message b{font-size:10px;display:block;margin-bottom:5px;opacity:.8}
.history-message p{font-size:11.5px;line-height:1.65;white-space:pre-wrap;overflow-wrap:anywhere;margin:0}
.history-message small{font-size:9px;display:block;margin-top:6px;opacity:.65}
.history-empty{padding:25px 12px;text-align:center;color:var(--ink-3);font-size:11.5px;line-height:1.7}
.detail-empty{margin:auto}
@media(max-width:760px){
  .history-center{padding:0}
  .history-card{height:100vh;width:100%;border-radius:0}
  .history-head{padding:0 12px;height:60px;flex-basis:60px}
  .history-head span{display:none}
  .history-head-actions{gap:5px}
  .history-main{grid-template-columns: minmax(110px,34%) minmax(0,1fr)}
  .history-detail{padding:13px 10px}
  .history-detail-actions{gap:4px}
  .history-btn{padding:0 7px;font-size:10px}
  .history-summary{max-height:145px;padding:10px}
}
@media(max-width:480px){
  #top-summary .lbl{display:none}
  #top-handoff .lbl{display:none}
  .history-main{grid-template-columns:120px minmax(0,1fr)}
  .history-row{padding:10px 7px}
  .history-row b{font-size:10.5px}
  .history-row-meta,.history-row small{font-size:9px}
}

/* Customer-facing website chat workbench */
.site-workbench{position:fixed;inset:0;z-index:1200;background:rgba(0,0,0,.52);backdrop-filter:blur(7px);display:none;align-items:center;justify-content:center;padding:18px}
.site-workbench.on{display:flex}
.site-workbench-card{width:min(1480px,100%);height:min(940px,calc(100vh - 36px));background:#fafafa;border:1px solid #e5e5e5;border-radius:20px;box-shadow:0 28px 100px rgba(0,0,0,.28);display:flex;flex-direction:column;overflow:hidden}
.site-workbench-head{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:17px 22px;background:#fff;border-bottom:1px solid #e5e5e5}
.site-workbench-title{font-size:17px;font-weight:750;color:#111111;letter-spacing:-.02em}
.site-workbench-sub{font-size:12px;color:#8a8a8a;margin-top:4px}
.site-workbench-close{width:34px;height:34px;border:1px solid #e5e5e5;border-radius:10px;background:#fff;color:#8a8a8a;font-size:24px;line-height:1;cursor:pointer}
.site-workbench-body{flex:1;min-height:0;display:grid;grid-template-columns:minmax(330px,420px) minmax(0,1fr);gap:0}
.site-workbench-controls{overflow:auto;background:#fff;border-right:1px solid #e5e5e5;padding:17px 18px 24px}
.site-control-section{padding:0 0 18px;margin:0 0 18px;border-bottom:1px solid #f5f5f5}
.site-control-section:last-child{border-bottom:0;margin-bottom:0}
.site-section-title{font-size:13px;font-weight:750;color:#111111;margin-bottom:11px}
.site-enable-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 13px;background:#fafafa;border:1px solid #f5f5f5;border-radius:12px;cursor:pointer}
.site-enable-row b{display:block;font-size:12px;color:#555555}
.site-enable-row small{display:block;font-size:10.5px;color:#8a8a8a;margin-top:4px}
.site-enable-row input{width:17px;height:17px;accent-color:#555555}
.site-style-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.site-style-card{position:relative;text-align:left;min-width:0;padding:8px;border:1.5px solid #e5e5e5;border-radius:12px;background:#fff;cursor:pointer;transition:border-color .15s,box-shadow .15s}
.site-style-card:hover{border-color:#8a8a8a}
.site-style-card.on{border-color:#555555;box-shadow:0 0 0 3px #55555514}
.site-style-thumb{height:72px;display:block;position:relative;overflow:hidden;border-radius:8px;background:#f5f5f5;border:1px solid #f5f5f5}
.site-style-thumb i{position:absolute;display:block}
.site-style-thumb .thumb-head{left:0;right:0;top:0;height:16px;background:#555555}
.site-style-thumb .thumb-user{right:7px;top:25px;width:46%;height:10px;border-radius:8px 8px 2px 8px;background:#555555}
.site-style-thumb .thumb-agent{left:7px;top:40px;width:58%;height:10px;border-radius:8px 8px 8px 2px;background:#fff;border:1px solid #e5e5e5}
.site-style-thumb .thumb-agent.short{top:54px;width:39%}
.site-style-thumb .thumb-input{left:7px;right:7px;bottom:3px;height:4px;border-radius:4px;background:#e5e5e5}
.site-style-thumb.white{background:#fff}
.site-style-thumb.white .thumb-head{background:#fff;border-bottom:1px solid #e5e5e5}
.site-style-thumb.white .thumb-user{background:#555555}
.site-style-thumb.green .thumb-head,.site-style-thumb.green .thumb-user{background:#0c9b6b}
.site-style-thumb.dark{background:#111111;border-color:#555555}
.site-style-thumb.dark .thumb-head{background:#111111}
.site-style-thumb.dark .thumb-agent{background:#111111;border-color:#555555}
.site-style-thumb.dark .thumb-input{background:#555555}
.site-style-name{display:block;font-size:11.5px;font-weight:750;color:#111111;margin-top:8px}
.site-style-desc{display:block;font-size:10px;color:#8a8a8a;margin-top:3px;line-height:1.4;min-height:28px}
.site-style-check{display:block;font-size:9.5px;color:#555555;margin-top:5px}
.site-field-hint{font-size:10.5px;line-height:1.6;color:#8a8a8a;margin-top:8px}
.site-field{display:flex;flex-direction:column;gap:6px;margin:0 0 11px}
.site-field>span{font-size:11px;font-weight:650;color:#555555}
.site-field input:not([type=color]),.site-field textarea{width:100%;border:1px solid #e5e5e5;border-radius:9px;padding:9px 10px;font:inherit;font-size:12px;line-height:1.5;color:#111111;background:#fff;outline:none}
.site-field input:focus,.site-field textarea:focus{border-color:#8a8a8a;box-shadow:0 0 0 3px #55555512}
.site-field textarea{resize:vertical;min-height:66px}
.site-color-field{flex-direction:row;align-items:center;justify-content:space-between}
.site-color-field input{width:54px;height:32px;border:1px solid #e5e5e5;border-radius:8px;background:#fff;padding:3px;cursor:pointer}
.site-code-note{font-size:10.5px;color:#8a8a8a;line-height:1.6;margin:-3px 0 8px}
.site-code{max-height:88px;overflow:auto;white-space:pre-wrap;word-break:break-all;background:#111111;color:#e5e5e5;border-radius:10px;padding:10px;font:10px/1.6 ui-monospace,SFMono-Regular,Consolas,monospace}
.site-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:9px}
.site-action{border:1px solid #e5e5e5;background:#fff;color:#555555;border-radius:9px;padding:9px 12px;font-size:11px;font-weight:700;cursor:pointer}
.site-action.primary{background:#555555;color:#fff;border-color:#555555}
.site-action:disabled{opacity:.55;cursor:wait}
.site-preview-area{min-width:0;min-height:0;display:flex;flex-direction:column;padding:18px;background:#f5f5f5}
.site-preview-toolbar{height:42px;flex:0 0 42px;display:flex;align-items:center;gap:13px;padding:0 12px;background:#fff;border:1px solid #e5e5e5;border-bottom:0;border-radius:12px 12px 0 0}
.site-browser-dots{display:flex;gap:5px}
.site-browser-dots i{width:7px;height:7px;border-radius:50%;background:#e5e5e5}
.site-browser-dots i:first-child{background:#e5e5e5}.site-browser-dots i:nth-child(2){background:#e5e5e5}.site-browser-dots i:nth-child(3){background:#8dcba5}
.site-browser-address{flex:1;min-width:0;border:1px solid #f5f5f5;background:#fafafa;border-radius:7px;padding:5px 10px;font-size:10px;color:#8a8a8a;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.site-browser-address b{font-weight:600;color:#8a8a8a}
.site-preview-toolbar button{border:0;background:transparent;color:#555555;font-size:10.5px;font-weight:700;cursor:pointer}
.site-preview-stage{position:relative;flex:1;min-height:0;background:#fff;border:1px solid #e5e5e5;border-radius:0 0 12px 12px;overflow:hidden}
.site-preview-stage iframe{display:block;width:100%;height:100%;border:0;background:#fff}
.site-preview-caption{display:flex;justify-content:space-between;gap:12px;padding:9px 2px 0;font-size:10px;color:#8a8a8a}
.site-preview-caption span:first-child{font-weight:700;color:#555555}
@media(max-width:900px){.site-workbench{padding:0}.site-workbench-card{height:100vh;border-radius:0}.site-workbench-body{grid-template-columns:1fr;grid-template-rows:minmax(280px,46%) minmax(260px,54%)}.site-workbench-controls{border-right:0;border-bottom:1px solid #e5e5e5}.site-preview-area{padding:10px}.site-preview-caption{display:none}}
@media(max-width:520px){.site-workbench-head{padding:13px 15px}.site-workbench-title{font-size:15px}.site-workbench-sub{font-size:10px}.site-workbench-body{grid-template-rows:minmax(300px,55%) minmax(220px,45%)}.site-workbench-controls{padding:13px}.site-style-grid{gap:7px}.site-style-thumb{height:58px}}

/* Four-tab settings layout after adding tenant-owned WeCom binding */
#tabs{overflow-x:auto;scrollbar-width:none}#tabs::-webkit-scrollbar{display:none}#tabs .tab{flex:1;min-width:max-content;padding-left:8px;padding-right:8px;font-size:12px}


/* v1.9.0：统一的文档式设置窗口、启动状态与聊天消息布局 */
.boot-screen{
  position:fixed;inset:0;z-index:70;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;
  background:radial-gradient(900px 470px at 8% -12%,rgba(0,0,0,.08),transparent 62%),var(--bg);
  color:var(--ink-2);transition:opacity .18s ease,visibility .18s ease;
}
.boot-screen.hide{opacity:0;visibility:hidden;pointer-events:none}
.boot-mark{width:42px;height:42px;border-radius:13px;display:grid;place-items:center;background:var(--brand);color:#fff;font-weight:750;letter-spacing:.02em;box-shadow:0 8px 22px rgba(0,0,0,.2)}
.boot-spinner{width:20px;height:20px;border:2px solid #e5e5e5;border-top-color:var(--brand);border-radius:50%;animation:dsh-boot-spin .75s linear infinite}
.boot-text{font-size:12px;color:var(--ink-3)}
@keyframes dsh-boot-spin{to{transform:rotate(360deg)}}

/* 普通设置：从右侧抽屉改成页面中央的长方形文档窗口 */
.mask{z-index:100;backdrop-filter:blur(3px)}
.sheet{
  z-index:101;
  top:50%;left:50%;right:auto;bottom:auto;
  width:min(1040px,calc(100vw - 64px));
  height:min(760px,calc(100dvh - 64px));
  border:1px solid var(--line);border-radius:20px;
  box-shadow:0 28px 90px rgba(0,0,0,.22);
  transform:translate(-50%,-47%) scale(.985);
  opacity:0;visibility:hidden;pointer-events:none;
  transition:transform .22s ease,opacity .22s ease,visibility .22s ease;
  overflow:hidden;
}
.sheet.on{transform:translate(-50%,-50%) scale(1);opacity:1;visibility:visible;pointer-events:auto}
.sheet-head{padding:20px 24px 0}
.sheet-title h2{font-size:18px}
.sheet-sub{font-size:12px;line-height:1.6}
.sheet-body{padding:20px 24px 12px}
.sheet-foot{padding:14px 24px}
.sheet .tabs{gap:6px;overflow-x:auto;scrollbar-width:none}
.sheet .tabs::-webkit-scrollbar{display:none}
.sheet .tab{white-space:nowrap}
.sheet .sec-title{font-size:13px}
.sheet .sec-hint,.sheet .row-d,.sheet .hint{font-size:12px;line-height:1.65}
.sheet .field label{font-size:12px}
.sheet .field input,.sheet .field textarea,.sheet .field select{font-size:13px}
.sheet .btn{min-height:36px}
@media(max-width:700px){
  .sheet{width:calc(100vw - 20px);height:calc(100dvh - 24px);border-radius:16px}
  .sheet-head{padding:14px 14px 0}
  .sheet-body{padding:14px 14px 8px}
  .sheet-foot{padding:10px 14px}
  .sheet .tabs{margin-top:10px}
}

/* 网站客服工作台：同一套 DSH 白底、蓝色、圆角与间距，不再铺满桌面 */
.site-workbench{z-index:1200;padding:24px;background:rgba(0,0,0,.38);backdrop-filter:blur(4px)}
.site-workbench-card{
  width:min(1160px,calc(100vw - 64px));
  height:min(790px,calc(100dvh - 64px));
  border:1px solid var(--line);border-radius:20px;
  box-shadow:0 28px 90px rgba(0,0,0,.24);
}
.site-workbench-head{padding:16px 22px;min-height:68px}
.site-workbench-title{font-family:var(--font);font-size:17px;color:var(--ink);font-weight:700}
.site-workbench-sub{font-family:var(--font);font-size:12px;color:var(--ink-3)}
.site-workbench-head-actions{display:flex;align-items:center;gap:8px}
.site-workbench-back{height:34px;padding:0 12px;border:1px solid var(--line-strong);border-radius:9px;background:#fff;color:var(--ink-2);font-size:12px}
.site-workbench-back:hover{border-color:#e5e5e5;color:var(--brand)}
.site-workbench-close{font-family:var(--font);font-size:22px}
.site-workbench-body{grid-template-columns:minmax(300px,370px) minmax(0,1fr)}
.site-workbench-controls{padding:18px 18px 22px}
.site-section-title{color:var(--ink);font-size:13px}
.site-field>span{color:var(--ink-2);font-size:12px}
.site-field-hint,.site-code-note{font-size:11px;color:var(--ink-3)}
.site-field input:not([type=color]),.site-field textarea{font-family:var(--font);font-size:12px;color:var(--ink)}
.site-action{font-family:var(--font);font-size:12px;min-height:36px}
.site-action.primary{background:var(--brand);border-color:var(--brand)}
.site-preview-area{padding:14px;background:#f5f5f5}
.site-preview-toolbar{border-color:var(--line);border-radius:11px 11px 0 0}
.site-preview-stage{border-color:var(--line);border-radius:0 0 11px 11px}
.site-preview-caption{font-family:var(--font);font-size:10.5px}
.site-start-screen{flex:1;min-height:0;display:grid;place-items:center;padding:30px;background:linear-gradient(145deg,#fafafa,#f5f5f5)}
.site-start-screen[hidden]{display:none!important}
.site-start-card{width:min(540px,100%);padding:36px 38px;text-align:center;background:#fff;border:1px solid var(--line);border-radius:20px;box-shadow:var(--sh-2)}
.site-start-mark{width:54px;height:54px;margin:0 auto 15px;display:grid;place-items:center;border-radius:16px;background:var(--brand-soft);color:var(--brand)}
.site-start-eyebrow{font-size:10px;letter-spacing:.15em;font-weight:750;color:var(--brand)}
.site-start-card h3{margin:9px 0 10px;font-size:23px;letter-spacing:-.03em;color:var(--ink)}
.site-start-card p{max-width:420px;margin:0 auto;color:var(--ink-3);font-size:12px;line-height:1.8}
.site-start-facts{display:flex;justify-content:center;gap:22px;margin:22px 0 24px;color:var(--ink-3);font-size:11px}
.site-start-facts span{display:flex;flex-direction:column;gap:3px}
.site-start-facts b{font-size:15px;color:var(--brand)}
.site-start-button{min-width:150px;min-height:42px;font-size:13px}
.site-start-status{margin-top:13px;color:var(--ink-3);font-size:10.5px;line-height:1.6}
.site-start-screen[hidden] + .site-workbench-body{display:grid}
@media(max-width:900px){
  .site-workbench{padding:12px}
  .site-workbench-card{width:calc(100vw - 24px);height:calc(100dvh - 24px);border-radius:16px}
  .site-workbench-body{grid-template-columns:1fr;grid-template-rows:minmax(270px,48%) minmax(240px,52%)}
  .site-workbench-controls{border-right:0;border-bottom:1px solid var(--line)}
  .site-preview-area{padding:10px}
}
@media(max-width:520px){
  .site-workbench-head{padding:12px 14px;min-height:60px}
  .site-workbench-title{font-size:15px}
  .site-workbench-sub{font-size:10px}
  .site-start-screen{padding:16px}
  .site-start-card{padding:25px 18px}
  .site-start-card h3{font-size:20px}
  .site-start-facts{gap:14px}
  .site-workbench-body{grid-template-rows:minmax(280px,56%) minmax(210px,44%)}
  .site-workbench-controls{padding:13px}
}

/* 聊天气泡只包文字；操作图标和精确到秒的时间放在气泡下面 */
.msg{align-items:flex-start}
.msg-content{display:flex;flex:0 1 auto;flex-direction:column;align-items:flex-start;gap:0;min-width:0;max-width:calc(100% - 42px);width:fit-content}
.msg.user .msg-content{align-items:flex-end}
.msg .bubble{
  display:block;width:fit-content;max-width:100%;min-width:0;
  padding:11px 15px;border:1px solid var(--line);border-radius:16px 16px 16px 5px;
  background:#fff;color:var(--ink);box-shadow:var(--sh-1);overflow-wrap:anywhere;
}
.msg.assistant .bubble{padding:11px 15px;background:#fff;border:1px solid var(--line);border-radius:16px 16px 16px 5px;color:var(--ink);box-shadow:var(--sh-1)}
.msg.user .bubble{background:#f5f5f5;border-color:#e5e5e5;color:#111111;border-radius:16px 16px 5px 16px}
.msg .body{width:fit-content;max-width:100%;min-width:0;overflow-wrap:anywhere;word-break:break-word}
.msg .body p:last-child{margin-bottom:0}
.msg .body p:first-child{margin-top:0}
.msg-meta{display:flex;align-items:center;gap:8px;width:100%;min-height:25px;margin-top:3px}
.msg.assistant .msg-meta{justify-content:flex-start}
.msg.user .msg-meta{justify-content:flex-end}
.msg-actions{display:flex;align-items:center;gap:3px;margin:0;opacity:.7;transition:opacity .15s}
.msg:hover .msg-actions{opacity:1}
.act{width:25px;height:25px;display:grid;place-items:center;border-radius:7px;color:var(--ink-3);padding:0}
.act:hover{background:var(--surface-tint);color:var(--brand)}
.act.on{color:var(--brand);background:var(--brand-soft)}
.msg-time{display:block;margin:0;color:#8a8a8a;font-size:10.5px;line-height:1.4;white-space:nowrap;font-variant-numeric:tabular-nums}
.msg-extras{width:100%;max-width:100%;min-width:0}
.msg-extras .ev-slot{width:100%}
.auto-follow-label{font-size:10.5px;color:var(--ink-3);margin:0 0 5px;letter-spacing:.02em}
@media(hover:hover){
  .msg:not(:hover) .msg-actions{opacity:.52}
}
@media(max-width:920px){
  .msg-content{max-width:calc(100% - 38px)}
}
@media(max-width:600px){
  .msg-content{max-width:calc(100% - 35px)}
  .msg .bubble{max-width:100%;padding:10px 12px}
  .msg-meta{gap:6px;min-height:24px}
  .act{width:26px;height:26px}
  .msg-time{font-size:10px}
}

/* 手机端将次要操作收进更多菜单，所有原功能仍可访问 */
.top-more-wrap{display:none;position:relative;flex:none}
.top-more-menu{
  position:absolute;right:0;top:calc(100% + 9px);z-index:90;display:none;min-width:176px;
  padding:6px;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:var(--sh-2)
}
.top-more-menu.on{display:block}
.top-more-menu button{display:flex;align-items:center;gap:10px;width:100%;padding:10px 11px;border-radius:8px;text-align:left;font-size:12px;color:var(--ink-2)}
.top-more-menu button:hover{background:var(--surface-tint);color:var(--ink)}
.more-icon{width:18px;text-align:center;color:var(--brand);font-size:15px}
@media(max-width:600px){
  .topbar{position:relative}
  .top-more-wrap{display:block}
  #top-summary,#top-handoff,#top-website{display:none!important}
  #top-more{display:inline-flex}
  .top-more-menu{right:0}
}
.toast{z-index:1400}

/* Customer knowledge-base chunk manager */
.kb-file-row{display:flex;align-items:center;gap:10px;padding:11px 12px}
.kb-file-row .f-main{flex:1;min-width:0}
.kb-file-actions{display:flex;align-items:center;gap:6px;flex:0 0 auto}
.kb-mini-btn{height:29px;padding:0 9px;border:1px solid var(--line);border-radius:7px;background:#fff;color:var(--ink-2);font:inherit;font-size:10.5px;cursor:pointer;white-space:nowrap}
.kb-mini-btn:hover{border-color:var(--brand);color:var(--brand)}
.kb-mini-btn.primary{background:var(--brand);border-color:var(--brand);color:#fff}
.kb-mini-btn.danger{color:#555555;border-color:#e5e5e5}
.kb-mini-btn:disabled{opacity:.55;cursor:wait}
.kb-editor-panel{margin-top:12px;border:1px solid var(--line);border-radius:13px;background:#fff;padding:12px;min-width:0}
.kb-editor-loading,.kb-editor-empty{padding:18px;text-align:center;color:var(--ink-3);font-size:11.5px;line-height:1.6}
.kb-editor-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}
.kb-editor-head b{display:block;font-size:12px;color:var(--ink)}
.kb-editor-head small{display:block;margin-top:3px;color:var(--ink-3);font-size:10px}
.kb-chunk-search{width:100%;height:35px;padding:0 10px;border:1px solid var(--line);border-radius:8px;background:#fff;color:var(--ink);font:inherit;font-size:11px;outline:none;margin:4px 0 10px}
.kb-chunk-search:focus,.kb-chunk-textarea:focus{border-color:var(--brand)}
.kb-chunk-list{display:flex;flex-direction:column;gap:9px}
.kb-chunk-item{border:1px solid var(--line);border-radius:10px;padding:10px;min-width:0}
.kb-chunk-meta{display:flex;justify-content:space-between;gap:8px;align-items:center;margin-bottom:7px}
.kb-chunk-meta b{font-size:10.5px;color:var(--ink-2);font-weight:650}
.kb-chunk-meta span{font-size:9.5px;color:var(--ink-3);background:var(--surface-alt);border-radius:5px;padding:2px 6px}
.kb-chunk-textarea{width:100%;min-height:76px;resize:vertical;padding:9px;border:1px solid var(--line);border-radius:8px;background:#ffffff;color:var(--ink);font:inherit;font-size:11px;line-height:1.65;outline:none;white-space:pre-wrap}
.kb-chunk-actions{display:flex;justify-content:flex-end;gap:6px;margin-top:7px}
.kb-editor-count{font-size:10px;color:var(--ink-3);text-align:right;padding:3px 2px}
.kb-table-preview-list{display:flex;flex-direction:column;gap:9px;margin:10px 0}
.kb-table-preview{border:1px solid var(--line);border-radius:9px;padding:9px;min-width:0}
.kb-table-preview>b{display:block;font-size:10.5px;margin-bottom:7px;color:var(--ink-2)}
.kb-table-preview>small{display:block;margin-top:6px;color:var(--ink-3);font-size:9.5px}
.kb-table-scroll{overflow:auto;max-width:100%}
.kb-table-scroll table{border-collapse:collapse;width:100%;font-size:10px;white-space:nowrap}
.kb-table-scroll th,.kb-table-scroll td{border:1px solid var(--line);padding:5px 7px;text-align:left}
.kb-table-scroll th{background:var(--surface-alt);font-weight:650}
@media(max-width:560px){.kb-file-row{align-items:flex-start;flex-wrap:wrap}.kb-file-actions{margin-left:auto}.kb-mini-btn{font-size:10px;padding:0 7px}}

/* Markdown tables in assistant replies */
.md-table-wrap{max-width:100%;overflow-x:auto;margin:9px 0 12px;border:1px solid var(--line);border-radius:9px;background:#fff}
.md-table{border-collapse:collapse;width:100%;font-size:12px;line-height:1.55;white-space:normal;min-width:360px}
.md-table th,.md-table td{border-bottom:1px solid var(--line);border-right:1px solid var(--line);padding:7px 9px;text-align:left;vertical-align:top;overflow-wrap:anywhere}
.md-table th{background:var(--surface-alt);font-weight:650;color:var(--ink)}
.md-table tr:last-child td{border-bottom:0}
.md-table th:last-child,.md-table td:last-child{border-right:0}

.kb-search-box{border:1px solid var(--line);border-radius:12px;background:#fff;padding:11px 12px;margin:12px 0}
.kb-search-box>b{display:block;font-size:12px;color:var(--ink)}
.kb-search-box>small{display:block;font-size:10px;color:var(--ink-3);margin-top:3px}
.kb-search-controls{display:flex;align-items:center;gap:7px;margin-top:8px}
.kb-search-controls .kb-chunk-search{flex:1;margin:0;min-width:0}
.kb-search-results{display:flex;flex-direction:column;gap:8px;margin-top:9px}
.kb-search-result{border:1px solid var(--line);border-radius:9px;padding:9px;min-width:0}
.kb-search-result-text{font-size:10.5px;color:var(--ink-2);line-height:1.65;white-space:pre-wrap;overflow-wrap:anywhere;margin:7px 0}

/* v1.11.3 Knowledge library: two-pane document workspace */
.sheet.sheet-kb-mode{width:min(1120px,calc(100vw - 48px));height:min(800px,calc(100dvh - 48px));}
.sheet.sheet-kb-mode .sheet-body{display:flex;flex-direction:column;overflow:hidden;padding:14px 20px 16px;}
.sheet.sheet-kb-mode .sheet-foot[hidden]{display:none!important}
.kb-workspace{display:flex;flex-direction:column;gap:12px;flex:1;min-height:0;color:var(--ink);}
.kb-workspace-top{flex:none;display:flex;flex-direction:column;gap:12px;}
.kb-workspace-heading{display:flex;align-items:center;justify-content:space-between;gap:18px;}
.kb-workspace-heading h3{margin:2px 0 3px;font-size:19px;font-weight:700;letter-spacing:-.35px;}
.kb-workspace-heading p{margin:0;color:var(--ink-3);font-size:12px;line-height:1.5;}
.kb-eyebrow{font-size:9px;letter-spacing:1.25px;color:#8a8a8a;font-weight:750;}
.kb-upload-primary{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:36px;padding:0 14px;border:0;border-radius:10px;background:#555555;color:white;font:inherit;font-size:12px;font-weight:650;white-space:nowrap;cursor:pointer;transition:background .15s,transform .15s;}
.kb-upload-primary:hover{background:#555555;transform:translateY(-1px)}
.kb-upload-primary:disabled{opacity:.5;cursor:not-allowed;transform:none}
.kb-metrics{display:flex;align-items:center;gap:0;min-height:48px;padding:7px 12px;background:#fafafa;border-radius:12px;}
.kb-metric{display:flex;align-items:baseline;gap:6px;padding:0 18px;border-right:1px solid #e5e5e5;}
.kb-metric:first-child{padding-left:3px}.kb-metric b{font-size:17px;line-height:1;font-weight:700;color:#111111;font-variant-numeric:tabular-nums}.kb-metric span{font-size:10.5px;color:#8a8a8a}.kb-metric-note{margin-left:auto;border:0;padding-right:3px;}
.kb-toolbar{display:flex;align-items:center;gap:8px;flex:none;}
.kb-library-search{width:100%;height:36px;min-width:0;padding:0 12px;border:1px solid #e5e5e5;border-radius:9px;background:#fff;color:var(--ink);font:inherit;font-size:12px;outline:none;}
.kb-library-search:focus{border-color:#8a8a8a;box-shadow:0 0 0 3px rgba(0,0,0,.08)}
.kb-toolbar>.kb-library-search{max-width:320px;background:#fafafa;border-color:transparent;}
.kb-tool-button{display:inline-flex;align-items:center;justify-content:center;min-height:34px;padding:0 11px;border:0;border-radius:9px;background:#f5f5f5;color:#555555;font:inherit;font-size:11.5px;font-weight:600;cursor:pointer;white-space:nowrap;}
.kb-tool-button:hover,.kb-tool-button.active{background:#f5f5f5;color:#555555}
.kb-global-search-panel{flex:none;padding:13px 15px;background:#fafafa;border-radius:12px;}
.kb-global-search-panel[hidden]{display:none!important}
.kb-global-search-intro{display:flex;flex-direction:column;gap:3px;margin-bottom:9px}.kb-global-search-intro b{font-size:12px}.kb-global-search-intro span{font-size:10.5px;color:var(--ink-3)}
.kb-global-search-row{display:flex;gap:8px}.kb-global-search-row .kb-library-search{flex:1}
.kb-global-search-results{display:flex;flex-direction:column;gap:8px;margin-top:10px;max-height:210px;overflow:auto;}
.kb-global-result{padding:10px 12px;background:white;border-radius:9px;}
.kb-global-result-meta{display:flex;justify-content:space-between;gap:10px;font-size:10.5px}.kb-global-result-meta b{font-weight:650}.kb-global-result-meta span{color:var(--ink-3);white-space:nowrap}
.kb-global-result-text{margin:7px 0;color:#555555;font-size:11px;line-height:1.6;white-space:pre-wrap;overflow-wrap:anywhere;}
.kb-text-action{border:0;background:transparent;padding:3px 0;color:#555555;font:inherit;font-size:11px;font-weight:650;cursor:pointer;}
.kb-text-action:hover{text-decoration:underline}.kb-text-action:disabled{opacity:.4;cursor:not-allowed}
.kb-library-layout{display:grid;grid-template-columns:270px minmax(0,1fr);gap:14px;flex:1;min-height:0;}
.kb-library-pane{display:flex;flex-direction:column;min-height:0;background:#fafafa;border-radius:13px;padding:12px 9px 9px;}
.kb-library-head{display:flex;align-items:center;justify-content:space-between;padding:1px 7px 10px;flex:none;}
.kb-library-head>div{display:flex;align-items:baseline;gap:8px}.kb-library-head b{font-size:12px}.kb-library-head span{font-size:10px;color:var(--ink-3)}
.kb-library-list{display:flex;flex-direction:column;gap:4px;overflow:auto;min-height:0;padding-right:2px;}
.kb-doc-item{display:flex;align-items:center;gap:2px;padding:3px 4px 3px 7px;border-radius:9px;transition:background .12s;}
.kb-doc-item:hover{background:#f5f5f5}.kb-doc-item.active{background:#f5f5f5;}
.kb-doc-select{display:flex;align-items:center;gap:9px;flex:1;min-width:0;text-align:left;padding:7px 2px;border:0;background:transparent;cursor:pointer;}
.kb-doc-icon{width:34px;height:38px;flex:none;display:grid;place-items:center;border-radius:8px;background:#f5f5f5;color:#555555;font-size:8px;font-weight:800;letter-spacing:.2px;}
.kb-doc-item.active .kb-doc-icon{background:#e5e5e5;color:#555555}
.kb-doc-copy{display:flex;flex-direction:column;gap:4px;min-width:0;flex:1}.kb-doc-copy b{font-size:10.5px;font-weight:650;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#555555}.kb-doc-copy small{font-size:9.5px;color:#8a8a8a;}
.kb-doc-chevron{font-size:18px;color:#8a8a8a;line-height:1;}
.kb-doc-delete{width:26px;height:28px;flex:none;border:0;border-radius:7px;background:transparent;color:#8a8a8a;font-size:16px;cursor:pointer;opacity:0;}.kb-doc-item:hover .kb-doc-delete,.kb-doc-delete:focus{opacity:1}.kb-doc-delete:hover{background:#f5f5f5;color:#555555}
.kb-library-empty{padding:22px 12px;text-align:center;color:#8a8a8a;font-size:11px;line-height:1.7;}
.kb-detail{min-width:0;min-height:0;overflow:auto;padding:2px 3px 12px 1px;}
.kb-detail-header{display:flex;align-items:center;gap:11px;padding:3px 1px 12px;border-bottom:1px solid #f5f5f5;}
.kb-doc-icon.large{width:42px;height:46px;font-size:9px;border-radius:10px;}
.kb-detail-file-title{min-width:0;flex:1}.kb-detail-file-title h3{margin:0 0 4px;font-size:14px;font-weight:700;overflow-wrap:anywhere}.kb-detail-file-title p{margin:0;color:var(--ink-3);font-size:10px}.kb-detail-file-title i{font-style:normal;margin:0 4px;color:#e5e5e5}
.kb-detail-header-actions{flex:none}
.kb-detail-tabs{display:flex;gap:18px;border-bottom:1px solid #f5f5f5;margin:0 0 10px;}
.kb-detail-tab{position:relative;padding:11px 1px 10px;border:0;background:transparent;color:#8a8a8a;font:inherit;font-size:11px;font-weight:600;cursor:pointer;}
.kb-detail-tab.active{color:#555555}.kb-detail-tab.active:after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:2px;background:#555555;border-radius:2px;}
.kb-detail-content{min-width:0}.kb-chunk-toolbar{display:flex;align-items:center;gap:10px;margin:7px 0 10px}.kb-chunk-toolbar .kb-library-search{flex:1}.kb-chunk-total{font-size:10px;color:#8a8a8a;white-space:nowrap}
.kb-chunk-cards{display:flex;flex-direction:column;gap:8px;}
.kb-chunk-card{padding:11px 12px;background:#fafafa;border-radius:10px;transition:background .15s,box-shadow .15s;min-width:0;}
.kb-chunk-card.focused{background:#f5f5f5;box-shadow:inset 3px 0 #8a8a8a;}
.kb-chunk-card-meta{display:flex;align-items:center;justify-content:space-between;gap:9px;margin-bottom:6px;}
.kb-chunk-card-meta b{font-size:10.5px;font-weight:650;color:#555555}.kb-chunk-state{font-size:9px;color:#8a8a8a;background:#f5f5f5;border-radius:20px;padding:3px 7px;white-space:nowrap}.kb-chunk-state.revised{background:#e8f5ee;color:#31805b}
.kb-chunk-preview{margin:0 0 5px;color:#555555;font-size:11px;line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere;max-height:94px;overflow:auto;}
.kb-chunk-edit-area[hidden]{display:none!important}.kb-chunk-edit-area .kb-chunk-textarea{margin:2px 0 7px;min-height:110px;font-size:11.5px;background:white;}
.kb-chunk-actions{display:flex;justify-content:flex-end;align-items:center;gap:7px;margin-top:8px;}
.kb-table-intro{margin:9px 0;color:#8a8a8a;font-size:10.5px;line-height:1.5;}
.kb-detail-empty{height:100%;min-height:300px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:24px;}
.kb-empty-symbol{width:54px;height:54px;border-radius:17px;display:grid;place-items:center;background:#f5f5f5;color:#8a8a8a;font-size:25px;margin-bottom:14px;}
.kb-detail-empty h3{margin:0 0 7px;font-size:15px}.kb-detail-empty p{max-width:360px;margin:0 0 16px;color:#8a8a8a;font-size:11px;line-height:1.7;}
.kb-workspace-footnote{flex:none;color:#8a8a8a;font-size:9.5px;line-height:1.5;padding-top:1px;}
.kb-upload-progress{flex:none}.kb-upload-progress[style*="display: none"]{display:none!important}
.kb-upload-progress .upbar{height:4px;background:#f5f5f5;border-radius:9px;overflow:hidden}.kb-upload-progress .upbar i{display:block;height:100%;width:0;background:#555555;transition:width .2s}.kb-upload-progress .upmeta{font-size:10px;color:#8a8a8a;margin-top:4px}
@media(max-width:760px){
 .sheet.sheet-kb-mode{width:calc(100vw - 14px);height:calc(100dvh - 14px);}
 .sheet.sheet-kb-mode .sheet-head{padding:13px 14px 0}.sheet.sheet-kb-mode .sheet-body{padding:12px 12px 10px;}
 .kb-workspace{gap:9px}.kb-workspace-heading h3{font-size:16px}.kb-workspace-heading p{font-size:10.5px;max-width:230px}.kb-upload-primary{min-height:34px;padding:0 10px;font-size:10.5px;}
 .kb-metrics{min-height:42px;padding:6px 8px}.kb-metric{padding:0 9px;gap:4px}.kb-metric b{font-size:14px}.kb-metric span{font-size:9px}.kb-metric-note{display:none}
 .kb-library-layout{grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);gap:8px;}
 .kb-library-pane{max-height:145px;padding:7px 7px 5px}.kb-library-head{padding:1px 5px 5px}.kb-library-list{flex-direction:row;overflow-x:auto;overflow-y:hidden;gap:6px;padding-bottom:2px;}
 .kb-doc-item{flex:0 0 185px;background:#fff;border:1px solid #f5f5f5;padding:2px 5px}.kb-doc-item.active{background:#f5f5f5;border-color:#e5e5e5}.kb-doc-delete{opacity:1}
 .kb-detail{min-height:0;padding:0 1px 10px}.kb-detail-empty{min-height:220px}.kb-global-search-results{max-height:170px}
}
@media(max-width:420px){.kb-workspace-heading{align-items:flex-start}.kb-workspace-heading p{max-width:190px}.kb-doc-item{flex-basis:160px}.kb-metric{padding:0 7px}}

.sheet.sheet-kb-mode .sheet-foot[hidden]{display:none!important}
.kb-library-pane.drag-over{background:#f5f5f5;outline:2px dashed #8a8a8a;outline-offset:-5px}


/* FAQ workspace — consistent with the DSH customer console */
.sheet-faq-mode { width:min(920px, calc(100vw - 36px)); }
.sheet-faq-mode .sheet-body { padding:24px 28px 32px; }
.faq-manager { max-width:820px; margin:0 auto; color:var(--text,#111111); }
.faq-page-head { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; margin-bottom:22px; }
.faq-eyebrow { color:var(--muted,#8a8a8a); font-size:11px; font-weight:700; letter-spacing:.08em; margin-bottom:6px; }
.faq-page-head h3 { margin:0; font-size:23px; letter-spacing:-.03em; }
.faq-page-head p,.faq-help { color:var(--muted,#8a8a8a); font-size:13px; line-height:1.7; margin:8px 0 0; max-width:620px; }
.faq-primary,.faq-secondary,.faq-danger,.faq-back { border:0; border-radius:10px; padding:10px 14px; font:inherit; font-size:13px; font-weight:650; cursor:pointer; transition:background .16s,transform .16s; }
.faq-primary { color:white; background:var(--primary,#555555); box-shadow:0 2px 5px #55555520; white-space:nowrap; }
.faq-primary:hover { background:var(--primary-hover,#555555); transform:translateY(-1px); }
.faq-secondary,.faq-back { color:var(--text,#555555); background:var(--surface-soft,#f5f5f5); }
.faq-secondary:hover,.faq-back:hover { background:var(--surface-hover,#e5e5e5); }
.faq-danger { color:#555555; background:#f5f5f5; }
.faq-primary.small,.faq-secondary.small,.faq-danger.small { padding:7px 11px; font-size:12px; }
.faq-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; margin:0 0 20px; }
.faq-summary>div { display:flex; flex-direction:column; gap:4px; padding:13px 15px; border-radius:12px; background:var(--surface-soft,#f5f5f5); }
.faq-summary b { font-size:21px; line-height:1.1; }
.faq-summary span { font-size:11px; color:var(--muted,#8a8a8a); }
.faq-view-tabs { display:flex; gap:5px; padding:4px; border-radius:11px; background:var(--surface-soft,#f5f5f5); width:max-content; max-width:100%; margin-bottom:16px; }
.faq-view-tabs button { border:0; background:transparent; padding:8px 13px; border-radius:8px; font:inherit; font-size:12px; color:var(--muted,#8a8a8a); cursor:pointer; }
.faq-view-tabs button.active { background:white; color:var(--text,#111111); box-shadow:0 1px 3px #11111112; font-weight:650; }
.faq-content { display:flex; flex-direction:column; gap:12px; }
.faq-search-wrap { margin-bottom:2px; }
.faq-search,.faq-field { display:block; width:100%; box-sizing:border-box; border:1px solid var(--line,#e5e5e5); background:var(--input-bg,#fff); color:var(--text,#111111); border-radius:10px; padding:11px 13px; font:inherit; font-size:13px; outline:none; }
.faq-search:focus,.faq-field:focus { border-color:var(--primary,#555555); box-shadow:0 0 0 3px #55555516; }
.faq-card { padding:16px 17px; background:var(--card,#fff); border:1px solid var(--line,#e5e5e5); border-radius:13px; }
.faq-card-top { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; }
.faq-card-top b { font-size:14px; line-height:1.5; font-weight:700; }
.faq-status,.faq-count { flex:none; border-radius:99px; padding:4px 8px; font-size:10px; font-weight:650; color:#147d50; background:#eaf7f0; }
.faq-status.off { color:#8a8a8a; background:#f5f5f5; }
.faq-count { color:#555555; background:#f5f5f5; }
.faq-answer-preview { color:var(--text-secondary,#555555); font-size:13px; line-height:1.7; margin:10px 0 7px; white-space:pre-wrap; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.faq-meta { font-size:11px; color:var(--muted,#8a8a8a); }
.faq-card-actions { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:7px; margin-top:13px; }
.faq-examples { color:var(--muted,#8a8a8a); font-size:12px; line-height:1.7; margin-top:10px; }
.faq-empty,.faq-loading { padding:34px 18px; text-align:center; color:var(--muted,#8a8a8a); background:var(--surface-soft,#fafafa); border-radius:12px; font-size:13px; line-height:1.7; }
.faq-editor { display:flex; flex-direction:column; gap:16px; max-width:720px; }
.faq-editor-head { display:flex; align-items:center; gap:13px; margin-bottom:2px; }
.faq-editor-head h4 { margin:0; font-size:17px; }
.faq-back { padding:8px 11px; }
.faq-form-field { display:flex; flex-direction:column; gap:7px; }
.faq-form-label { font-size:12px; font-weight:700; }
.faq-form-hint { color:var(--muted,#8a8a8a); font-size:11px; line-height:1.5; }
.faq-field { resize:vertical; min-height:42px; }
.faq-answer-field { min-height:150px; line-height:1.65; }
.faq-enabled-label { display:flex; align-items:center; gap:9px; font-size:12px; color:var(--text-secondary,#555555); }
.faq-enabled-label input { accent-color:var(--primary,#555555); width:16px; height:16px; }
.faq-editor-actions { display:flex; justify-content:flex-end; gap:9px; padding-top:5px; }
@media(max-width:640px) {
  .sheet-faq-mode { width:100vw; max-width:100vw; border-radius:18px 18px 0 0; }
  .sheet-faq-mode .sheet-body { padding:18px 15px 26px; }
  .faq-page-head { flex-direction:column; gap:13px; }
  .faq-page-head .faq-primary { align-self:stretch; }
  .faq-summary { gap:7px; }
  .faq-summary>div { padding:11px; }
  .faq-card { padding:14px; }
  .faq-editor-head { flex-wrap:wrap; }
}


/* FAQ answer provenance and public embed reference cards */
.faq-answer-origin { display:inline-flex; align-items:center; margin:0 0 7px 0; padding:4px 8px; border-radius:999px; color:#24734f; background:#edf8f1; font-size:10.5px; font-weight:650; }
.embed-faq-origin { display:inline-flex; align-self:flex-start; margin:5px 0 3px; padding:3px 8px; border-radius:99px; background:#edf8f1; color:#24734f; font-size:10px; }
.embed-sources { align-self:flex-start; width:min(100%, 360px); margin:6px 0 4px; color:var(--dsh-text,#555555); font-size:11px; }
.embed-sources summary { cursor:pointer; color:var(--dsh-muted,#8a8a8a); font-weight:650; padding:5px 0; }
.embed-source-item { padding:8px 10px; margin:5px 0; border-radius:9px; background:var(--dsh-soft,#f5f5f5); }
.embed-source-item b { display:block; font-size:11px; margin-bottom:4px; }
.embed-source-item p { margin:0; color:var(--dsh-muted,#555555); font-size:10.5px; line-height:1.6; white-space:pre-wrap; }


/* Keep the customer settings navigation usable with the added FAQ workspace tab. */
.tabs { overflow-x:auto; scrollbar-width:none; }
.tabs::-webkit-scrollbar { display:none; }
.tabs .tab { flex:none; white-space:nowrap; }


/* v1.11.6 Settings IA refresh: task-oriented left navigation + focused content */
.sheet:not(.sheet-kb-mode):not(.sheet-faq-mode){width:min(1080px,calc(100vw - 56px));height:min(760px,calc(100dvh - 56px));}
.sheet{
  display:grid;
  grid-template-columns:246px minmax(0,1fr);
  grid-template-rows:minmax(0,1fr) auto;
  grid-template-areas:"nav content" "nav footer";
  background:#fff;
}
.sheet-head{
  grid-area:nav;min-width:0;display:flex;flex-direction:column;align-items:stretch;
  padding:23px 15px 16px;background:#fafafa;border-right:1px solid #f5f5f5;
}
.sheet-title{gap:10px;align-items:center;}
.settings-brand-mark{width:34px;height:34px;flex:none;display:grid;place-items:center;border-radius:11px;background:#555555;color:#fff;font-size:16px;font-weight:800;box-shadow:0 5px 12px rgba(0,0,0,.16)}
.settings-brand-copy{min-width:0;flex:1}
.settings-brand-copy h2{font-size:15px;font-weight:760;line-height:1.25;letter-spacing:-.2px}
.settings-brand-copy span{display:block;margin-top:3px;color:#8a8a8a;font-size:10px}
.sheet-title .close{width:30px;height:30px;background:#fff;border:1px solid #e5e5e5;border-radius:9px}
.sheet-sub{margin:13px 4px 19px;color:#8a8a8a;font-size:10.5px;line-height:1.6}
.sheet .tabs.settings-nav{
  display:flex;flex-direction:column;align-items:stretch;gap:4px;margin:0;padding:0;
  border:0;overflow:visible;min-width:0;
}
.settings-nav-label{padding:0 10px 7px;color:#8a8a8a;font-size:9px;font-weight:750;letter-spacing:.09em;text-transform:uppercase}
.settings-nav-label-spaced{margin-top:18px}
.sheet .tabs.settings-nav .tab{
  position:relative;display:flex;align-items:center;gap:10px;width:100%;min-height:52px;
  padding:8px 10px;border:0;border-radius:10px;background:transparent;text-align:left;
  color:#8a8a8a;white-space:normal;transition:background .14s,color .14s;
}
.sheet .tabs.settings-nav .tab::after{display:none}
.sheet .tabs.settings-nav .tab:hover{background:#f5f5f5;color:#111111}
.sheet .tabs.settings-nav .tab.on{background:#f5f5f5;color:#555555;font-weight:600;}
.settings-nav-icon{width:29px;height:29px;flex:none;display:grid;place-items:center;border-radius:8px;background:#fff;color:#8a8a8a;font-size:16px;box-shadow:0 1px 2px rgba(0,0,0,.05)}
.tab.on .settings-nav-icon{background:#e5e5e5;color:#555555;box-shadow:none}
.settings-nav-copy{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}
.settings-nav-copy b{font-size:11.5px;line-height:1.3;font-weight:680}
.settings-nav-copy small{font-size:9.5px;line-height:1.3;color:#8a8a8a;font-weight:450}
.tab.on .settings-nav-copy small{color:#8a8a8a}
.settings-nav-arrow{font-size:19px;line-height:1;color:#8a8a8a;opacity:0;transform:translateX(-3px);transition:.14s}
.tab:hover .settings-nav-arrow,.tab.on .settings-nav-arrow{opacity:1;transform:none}
.settings-nav-foot{display:flex;align-items:center;gap:7px;margin-top:auto;padding:17px 8px 0;color:#8a8a8a;font-size:9px;line-height:1.4}
.settings-nav-foot-dot{width:6px;height:6px;flex:none;border-radius:50%;background:#27a36a}
.sheet-body{grid-area:content;min-width:0;min-height:0;overflow:auto;padding:30px 34px 24px;background:#fff}
.sheet-foot{grid-area:footer;padding:13px 34px;border-top:1px solid #f5f5f5;background:#fff}
.sheet-foot .note{font-size:10.5px;color:#8a8a8a}
.sheet .sec{max-width:760px;margin:0 auto 25px;padding:0 0 22px;border-bottom:1px solid #f5f5f5}
.sheet .sec:last-child{border-bottom:0}
.sheet .sec-title{font-size:15px;font-weight:740;letter-spacing:-.2px;color:#111111;margin-bottom:5px}
.sheet .sec-hint{max-width:680px;color:#8a8a8a;font-size:11.5px;line-height:1.7;margin-bottom:17px}
.sheet .row{padding:13px 0;border-bottom:1px solid #f5f5f5;gap:18px}
.sheet .row:last-child{border-bottom:0}
.sheet .row-t{font-size:12px;font-weight:650;color:#555555}
.sheet .row-d{font-size:10.5px;color:#8a8a8a;line-height:1.6}
.sheet .field{margin-bottom:16px}
.sheet .field label{font-size:11px;font-weight:650;color:#555555}
.sheet .field input,.sheet .field textarea,.sheet .field select{min-height:39px;border:1px solid #e5e5e5;border-radius:9px;background:#fff;padding:9px 11px;outline:none;}
.sheet .field input:focus,.sheet .field textarea:focus,.sheet .field select:focus{border-color:#8a8a8a;box-shadow:0 0 0 3px rgba(0,0,0,.08)}
.sheet .hint{font-size:10px;color:#8a8a8a;line-height:1.6}
.sheet .btn.primary{background:#555555;box-shadow:none}
.sheet .btn.ghost{border:0;background:#f5f5f5}
.sheet .btn.ghost:hover{background:#e5e5e5}
/* Larger workspaces keep the same navigation rail while using their own canvas. */
.sheet.sheet-kb-mode{width:min(1200px,calc(100vw - 40px));height:min(820px,calc(100dvh - 40px));}
.sheet.sheet-kb-mode .sheet-body{display:flex;flex-direction:column;overflow:hidden;padding:20px 24px 18px;}
.sheet.sheet-faq-mode{width:min(1120px,calc(100vw - 40px));height:min(820px,calc(100dvh - 40px));}
.sheet.sheet-faq-mode .sheet-body{padding:26px 30px 30px;}
.sheet.sheet-faq-mode .faq-manager{max-width:900px;}
@media(max-width:760px){
 .sheet,.sheet:not(.sheet-kb-mode):not(.sheet-faq-mode){width:calc(100vw - 12px);height:calc(100dvh - 12px);grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr) auto;grid-template-areas:"nav" "content" "footer";border-radius:16px;}
 .sheet-head{padding:13px 14px 0;border-right:0;border-bottom:1px solid #f5f5f5;background:#fff;}
 .sheet-sub{display:none}
 .sheet .tabs.settings-nav{flex-direction:row;gap:5px;overflow-x:auto;margin:12px -2px 10px;padding:0 2px 3px;scrollbar-width:none;}
 .sheet .tabs.settings-nav::-webkit-scrollbar{display:none}
 .settings-nav-label,.settings-nav-foot{display:none}
 .sheet .tabs.settings-nav .tab{flex:0 0 auto;width:auto;min-height:38px;padding:6px 9px;gap:6px;background:#f5f5f5;border-radius:9px;}
 .sheet .tabs.settings-nav .tab.on{background:#f5f5f5}
 .settings-nav-icon{width:22px;height:22px;font-size:13px;box-shadow:none;background:transparent}
 .settings-nav-copy b{font-size:10px;white-space:nowrap}
 .settings-nav-copy small,.settings-nav-arrow{display:none}
 .sheet-body{padding:18px 16px 18px}
 .sheet-foot{padding:10px 16px;}
 .sheet.sheet-kb-mode,.sheet.sheet-faq-mode{width:calc(100vw - 12px);height:calc(100dvh - 12px);}
 .sheet.sheet-kb-mode .sheet-head{padding:13px 14px 0}
 .sheet.sheet-kb-mode .sheet-body{padding:12px 12px 10px}
 .sheet.sheet-faq-mode .sheet-body{padding:18px 15px 22px}
}
@media(max-width:420px){
 .settings-nav-copy b{font-size:9.5px}
 .sheet .tabs.settings-nav .tab{padding:5px 7px}
 .sheet-body{padding-left:13px;padding-right:13px}
}

/* Unified multi-platform message notifications */
.notify-page,.notify-detail{max-width:920px;margin:0 auto;padding:2px 0 22px}
.notify-page-head{position:relative;padding:4px 0 17px}
.notify-eyebrow{font-size:10px;font-weight:750;letter-spacing:.1em;color:#8a8a8a;text-transform:uppercase;margin-bottom:7px}
.notify-page-title{font-size:21px;font-weight:760;letter-spacing:-.55px;color:#17191d}
.notify-page-head>p{font-size:12px;line-height:1.75;color:#7e7e7e;max-width:650px;margin:7px 0 13px}
.notify-summary{display:inline-flex;align-items:center;gap:8px;padding:7px 10px;border:1px solid #e9edf2;border-radius:9px;background:#fafbfd;color:#717171;font-size:11px}
.notify-summary b{color:#292929;font-weight:750;font-variant-numeric:tabular-nums}
.notify-summary-icon{display:grid;place-items:center;width:18px;height:18px;border-radius:6px;background:#eaf7ef;color:#218653;font-size:11px;font-weight:800}
.notify-provider-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px;margin:5px 0 17px}
.notify-provider-card{display:flex;flex-direction:column;align-items:stretch;text-align:left;min-width:0;min-height:164px;padding:13px;border:1px solid #e8ebef;border-radius:13px;background:#fff;cursor:pointer;transition:border-color .16s,box-shadow .16s,transform .16s}
.notify-provider-card:hover{border-color:#d1d1d1;box-shadow:0 9px 24px -20px rgba(26,26,26,.45);transform:translateY(-1px)}
.notify-card-top{display:flex;align-items:center;justify-content:space-between;gap:7px;margin-bottom:13px}
.notify-platform-icon{width:36px;height:36px;display:grid;place-items:center;flex:none;border:1px solid #e8edf2;border-radius:11px;background:#f7f9fb;color:#3a3a3a;font-size:16px;font-weight:800}
.notify-platform-icon.wecom{background:#effaf2;border-color:#d8f0df;color:#219653}
.notify-platform-icon.feishu{background:#f4f4f4;border-color:#e6e6e6;color:#1a1a1a}
.notify-platform-icon.dingtalk{background:#f4f4f4;border-color:#e9e9e9;color:#1a1a1a}
.notify-platform-icon.large{width:44px;height:44px;border-radius:13px;font-size:19px}
.notify-status{display:inline-flex;align-items:center;justify-content:center;white-space:nowrap;padding:4px 8px;border-radius:999px;background:#f1f3f5;color:#777777;font-size:10px;font-weight:650}
.notify-status.ok{background:#eaf7ef;color:#23834e}
.notify-status.warn{background:#fff6e7;color:#a36b17}
.notify-status.muted{background:#f1f3f5;color:#7c7c7c}
.notify-card-name{font-size:14px;font-weight:750;color:#252525;line-height:1.4}
.notify-card-desc{font-size:10.5px;line-height:1.55;color:#8f8f8f;margin-top:4px;min-height:32px}
.notify-card-foot{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:auto;padding-top:12px;border-top:1px solid #f0f2f4}
.notify-card-foot>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:9.5px;color:#a0a0a0}
.notify-card-foot b{flex:none;font-size:10px;font-weight:650;color:#5d5d5d}
.notify-card-foot i{font-style:normal;font-size:15px;vertical-align:-1px;margin-left:3px}
.notify-security-note{display:flex;align-items:flex-start;gap:10px;padding:12px 13px;border:1px solid #e7edf3;border-radius:12px;background:#f9fbfd}
.notify-security-icon{width:27px;height:27px;display:grid;place-items:center;flex:none;border-radius:8px;background:#edf3f8;color:#6e6e6e;font-size:11px;font-weight:750}
.notify-security-note b{display:block;font-size:11.5px;color:#464646;margin:1px 0 4px}
.notify-security-note p{font-size:10.5px;line-height:1.7;color:#898989;margin:0}
.notify-back{display:inline-flex;align-items:center;gap:5px;margin:0 0 15px;padding:5px 0;background:transparent;color:#707070;font-size:11px;cursor:pointer}
.notify-back:hover{color:#292929}
.notify-detail-head{display:flex;align-items:center;gap:11px;margin-bottom:16px}
.notify-detail-copy{flex:1;min-width:0}
.notify-detail-title{font-size:18px;font-weight:760;letter-spacing:-.35px;color:#222222}
.notify-detail-copy p{font-size:11px;color:#8c8c8c;margin:4px 0 0}
.notify-connect-panel{padding:15px;border:1px solid #e7ebf0;border-radius:14px;background:#fff}
.notify-panel-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}
.notify-panel-heading b{font-size:13px;color:#2b2b2b}
.notify-panel-heading p{font-size:10.5px;line-height:1.55;color:#8f8f8f;margin:4px 0 0}
.notify-qr-mark{display:grid;place-items:center;width:34px;height:34px;border:1px solid #e7ebf0;border-radius:9px;color:#a1a1a1;font-size:10px;font-weight:800;letter-spacing:.04em}
.notify-qr-placeholder{display:flex;align-items:center;gap:14px;margin:15px 0 12px;padding:14px;border:1px dashed #dce2e9;border-radius:11px;background:#fafbfd}
.notify-qr-symbol{width:70px;height:70px;flex:none;position:relative;display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);gap:4px;padding:7px;border:1px solid #e1e6ec;border-radius:7px;background:#fff;opacity:.55}
.notify-qr-symbol span{border:4px solid #b2b2b2;border-radius:2px}
.notify-qr-symbol span:nth-child(2){border-radius:1px;background:#b2b2b2}
.notify-qr-symbol span:nth-child(3){border-radius:1px;background:#b2b2b2}
.notify-qr-symbol i{position:absolute;left:29px;top:29px;width:10px;height:10px;background:#b2b2b2;border-radius:2px}
.notify-qr-placeholder>div:last-child{min-width:0}
.notify-qr-placeholder b{display:block;font-size:11.5px;color:#5e5e5e;margin-bottom:5px}
.notify-qr-placeholder p{font-size:10.5px;line-height:1.7;color:#919191;margin:0}
.notify-scan-button{min-width:150px}
.notify-scan-button:disabled{opacity:.52;cursor:not-allowed;box-shadow:none}
.notify-prereq{margin-top:12px;border-top:1px solid #eff1f4;padding-top:10px}
.notify-prereq summary{font-size:10.5px;font-weight:650;color:#6f6f6f;cursor:pointer;list-style:none}
.notify-prereq summary::-webkit-details-marker{display:none}
.notify-prereq summary::after{content:'＋';float:right;color:#a1a1a1}
.notify-prereq[open] summary::after{content:'－'}
.notify-prereq ul{padding-left:18px;margin:10px 0 7px;color:#7d7d7d}
.notify-prereq li{font-size:10.5px;line-height:1.8;padding-left:2px}
.notify-prereq>p{font-size:10px;line-height:1.65;color:#999999;margin:6px 0 0}
.notify-legacy{margin-top:14px;border:1px solid #e8ebef;border-radius:12px;background:#fff;overflow:hidden}
.notify-legacy>summary{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 14px;cursor:pointer;list-style:none}
.notify-legacy>summary::-webkit-details-marker{display:none}
.notify-legacy>summary>span:first-child{display:flex;flex-direction:column;gap:3px}
.notify-legacy>summary b{font-size:11.5px;color:#5a5a5a}
.notify-legacy>summary small{font-size:9.5px;color:#a0a0a0}
.notify-legacy-state{font-size:9.5px;color:#939393}
.notify-legacy-body{padding:0 14px 13px;border-top:1px solid #f0f2f4}
.notify-legacy-body .sec{margin:11px 0 0}
.notify-legacy-body .sec-hint{font-size:10.5px}
.notify-legacy-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.notify-future-note{margin-top:14px;padding:13px 14px;border:1px solid #e9edf2;border-radius:12px;background:#fafbfd}
.notify-future-note b{font-size:11.5px;color:#636363}
.notify-future-note p{font-size:10.5px;line-height:1.7;color:#939393;margin:5px 0 0}
@media(max-width:760px){
  .notify-provider-grid{grid-template-columns:1fr;gap:8px}
  .notify-provider-card{min-height:0;padding:11px 12px}
  .notify-card-top{margin-bottom:8px}
  .notify-card-desc{min-height:0;margin-bottom:9px}
  .notify-page-title{font-size:18px}
  .notify-qr-placeholder{align-items:flex-start;padding:11px;gap:10px}
  .notify-qr-symbol{width:56px;height:56px;gap:3px;padding:5px}
  .notify-qr-symbol i{left:23px;top:23px;width:8px;height:8px}
}
@media(max-width:420px){
  .notify-connect-panel{padding:11px}
  .notify-qr-placeholder p{font-size:10px}
  .notify-detail-head{gap:8px}
  .notify-detail-title{font-size:16px}
}

/* v1.11.8 智能消息通知规则 */
.notify-rules{margin:15px 0 17px;padding:16px;border:1px solid #e5eaf0;border-radius:14px;background:#fff}
.notify-rules-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px}
.notify-rules-title{font-size:16px;font-weight:760;letter-spacing:-.25px;color:#252525}
.notify-rules-head p{max-width:610px;margin:5px 0 0;color:#878787;font-size:10.5px;line-height:1.7}
.notify-rules-tag{flex:none;padding:5px 8px;border:1px solid #e8e8e8;border-radius:999px;background:#f7f9fc;color:#717171;font-size:9.5px;font-weight:700}
.notify-rule-enable{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 0;border-top:1px solid #f0f2f5;border-bottom:1px solid #f0f2f5}
.notify-rule-enable>div{display:flex;flex-direction:column;gap:4px}
.notify-rule-enable b{font-size:11.5px;color:#464646}
.notify-rule-enable small{font-size:10px;line-height:1.5;color:#999999}
.notify-prompt-wrap{display:flex;flex-direction:column;gap:6px;margin-top:13px}
.notify-prompt-wrap>span{font-size:11.5px;font-weight:700;color:#474747}
.notify-prompt-wrap>small{font-size:10px;line-height:1.55;color:#999999}
.notify-trigger-prompt{width:100%;min-height:92px;resize:vertical;padding:10px 11px;border:1px solid #e3e8ee;border-radius:9px;background:#fbfcfd;color:#373737;font:inherit;font-size:11px;line-height:1.7;outline:none}
.notify-trigger-prompt:focus{border-color:#a6a6a6;box-shadow:0 0 0 3px rgba(26,26,26,.09)}
.notify-content-fields{margin-top:14px}
.notify-fields-title{display:flex;align-items:center;gap:8px;margin-bottom:9px;font-size:11.5px;font-weight:700;color:#474747}
.notify-fields-title small{font-size:9.5px;font-weight:450;color:#999999}
.notify-field-chips{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.notify-field-chip{display:flex;align-items:center;gap:9px;min-width:0;padding:10px;border:1px solid #e7ebf0;border-radius:10px;background:#fff;text-align:left;cursor:pointer;transition:border-color .15s,background .15s}
.notify-field-chip:hover{border-color:#d3d3d3}
.notify-field-chip.selected{border-color:#bcbcbc;background:#f5f8fd}
.notify-chip-check{display:grid;place-items:center;width:21px;height:21px;flex:none;border:1px solid #dfe5ec;border-radius:6px;background:#fff;color:#919191;font-size:12px;font-weight:800}
.notify-field-chip.selected .notify-chip-check{border-color:#c8c8c8;background:#eeeeee;color:#3a3a3a}
.notify-field-chip>span:last-child{display:flex;flex-direction:column;gap:3px;min-width:0}
.notify-field-chip b{font-size:10.5px;color:#505050}
.notify-field-chip small{font-size:9px;line-height:1.45;color:#999999}
.notify-rule-note{display:flex;align-items:flex-start;gap:8px;margin-top:13px;padding:9px 10px;border-radius:9px;background:#f8fafc;color:#8e8e8e}
.notify-rule-note>span{flex:none;font-size:12px;color:#808080}
.notify-rule-note p{margin:0;font-size:9.5px;line-height:1.7}
.notify-rule-actions{display:flex;justify-content:flex-end;margin-top:12px}
@media(max-width:720px){
  .notify-rules{padding:12px;margin:12px 0}
  .notify-rules-title{font-size:14px}
  .notify-field-chips{grid-template-columns:1fr}
  .notify-rule-actions .btn{width:100%}
}

/* FAQ AI 问法扩展工具栏 */
.faq-alias-tools{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.faq-alias-tools .faq-form-hint{margin:0}
.faq-alias-tools button:disabled{opacity:.48;cursor:not-allowed;transform:none}
