.rsi-side-panel{min-width:0;min-height:420px;background:#fffefa;position:sticky;top:65px;height:calc(100dvh - var(--rsi-panel-top,65px) - 10px);align-self:start;display:flex;flex-direction:column;scroll-margin-top:75px}
.rsi-panel-tabs{display:flex;gap:6px;padding:12px 18px;border-bottom:1px solid var(--line);flex-shrink:0}
.rsi-panel-tabs button{flex:1;white-space:nowrap;font-size:13px;padding:7px 9px}.rsi-panel-tabs button[aria-selected=true]{background:#244d3e;color:#fff}
.rsi-side-panel #detail{position:static;flex:1;min-height:0;max-height:none;padding:20px 22px 90px}
.rsi-chat{display:flex;flex:1;min-height:0;flex-direction:column}
.rsi-chat-intro{padding:18px 20px 12px;border-bottom:1px solid var(--line);flex-shrink:0}
.rsi-chat-top{display:flex;justify-content:space-between;align-items:center;gap:8px}.rsi-chat-top h2{font-size:17px;margin:0}.rsi-chat-top button{font-size:11px;white-space:nowrap;padding:5px 8px}
.rsi-chat-context{font-size:12px;color:var(--accent);margin:10px 0 4px;overflow-wrap:anywhere}.rsi-chat-intro .small{margin:4px 0}.rsi-chat-status{font-size:11px;color:var(--muted);margin:8px 0 2px}.rsi-check-status{font-size:11px;padding:3px 8px}
.rsi-chat-status-row{display:flex;gap:8px;align-items:center;justify-content:space-between;margin-top:7px}.rsi-chat-status-row .rsi-chat-status{margin:0}.rsi-check-status{flex-shrink:0}
.rsi-chat-log{flex:1;min-height:60px;overflow-y:auto;padding:16px 20px;overscroll-behavior:contain}.rsi-chat-empty{font-size:13px;color:var(--muted);margin:0;padding:4px 0}
.rsi-turn{margin-bottom:25px;border-bottom:1px solid var(--line);padding-bottom:22px;overflow-wrap:anywhere}.rsi-turn-context{font-size:11px;color:var(--muted);margin:0 0 7px}.rsi-user-question{background:#eaf0e5;padding:12px;border-radius:8px;margin:0 0 17px;font-weight:550;white-space:pre-wrap}
.rsi-answer-block{margin-bottom:16px}.rsi-answer-kind{font-size:10px;color:var(--accent);border-bottom:1px solid #bdd1c0;padding-bottom:2px}.rsi-answer-block p{white-space:pre-wrap;line-height:1.9;margin:7px 0;font-size:13px}
.rsi-citation-links{display:flex;flex-wrap:wrap;gap:6px}.rsi-citation-link{color:var(--accent);background:#edf3e9;border:1px solid #d4e0d0;padding:3px 7px;border-radius:5px;display:inline-block;text-decoration:none;font-size:11px;line-height:1.6}.rsi-citation-link:hover{border-color:var(--accent)}
.rsi-location-message{font-size:11px;color:#916022}.rsi-location-message:empty{display:none}.rsi-answer-sources{font-size:12px;margin:12px 0}.rsi-answer-sources section{margin:12px 0}.rsi-answer-sources blockquote{font-size:12px;white-space:pre-wrap;line-height:1.8;margin:8px 0;padding:0 0 0 10px;border-left:2px solid #d4e0d0}.rsi-answer .quiet{font-size:12px}.rsi-chat-error{font-size:13px;color:#913d27;white-space:pre-wrap}.rsi-answer-pending{font-size:13px;color:var(--muted)}
.rsi-chat-form{border-top:1px solid var(--line);padding:12px 20px 18px;flex-shrink:0;background:#fffefa}.rsi-chat-form label{font-size:12px;display:block;margin-bottom:6px}.rsi-chat-form textarea{display:block;width:100%;max-height:150px;resize:vertical;border:1px solid #cdd7ce;border-radius:7px;padding:10px;background:#fff;color:var(--ink);font:inherit;font-size:13px}.rsi-chat-form .small{margin:5px 0}.rsi-chat-send{border:0;border-radius:7px;background:#244d3e;color:#fff;padding:8px 15px;width:100%;font:inherit;font-size:13px}.rsi-chat-send:disabled{opacity:.45;cursor:default}
.rsi-chat-launch{position:fixed;right:24px;bottom:78px;z-index:20;border:1px solid #244d3e;background:#fffefa;color:#244d3e;padding:8px 16px;border-radius:9px;box-shadow:0 4px 20px #244d3e18;font:inherit}.rsi-side-panel :focus-visible,.rsi-answer-feedback :focus-visible{outline:3px solid #c88a32;outline-offset:3px}
.rsi-citation-focus{outline:4px solid #c88a32!important;outline-offset:5px;box-shadow:0 0 0 9px #e8bd6040!important;opacity:1!important}
.rsi-panel-visible .rsi-chat-launch{display:none}
body[data-view=questions] .rsi-chat-launch{display:none}
.rsi-feedback-view{flex:1;min-height:0;overflow-y:auto;padding:18px 20px;overscroll-behavior:contain}.rsi-feedback-modes{display:flex;gap:8px;margin-bottom:18px}.rsi-feedback-modes button{flex:1;font-size:12px}.rsi-feedback-modes button[aria-pressed=true]{background:#edf3e9;border-color:#88a995;color:#244d3e}.rsi-feedback-empty{font-size:13px;color:var(--muted);line-height:1.8}.rsi-feedback-panel select{max-width:100%;text-overflow:ellipsis}
.rsi-feedback-view .rsi-feedback-panel{padding:0;border:0;border-radius:0}.rsi-feedback-view .rsi-feedback-panel h2{font-size:17px}
@media(min-width:851px){body:has(.rsi-chat:not([hidden])) .rsi-chat-launch,body:has(.rsi-chat:not([hidden])) .rsi-feedback-launch{right:calc(var(--detail-width,400px) + 24px)}}
@media(max-width:850px){.rsi-side-panel{position:static;height:auto;min-height:0;border-top:1px solid var(--line);scroll-margin-top:140px}.rsi-side-panel #detail{overflow:visible;flex:none}.rsi-chat{height:calc(100dvh - 160px);min-height:480px;max-height:850px;flex:none}.rsi-chat-intro{padding:14px 18px 10px}.rsi-chat-log{padding:14px 18px}.rsi-chat-form{padding:10px 18px 20px}.rsi-chat-launch{right:14px;bottom:68px}.rsi-chat-top h2{font-size:16px}}
@media(max-width:850px){.layout:has(.rsi-side-panel){display:flex!important;flex-direction:column}.rsi-side-panel{order:-1;width:100%}.rsi-chat{height:calc(100dvh - var(--rsi-panel-top,65px) - 72px);min-height:380px}.rsi-feedback-view{flex:none;overflow:visible;padding:18px}.rsi-chat-launch{bottom:22px}}
@media(max-width:850px){body[data-view=questions] .rsi-side-panel{order:0}}

.rsi-chat-status:empty,.rsi-chat-status-row:has(.rsi-chat-status:empty):has(.rsi-check-status[hidden]){display:none}

.rsi-answer-sources .small:empty{display:none}

/* Keep the conversation readable; the composer no longer takes a separate button row. */
.rsi-panel-tabs{padding:8px 16px}
.rsi-chat-intro{padding:10px 16px 8px}
.rsi-chat-actions{display:flex;gap:6px;align-items:center}
.rsi-chat-top .rsi-chat-expand{color:#244d3e;background:#edf3e9;border-color:#a6bba9}
.rsi-chat-context{margin:6px 0 0;line-height:1.5}
.rsi-chat-form{padding:8px 16px 10px}
.rsi-chat-form label{margin-bottom:4px}
.rsi-chat-composer{display:flex;gap:8px;align-items:stretch}
.rsi-chat-composer textarea{flex:1;min-width:0;max-height:100px;padding:8px;font-size:14px}
.rsi-chat-composer .rsi-chat-send{width:auto;flex:0 0 auto;padding:8px 12px}
.rsi-chat-form .small{margin:4px 0 0;font-size:11px}
.rsi-answer-block p{font-size:14px;line-height:1.85}
body.rsi-chat-expanded{overflow:hidden}
body.rsi-chat-expanded .rsi-side-panel{position:fixed;inset:12px;z-index:1000;width:auto;height:calc(100dvh - 24px);min-height:0;max-height:none;border:1px solid var(--line);border-radius:12px;box-shadow:0 0 0 100vmax #17312470;overflow:hidden}
body.rsi-chat-expanded .rsi-chat{flex:1;min-height:0;height:auto;max-height:none}
body.rsi-chat-expanded .rsi-chat-log{padding:20px max(24px,calc((100% - 960px)/2));min-height:0}
body.rsi-chat-expanded .rsi-answer-block p{font-size:16px;line-height:1.9}
body.rsi-chat-expanded .rsi-chat-form{padding:10px max(24px,calc((100% - 960px)/2)) 12px}
@media(max-width:850px){
  body.rsi-chat-expanded .rsi-side-panel{inset:0;height:100dvh;border-radius:0}
  body.rsi-chat-expanded .rsi-chat-log{padding:14px 18px}
  body.rsi-chat-expanded .rsi-chat-form{padding:8px 16px max(10px,env(safe-area-inset-bottom))}
  body.rsi-chat-expanded .rsi-answer-block p{font-size:15px;line-height:1.8}
}

/* ---------- 统一的悬浮问答（四个视图相同）：右下角悬浮图标，点开浮动面板，不再占据页面一栏 ---------- */
body.rsi-floating #splitter,body.rsi-floating .rsi-chat-launch{display:none!important}
@media(min-width:851px){
  body.rsi-floating .layout{grid-template-columns:180px minmax(0,1fr)!important}
  body.rsi-floating[data-view=topics] .layout,body.rsi-floating[data-view=questions] .layout{grid-template-columns:250px minmax(0,1fr)!important}
  body.rsi-floating[data-view=play] .layout{grid-template-columns:minmax(0,1fr)!important}
}
@media(min-width:851px) and (max-width:1100px){body.rsi-floating[data-view=mainline] .layout{grid-template-columns:140px minmax(0,1fr)!important}body.rsi-floating[data-view=topics] .layout,body.rsi-floating[data-view=questions] .layout{grid-template-columns:190px minmax(0,1fr)!important}}
body.rsi-floating .rsi-side-panel{position:fixed;right:24px;bottom:92px;top:auto;left:auto;width:min(440px,calc(100vw - 32px));height:min(720px,calc(100dvh - 120px));min-height:0;z-index:60;border:1px solid var(--line);border-radius:14px;overflow:hidden;
  box-shadow:0 18px 50px #17312433,0 2px 8px #1731241a;transform-origin:bottom right;transition:opacity .18s ease,transform .18s ease,visibility 0s linear .18s;opacity:0;transform:translateY(10px) scale(.98);visibility:hidden;pointer-events:none}
body.rsi-floating.rsi-panel-open .rsi-side-panel{opacity:1;transform:none;visibility:visible;pointer-events:auto;transition:opacity .18s ease,transform .18s ease}
body.rsi-floating .rsi-side-panel #detail:not([hidden]){display:block!important}
body.rsi-floating[data-view=topics] .rsi-side-panel #detail>button.quiet:first-child{display:none}
.rsi-panel-head{display:flex;align-items:center;gap:4px;border-bottom:1px solid var(--line);flex-shrink:0;padding-right:10px}
.rsi-panel-head .rsi-panel-tabs{flex:1;border-bottom:0;min-width:0}
.rsi-panel-close{flex-shrink:0;width:32px;height:32px;padding:0;border:0;border-radius:8px;background:transparent;color:var(--muted);font-size:22px;line-height:1}
.rsi-panel-close:hover{background:#edf1e8;color:var(--ink)}
.rsi-fab{position:fixed;right:24px;bottom:24px;z-index:61;width:56px;height:56px;padding:0;border:0;border-radius:50%;background:#244d3e;color:#fff;display:grid;place-items:center;box-shadow:0 10px 28px #244d3e47,0 2px 6px #244d3e33;cursor:pointer;transition:transform .15s ease,background .15s ease}
.rsi-fab:hover{transform:translateY(-2px);background:#1d4033}.rsi-fab:focus-visible{outline:3px solid #c88a32;outline-offset:3px}
.rsi-fab svg{width:26px;height:26px;grid-area:1/1}.rsi-fab .rsi-fab-open{fill:currentColor}.rsi-fab .rsi-fab-open circle{fill:#244d3e}
.rsi-fab .rsi-fab-close{display:none;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round}
body.rsi-panel-open .rsi-fab .rsi-fab-open{display:none}body.rsi-panel-open .rsi-fab .rsi-fab-close{display:block}
.rsi-fab-label{position:absolute;right:68px;top:50%;transform:translateY(-50%);white-space:nowrap;background:#263930;color:#fff;font-size:12px;line-height:1;padding:7px 11px;border-radius:999px;opacity:0;pointer-events:none;transition:opacity .15s}
.rsi-fab:hover .rsi-fab-label,.rsi-fab:focus-visible .rsi-fab-label{opacity:1}body.rsi-panel-open .rsi-fab-label{display:none}
body.rsi-chat-expanded .rsi-fab{display:none}
@media(max-width:850px){
  body.rsi-floating .layout:has(.rsi-side-panel){display:block!important}
  body.rsi-floating .rsi-side-panel{inset:0;width:auto;height:100dvh;border:0;border-radius:0;box-shadow:none;z-index:1000}
  body.rsi-floating .rsi-chat{height:auto;flex:1;min-height:0;max-height:none}
  body.rsi-floating .rsi-side-panel #detail{overflow:auto;flex:1}
  body.rsi-floating .rsi-feedback-view{flex:1;overflow:auto}
  body.rsi-floating.rsi-panel-open{overflow:hidden}body.rsi-floating.rsi-panel-open .rsi-fab{display:none}
  .rsi-fab{right:16px;bottom:16px;width:52px;height:52px}
}
@media(prefers-reduced-motion:reduce){body.rsi-floating .rsi-side-panel{transition:none}}
/* 「展开阅读」优先于悬浮面板的尺寸：铺满窗口阅读长回答 */
body.rsi-floating.rsi-chat-expanded .rsi-side-panel{inset:12px;width:auto;height:calc(100dvh - 24px);z-index:1000;border-radius:12px;transform:none}
@media(max-width:850px){body.rsi-floating.rsi-chat-expanded .rsi-side-panel{inset:0;height:100dvh;border-radius:0}}
/* 提问胶囊：随界面变化，点一下直接提问 */
.rsi-chat-tips{display:flex;flex-wrap:wrap;gap:6px;padding:8px 16px 0;border-top:1px solid var(--line);flex-shrink:0;background:#fffefa}
.rsi-chat-tips:empty{display:none}
.rsi-tip{border:1px solid #c3d4c5;border-radius:999px;background:#f3f7f0;color:#244d3e;font-size:12px;line-height:1.4;padding:5px 11px;white-space:nowrap}
.rsi-tip:hover:not(:disabled){background:#244d3e;border-color:#244d3e;color:#fff}.rsi-tip:disabled{opacity:.45;cursor:default}
.rsi-chat-tips+.rsi-chat-form{border-top:0}
