/* 阳琦财税 CRM: scoped refinement of the approved live visual system. */
body.crm-polished #chat-body .chat-thread{padding-top:30px;gap:27px}
body.crm-polished #chat-body .msg.ai>.msg-main{flex:1;min-width:0;max-width:calc(100% - 46px)}
body.crm-polished #chat-body .msg-meta{gap:8px}
body.crm-polished #chat-body .msg-meta b{color:var(--ink-2);font-size:12px}
body.crm-polished #chat-body .ai-text{font-size:15px;line-height:1.85;color:#30445a;overflow-wrap:anywhere;min-width:0}
body.crm-polished .crm-rich{min-width:0;overflow-wrap:anywhere}
body.crm-polished .crm-rich>:first-child{margin-top:0}
body.crm-polished .crm-rich>:last-child{margin-bottom:0}
body.crm-polished .crm-rich h1,body.crm-polished .crm-rich h2{font-size:22px;line-height:1.4;font-weight:740;letter-spacing:-.3px;color:#152a41;margin:23px 0 12px}
body.crm-polished .crm-rich h3{font-size:16px;color:#16334e;line-height:1.5;margin:21px 0 9px;font-weight:720}
body.crm-polished .crm-rich h4,body.crm-polished .crm-rich h5,body.crm-polished .crm-rich h6{font-size:15px;color:#16334e;line-height:1.5;margin:17px 0 8px;font-weight:680}
body.crm-polished .crm-rich p{margin:0 0 10px}
body.crm-polished .crm-rich p+p{margin-top:9px}
body.crm-polished .crm-rich strong{font-weight:680;color:#1c3650}
body.crm-polished #chat-body .crm-rich ol,body.crm-polished #chat-body .crm-rich ul,body.crm-polished #panel .crm-rich ol,body.crm-polished #panel .crm-rich ul{display:block;padding:0 0 0 25px;margin:14px 0 16px;list-style-position:outside}
body.crm-polished .crm-rich ol{list-style-type:decimal}
body.crm-polished .crm-rich ul{list-style-type:disc}
body.crm-polished #chat-body .crm-rich li,body.crm-polished #panel .crm-rich li{padding-left:3px;margin:8px 0;position:static}
body.crm-polished #chat-body .crm-rich li:before{content:none}
body.crm-polished .crm-rich li::marker{color:var(--blue-ink);font-size:.83em;font-weight:700}
body.crm-polished .crm-rich li>p{margin-bottom:6px}
body.crm-polished .crm-rich li>ul,body.crm-polished .crm-rich li>ol{margin:5px 0 9px}
body.crm-polished .crm-rich li:has(>input){list-style:none;padding-left:0}
body.crm-polished .crm-rich input[type=checkbox]{margin-right:7px;vertical-align:-1px;accent-color:var(--teal)}
body.crm-polished .crm-rich blockquote{margin:17px 0;padding:8px 0 8px 14px;border-left:3px solid #5eaed1;color:#48657a;font-size:.92em;background:linear-gradient(90deg,#dfeef845,transparent);border-radius:0 7px 7px 0}
body.crm-polished .crm-rich blockquote p:last-child{margin-bottom:0}
body.crm-polished .crm-rich hr{height:1px;border:0;background:var(--line);margin:22px 0}
body.crm-polished .crm-rich a{color:var(--blue-ink);text-decoration:underline;text-underline-offset:3px;overflow-wrap:anywhere}
body.crm-polished .crm-rich :not(pre)>code{font-family:Consolas,monospace;font-size:.9em;background:#e3ebf45c;color:#255e87;border-radius:5px;padding:2px 5px;white-space:break-spaces}
body.crm-polished #chat-body .answer-actions{display:flex;align-items:center;gap:16px;padding-top:8px}
body.crm-polished #chat-body .answer-action{display:inline-flex;align-items:center;gap:5px;color:#61768a;font-size:11.5px;min-height:30px;padding:3px 0}
body.crm-polished #chat-body .answer-action:hover{color:var(--blue-ink)}
body.crm-polished #chat-body .answer-action .ic{width:13px;height:13px}
body.crm-polished :is(.answer-action,.source-card,.source-stack summary,.crm-rich a,.crm-rich button,.table-scroll,.rich-code pre):focus-visible{outline:2px solid var(--blue-ink);outline-offset:2px}
body.crm-polished .crm-rich .answer-table{background:rgba(255,255,255,.96);border-radius:16px;overflow:hidden;border:1px solid rgba(26,62,96,.08);box-shadow:var(--sh-1);margin:17px 0;max-width:100%}
body.crm-polished .crm-rich .table-heading{padding:13px 17px;display:flex;align-items:center;gap:8px;border-bottom:1px solid var(--line)}
body.crm-polished .crm-rich .table-heading strong{font-size:13px;flex:1}
body.crm-polished .crm-rich .table-heading small{font-size:11px;color:var(--muted)}
body.crm-polished .crm-rich .table-scroll{overflow-x:auto;max-width:100%;overscroll-behavior-x:contain;scrollbar-width:thin;scrollbar-color:#a9c5dc #f5f8fb}
body.crm-polished .crm-rich table{border-collapse:separate;border-spacing:0;width:100%;font-size:13px;line-height:1.6;table-layout:auto}
body.crm-polished .crm-rich th{background:#f6f9fc;color:#63798e;font-size:11.5px;font-weight:600;text-align:left;padding:10px 17px;white-space:normal;min-width:100px}
body.crm-polished .crm-rich td{padding:11px 17px;border-top:1px solid #e8eef4;color:#344b61;white-space:normal;min-width:110px;max-width:280px;overflow-wrap:anywhere;background:#fff}
body.crm-polished .crm-rich tr:hover td,body.crm-polished .crm-rich tr:hover th[scope=row]{background:#f3f9fe}
body.crm-polished .crm-rich tbody th{font-size:13px;font-weight:650;color:#1b354e;background:#fff;border-top:1px solid #e8eef4}
body.crm-polished .crm-rich tr>:first-child{position:sticky;left:0;z-index:1;box-shadow:1px 0 0 #e8eef4;min-width:110px;max-width:180px}
body.crm-polished .crm-rich .numeric{text-align:right;font-variant-numeric:tabular-nums}
body.crm-polished .crm-rich [align=right]{text-align:right}
body.crm-polished .crm-rich [align=center]{text-align:center}
body.crm-polished .crm-rich .table-caption{display:none;padding:9px 17px;font-size:11.5px;color:#63798c;background:#fbfcfe;border-top:1px solid var(--line)}
body.crm-polished .crm-rich .rich-code{border-radius:13px;margin:17px 0;overflow:hidden;border:1px solid #dfe8f0;background:#f9fbfe;max-width:100%}
body.crm-polished .crm-rich .code-label{display:flex;justify-content:space-between;gap:14px;padding:8px 13px;background:#edf3f8;font-size:11px;color:#60768b}
body.crm-polished .crm-rich .code-label button{color:#496b87;padding:0 4px;min-height:24px}
body.crm-polished .crm-rich pre{padding:12px 14px;margin:0;overflow:auto;font:12px/1.7 Consolas,monospace;color:#355c79;white-space:pre;tab-size:4;overscroll-behavior-x:contain}
body.crm-polished .crm-rich pre>code{font:inherit;padding:0;background:none;color:inherit;white-space:pre}
body.crm-polished #chat-body .source-stack{margin-top:18px}
body.crm-polished #chat-body .source-stack>summary{cursor:pointer;list-style:none;display:flex;align-items:center;gap:7px;color:#597184;font-size:12px;min-height:30px}
body.crm-polished #chat-body .source-stack>summary::-webkit-details-marker{display:none}
body.crm-polished #chat-body .source-stack>summary:after{content:'⌄';margin-left:3px}
body.crm-polished #chat-body .source-stack[open]>summary:after{transform:rotate(180deg)}
body.crm-polished #chat-body .source-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:10px}
body.crm-polished #chat-body .source-card{display:flex;align-items:center;gap:11px;padding:13px 14px;background:rgba(255,255,255,.88);border:1px solid #dce6ee;border-radius:13px;box-shadow:0 3px 11px #15335a04;text-align:left;min-width:0}
body.crm-polished #chat-body .source-card:hover{background:#fff;border-color:#b9d2e6;box-shadow:var(--sh-1)}
body.crm-polished #chat-body .source-card>span{width:33px;height:37px;display:grid;place-items:center;border-radius:9px;background:var(--teal-soft);color:var(--teal-deep);flex:none}
body.crm-polished #chat-body .source-card div{min-width:0;flex:1}
body.crm-polished #chat-body .source-card b{font-size:12px;display:block;font-weight:650;color:#243d54;overflow-wrap:anywhere;line-height:1.5}
body.crm-polished #chat-body .source-card small{font-size:10.5px;display:block;color:#6c8094;margin-top:3px}
body.crm-polished #chat-body .source-card>.ic{color:#8498a8;width:13px;height:13px;flex:none}
body.crm-polished .crm-rich .cite{display:inline-grid;place-items:center;border:0;min-width:18px;height:18px;padding:0 4px;vertical-align:1px;font-size:10px;font-weight:700;border-radius:6px;background:var(--teal-soft);color:var(--teal-deep);margin:0 2px}
body.crm-polished .crm-rich .cite:hover{background:var(--teal);color:#fff}
body.crm-polished #panel .reading-panel{padding:14px 20px 24px;gap:0;font-size:13px;line-height:1.85;color:#425d73}
body.crm-polished #panel .reading-panel>.source-type{color:#097b91;font-size:11px;display:flex;align-items:center;gap:5px;margin:5px 0 20px}
body.crm-polished #panel .reading-panel>h2{font-size:19px;line-height:1.5;color:#18334c;margin:0 0 9px}
body.crm-polished #panel .source-locator{font-size:11px;line-height:1.7;color:#708396;overflow-wrap:anywhere;margin-bottom:22px}
body.crm-polished #panel .source-unavailable{padding:13px 0;color:var(--muted)}
body.crm-polished #panel .reading-panel .crm-rich h1,body.crm-polished #panel .reading-panel .crm-rich h2{font-size:17px}
body.crm-polished #panel .reading-panel .crm-rich h3{font-size:14px}
body.crm-polished #chat-body .generation-line{display:flex;align-items:center;gap:9px;color:#496c88;font-size:12px;margin:4px 0 9px}
body.crm-polished #chat-body .generation-orb{width:16px;height:16px;border:2px solid #b5d9f5;border-top-color:#0b8fce;border-right-color:#15b7be;border-radius:50%;flex:none;animation:crmPolishSpin 1.4s linear infinite}
body.crm-polished #chat-body .text-caret{display:inline-block;height:15px;width:2px;background:#168dcd;margin-left:3px;vertical-align:-2px;animation:crmPolishCursor 1.1s ease infinite}
@keyframes crmPolishSpin{to{transform:rotate(360deg)}}
@keyframes crmPolishCursor{50%{opacity:.3}}
body.crm-polished #composer #send-btn.stop{background:var(--grad-brand);color:#fff;box-shadow:0 4px 12px #078ac433}
body.crm-polished #composer #send-btn.stop:disabled{opacity:.6;cursor:wait}
body.crm-polished #composer #send-btn .stop-symbol{display:block;height:11px;width:11px;border:1.7px solid currentColor;border-radius:2px}
body.crm-polished #composer #chat-status:not([hidden]):not(.is-error){padding:8px 0 0;margin:0 15px 2px;font-size:11.5px;line-height:1.6;color:#5e788c;align-items:center;gap:7px}
body.crm-polished #composer .att-strip{flex-wrap:nowrap;overflow-x:auto;gap:8px;padding:13px 15px 0;scrollbar-width:thin;overscroll-behavior-x:contain}
body.crm-polished #composer .att-chip{flex:1 0 205px;min-width:0;max-width:300px;border-radius:12px;padding:9px 10px;background:#f4f8fc;border:1px solid #e2eaf2;animation:none}
body.crm-polished #composer .att-chip-ico{width:30px;height:36px;border-radius:7px;background:var(--violet-soft);color:var(--violet-deep)}
body.crm-polished #composer .att-chip-meta b{font-size:11.5px;font-weight:650;color:#334b63;max-width:none}
body.crm-polished #composer .att-chip-meta small{font-size:10.5px;color:#607b91;display:block;margin-top:2px;line-height:1.5;overflow-wrap:anywhere}
body.crm-polished #composer .att-chip[data-phase=ready] .att-chip-meta small:first-of-type{color:var(--teal-deep)}
body.crm-polished #composer .att-chip[data-phase=failed] .att-chip-meta small:first-of-type{color:#a36138}
body.crm-polished #composer .att-chip .p-mini{font-size:10.5px;padding:4px 6px;white-space:nowrap}
body.crm-polished #composer .att-chip .att-x{flex:none;min-width:23px;min-height:26px}
body.crm-polished #composer .att-chip.is-skipped{border-color:rgba(245,158,11,.35);background:var(--amber-soft)}
body.crm-polished #main>.composer-dock{position:relative}
body.crm-polished #chat-latest{position:absolute;z-index:4;bottom:calc(100% + 4px);left:50%;transform:translateX(-50%);display:flex;align-items:center;gap:7px;padding:8px 13px;border-radius:99px;background:rgba(255,255,255,.97);border:1px solid #dce7ef;box-shadow:var(--sh-1);color:var(--blue-ink);font-size:11.5px;white-space:nowrap}
body.crm-polished #chat-latest[hidden]{display:none}
@media(max-width:860px){
 body.crm-polished #chat-body .chat-thread{padding:19px 17px 22px;gap:22px}
 body.crm-polished #chat-body .msg.ai{gap:9px}
 body.crm-polished #chat-body .msg.ai .msg-av{width:28px;height:28px;margin-top:0}
 body.crm-polished #chat-body .msg.ai>.msg-main{max-width:calc(100% - 37px)}
 body.crm-polished #chat-body .ai-text{font-size:14.5px;line-height:1.85}
 body.crm-polished #chat-body .crm-rich h1,body.crm-polished #chat-body .crm-rich h2{font-size:20px;margin-bottom:10px}
 body.crm-polished #chat-body .crm-rich h3{font-size:15px}
 body.crm-polished #chat-body .source-cards{grid-template-columns:1fr;gap:8px}
 body.crm-polished .crm-rich .table-heading{padding:11px 12px}
 body.crm-polished .crm-rich .table-heading strong{font-size:12px}
 body.crm-polished .crm-rich .table-heading small{font-size:10px}
 body.crm-polished .crm-rich th,body.crm-polished .crm-rich td{padding:9px 12px}
 body.crm-polished .crm-rich tr>:first-child{min-width:100px;max-width:135px}
 body.crm-polished .crm-rich .table-caption{display:block;font-size:10.5px;padding:8px 12px}
 body.crm-polished #main>.composer-dock{padding:8px 9px 10px}
 body.crm-polished #composer{border-radius:20px}
 body.crm-polished #composer-input{font-size:16px;min-height:43px}
 body.crm-polished #composer>.composer-hint:not(#chat-status){display:none}
 body.crm-polished #composer .quick-bar{flex-wrap:nowrap;overflow-x:auto;padding:7px 12px 9px;gap:7px}
 body.crm-polished #composer .quick-state{display:none}
 body.crm-polished #composer .quick-opt{font-size:10.8px;padding:5px 8px}
 body.crm-polished #composer .quick-bar .attach-btn{height:32px;width:26px}
 body.crm-polished #composer .att-strip{gap:6px;padding:10px 11px 0}
 body.crm-polished #composer .att-chip{flex:0 0 220px;padding:7px 9px}
 body.crm-polished #chat-body .answer-action{min-height:38px}
 body.crm-polished #panel .reading-panel{padding-inline:16px}
}
@media(prefers-reduced-motion:reduce){
 body.crm-polished #chat-body .generation-orb,body.crm-polished #chat-body .text-caret{animation:none}
 body.crm-polished #chat-body,body.crm-polished .table-scroll{scroll-behavior:auto}
}
