*{box-sizing:border-box}html,body{margin:0;padding:0;height:100%;background:#ffffff;color:#1f2329;font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Helvetica Neue",Arial,sans-serif}body{padding-top:0;overflow:hidden}.app{display:flex;height:100dvh;width:100%}.sidebar{width:260px;background:#f8f8f8;border-right:1px solid #eeeeee;display:flex;flex-direction:column;padding:14px 12px}.brand{display:flex;align-items:center;gap:10px;padding:8px 6px 14px}.brand-logo-img{width:42px;height:42px;object-fit:contain;display:block;border-radius:10px;flex-shrink:0}.brand-name{font-size:18px;font-weight:700;color:#1f2329}.new-chat-btn{width:100%;border:1px solid #e5e5e5;background:#ffffff;color:#262626;border-radius:14px;padding:12px 14px;font-size:15px;font-weight:600;cursor:pointer;text-align:left;transition:.15s ease}.new-chat-btn:hover{background:#ededed}.side-section{margin-top:18px}.side-section-history{flex:1;min-height:0}.side-title{font-size:12px;color:#8b8f97;margin:0 0 10px;padding:0 4px}.menu-list,.history-list{display:flex;flex-direction:column;gap:6px}.menu-item,.history-item{display:block;border:none;background:transparent;text-align:left;width:100%;padding:10px 12px;border-radius:12px;font-size:14px;color:#30343a;cursor:pointer;transition:.15s ease;text-decoration:none}.menu-item:hover,.history-item:hover{background:#e9edf3}.menu-item.active{background:#ffffff;color:#262626;font-weight:600}.history-wrap{flex:1;min-height:0;overflow-y:auto;padding-right:2px}.history-empty{font-size:13px;color:#9aa0a6;line-height:1.6;padding:6px 8px}.main{flex:1;min-width:0;display:flex;flex-direction:column;background:#ffffff}.main-topbar{height:60px;display:flex;align-items:center;justify-content:flex-start;padding:0 28px;border-bottom:1px solid transparent;background:#ffffff;color:#1f2329;font-size:17px;font-weight:600;flex-shrink:0}.chat-area{flex:1;min-height:0;overflow-y:auto;padding:32px 32px 48px}.chat-inner{max-width:800px;margin:0 auto}.welcome-screen{min-height:calc(100dvh - 250px);display:flex;flex-direction:column;justify-content:center;align-items:center;text-align:center}.welcome-title{font-size:28px;font-weight:700;color:#111827;margin:0 0 28px}.example-grid{display:flex;flex-wrap:wrap;gap:12px;max-width:760px;justify-content:center}.example-chip{border:none;background:#eeeeef;color:#30343a;border-radius:16px;padding:12px 18px;font-size:15px;cursor:pointer;transition:.15s ease;line-height:1.4}.example-chip:hover{background:#e3e5e8}.message-list{display:flex;flex-direction:column;gap:28px}.msg-row{display:flex;gap:12px;align-items:flex-start}.msg-row.user{flex-direction:row-reverse}.msg-avatar{width:34px;height:34px;border-radius:50%;flex-shrink:0;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:700;color:#fff}.msg-row.assistant .msg-avatar{background:linear-gradient(135deg,#6fb1ff 0%,#3b82f6 55%,#1664ff 100%)}.msg-row.user .msg-avatar{background:#5b6573}.msg-wrap{display:flex;flex-direction:column;gap:6px;position:relative;min-width:0}.msg-row.assistant .msg-wrap{width:100%;max-width:100%}.msg-row.user .msg-wrap{width:fit-content;max-width:min(78%,760px);align-items:flex-end;padding-bottom:30px}.msg-name{font-size:12px;color:#9aa0a6;padding:0 4px}.msg-bubble{padding:14px 16px;border-radius:18px;font-size:16px;line-height:1.85;white-space:pre-wrap;word-break:normal;overflow-wrap:anywhere;display:block;min-width:0}.msg-row.assistant .msg-bubble{width:100%;background:transparent;color:#1f2329;border:0;padding:0;border-radius:0;white-space:normal;min-height:54px}.msg-row.user .msg-bubble{background:#f1f1f1;color:#1f2329;border-top-right-radius:8px;min-width:0;max-width:100%}.msg-meta{font-size:12px;color:#9aa0a6;padding:0 4px}.assistant-toolbar{display:flex;align-items:center;gap:10px;padding:0 4px;color:#8b95a1;flex-wrap:wrap}.assistant-tool-btn{width:24px;height:24px;border:none;background:transparent;color:#8b95a1;display:inline-flex;align-items:center;justify-content:center;border-radius:6px;cursor:pointer;padding:0;transition:all .15s ease;position:relative}.assistant-tool-btn:hover{background:#eef2f7;color:#5f6877}.assistant-tool-btn.active{background:#e9edf3;color:#4f5868}.assistant-tool-btn svg{width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.assistant-tool-btn[data-tool="speak"] svg{width:21px;height:21px}.assistant-tool-btn::after{content:attr(data-tip);position:absolute;left:50%;bottom:calc(100% + 8px);transform:translateX(-50%) translateY(4px);opacity:0;pointer-events:none;white-space:nowrap;padding:6px 8px;border-radius:6px;background:#111827;color:#ffffff;font-size:12px;line-height:1;transition:.12s ease;z-index:8}.assistant-tool-btn:hover::after,.assistant-tool-btn.show-tip::after{opacity:1;transform:translateX(-50%) translateY(0)}.assistant-tool-text{margin-left:6px;border:0;background:transparent;padding:0;font:inherit;font-size:13px;color:#7e8795;line-height:1;white-space:nowrap;cursor:pointer}.refs-overlay{position:fixed;inset:0;background:rgba(15,23,42,0.22);opacity:0;pointer-events:none;transition:opacity .2s ease;z-index:80}.refs-overlay.open{opacity:1;pointer-events:auto}.refs-drawer{position:fixed;top:0;right:0;width:min(420px,92vw);height:100dvh;background:#ffffff;border-left:1px solid #e5e7eb;box-shadow:-8px 0 28px rgba(15,23,42,0.12);transform:translateX(100%);transition:transform .24s ease;z-index:90;display:flex;flex-direction:column}.refs-drawer.open{transform:translateX(0)}.refs-header{padding:16px 18px;border-bottom:1px solid #eef1f5;display:flex;align-items:center;justify-content:space-between;gap:12px}.refs-title{margin:0;font-size:18px;font-weight:700;color:#1f2937}.refs-close{border:none;background:transparent;color:#6b7280;width:28px;height:28px;border-radius:8px;cursor:pointer;font-size:20px;line-height:1}.refs-close:hover{background:#eef2f7;color:#374151}.refs-list{margin:0;padding:10px 14px 18px;list-style:none;overflow-y:auto;flex:1}.refs-item+.refs-item{margin-top:8px}.refs-link{display:block;padding:12px;border:1px solid #e6eaf0;border-radius:12px;text-decoration:none;background:#fafbfc;transition:all .15s ease}.refs-link:hover{background:#f3f6fb;border-color:#cfd8e5}.refs-item-title{margin:0;font-size:14px;font-weight:600;color:#1f2937;line-height:1.45}.refs-item-summary{margin:6px 0;color:#4b5563;font-size:13px;line-height:1.5}.refs-item-url{margin:6px 0 0;font-size:12px;color:#6b7280;line-height:1.45;word-break:break-all}.msg-bubble.error{background:#fff1f0;color:#b42318;border:1px solid #ffd0cc}.msg-actions{position:absolute;right:8px;bottom:2px;display:flex;align-items:center;gap:6px;opacity:0;pointer-events:none;transition:opacity .15s ease;z-index:5}.msg-row.user:hover .msg-actions,.msg-row.user .msg-actions.show{opacity:1;pointer-events:auto}.msg-action-btn{width:26px;height:26px;border:none;background:transparent;color:#8b95a1;display:inline-flex;align-items:center;justify-content:center;border-radius:8px;cursor:pointer;transition:all .15s ease;padding:0}.msg-action-btn:hover{background:#eef2f7;color:#262626}.msg-action-btn svg{width:16px;height:16px;stroke:currentColor}.msg-action-btn.copied{color:#16a34a}.msg-action-btn.copied:hover{color:#16a34a;background:#eefbf3}.msg-edit-pop{position:absolute;right:8px;top:-34px;background:#111827;color:#fff;font-size:12px;line-height:1;padding:10px 12px;border-radius:10px;white-space:nowrap;opacity:0;transform:translateY(4px);pointer-events:none;transition:.15s ease;z-index:6}.msg-edit-pop.show{opacity:1;transform:translateY(0)}.thinking-inline{display:inline-flex;align-items:center;gap:8px;color:#8b95a1}.thinking-dots{display:inline-flex;gap:5px;align-items:center}.thinking-dot{width:6px;height:6px;border-radius:999px;background:#b5bdc8;animation:blink 1.2s infinite ease-in-out}.thinking-dot:nth-child(2){animation-delay:.15s}.thinking-dot:nth-child(3){animation-delay:.3s}.stream-cursor{display:inline-block;width:8px;margin-left:2px;color:#7c8695;animation:cursorBlink 1s steps(1) infinite}.user-edit-shell{display:flex;flex-direction:column;gap:10px}.user-edit-textarea{width:100%;min-height:76px;max-height:260px;resize:none;border:none;outline:none;background:transparent;font-size:16px;line-height:1.85;color:#1f2329;font-family:inherit;padding:0;margin:0}.user-edit-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:2px}.user-edit-btn{border:none;border-radius:999px;padding:8px 14px;font-size:13px;cursor:pointer;transition:.15s ease}.user-edit-btn.cancel{background:rgba(255,255,255,0.55);color:#374151}.user-edit-btn.cancel:hover{background:rgba(255,255,255,0.78)}.user-edit-btn.save{background:#111827;color:#fff}.user-edit-btn.save:hover{opacity:.92}.user-edit-btn:disabled{opacity:.55;cursor:not-allowed}@keyframes blink{0%,80%,100%{opacity:.35;transform:translateY(0)}40%{opacity:1;transform:translateY(-2px)}}@keyframes cursorBlink{0%,50%{opacity:1}50.01%,100%{opacity:0}}.composer{position:sticky;bottom:0;background:#ffffff;padding:12px 32px max(16px,env(safe-area-inset-bottom))}.composer-inner{max-width:800px;margin:0 auto}.input-shell{display:flex;flex-direction:column;gap:8px;padding:14px;background:#fbfcfe;border:1px solid #dce3ec;border-radius:22px;box-shadow:0 4px 20px rgba(40,59,83,.05),0 1px 3px rgba(40,59,83,.03);transition:border-color .18s ease,box-shadow .18s ease}.input-shell:focus-within{border-color:#9bafc6;box-shadow:0 0 0 3px rgba(91,119,152,.07),0 4px 20px rgba(40,59,83,.05)}.chat-input{display:block;width:100%;min-width:0;flex:none;border:none;outline:none;resize:none;background:transparent;min-height:42px;max-height:180px;font-size:15px;line-height:1.7;color:#28374a;padding:2px 4px}.chat-input::placeholder{color:#98a3b2}.composer-controls{display:flex;align-items:center;justify-content:space-between}.send-btn{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;padding:0;border:none;border-radius:12px;background:#354b65;color:#fff;cursor:pointer;flex-shrink:0;box-shadow:0 2px 5px rgba(40,59,83,.12);transition:background .15s ease,transform .15s ease}.send-btn:hover:not(:disabled){background:#243b55;transform:translateY(-1px)}.send-btn:active:not(:disabled){transform:translateY(0)}.send-btn:disabled{background:#d7dee8;color:#fff;box-shadow:none;cursor:not-allowed}.send-btn svg,.attach-btn svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.status-hint{margin-top:10px;text-align:center;font-size:12px;color:#9aa0a6}@media (max-width:900px){.sidebar{display:none}.main-topbar{justify-content:flex-start;padding-left:18px}.chat-area{padding-left:14px;padding-right:14px}.composer{padding-left:14px;padding-right:14px}.msg-row.assistant .msg-wrap,.msg-row.user .msg-wrap{width:auto;max-width:100%}.welcome-title{font-size:24px}.example-grid{max-width:100%}}.msg-avatar,.msg-name{display:none}.assistant-card{width:100%;min-width:0;padding:18px 22px 20px;border:1px solid #e5eaf0;border-radius:18px;background:#f7f9fc}.msg-row.assistant .msg-meta:empty{display:none}.msg-row.assistant .msg-bubble>:first-child{margin-top:0}.msg-row.assistant .msg-bubble>:last-child{margin-bottom:0}.msg-row.assistant .msg-bubble{color:#292929;line-height:1.75}.msg-bubble p{margin:0 0 .75em}.msg-bubble h1,.msg-bubble h2,.msg-bubble h3,.msg-bubble h4,.msg-bubble h5,.msg-bubble h6{margin:1.25em 0 .5em;color:#171717;font-weight:650;line-height:1.5;letter-spacing:-.025em;text-wrap:pretty}.msg-bubble h1{font-size:1.55em}.msg-bubble h2{font-size:1.25em}.msg-bubble h3{font-size:1.08em}.msg-bubble h4,.msg-bubble h5,.msg-bubble h6{font-size:1em}.msg-bubble strong{font-weight:650;color:#171717}.msg-bubble ul,.msg-bubble ol{margin:.5em 0 .8em;padding-left:1.55em}.msg-bubble li{padding-left:.35em;margin:.2em 0}.msg-bubble li::marker{color:#6b7280;font-size:.9em}.msg-bubble ol>li::marker{font-weight:600;font-variant-numeric:tabular-nums}.msg-bubble li>p{margin:.25em 0}.msg-bubble li>ul,.msg-bubble li>ol{margin:.2em 0}.msg-bubble a{color:#365f91;text-decoration:underline;text-decoration-color:#b9c9db;text-underline-offset:4px;text-decoration-thickness:1px}.msg-bubble a:hover{color:#163d6c;text-decoration-color:currentColor}.msg-bubble a.source-link{display:inline;padding:2px 7px;border-radius:6px;background:#f1f3f5;color:#536171;font-size:.78em;text-decoration:none;box-decoration-break:clone;-webkit-box-decoration-break:clone;overflow-wrap:anywhere;vertical-align:baseline}.msg-bubble a.source-link::after{content:" ↗";color:#8a929c;font-size:.9em}.msg-bubble a.source-link:hover{background:#e7edf3;color:#244b77}.msg-bubble blockquote{margin:.85em 0;border-left:3px solid #cbd5df;padding:9px 16px;color:#56616e;background:#f8fafb;border-radius:0 10px 10px 0}.msg-bubble blockquote p:last-child{margin-bottom:0}.msg-bubble code{background:#f1f2f4;border:1px solid #e8eaed;border-radius:5px;padding:.12em .35em;font-size:.86em;color:#444c56;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.msg-bubble pre{margin:.85em 0;background:#f7f8fa;border:1px solid #e8eaed;padding:14px 16px;border-radius:12px;overflow-x:auto;white-space:pre;line-height:1.65;tab-size:4}.msg-bubble pre code{background:none;border:0;padding:0;color:#323b46}.msg-bubble hr{border:0;border-top:1px solid #e9ecef;margin:1.2em 0}.table-scroll{overflow-x:auto;margin:.85em 0 1em;border:1px solid #e4e8ed;border-radius:12px;scrollbar-width:thin;scrollbar-color:#cbd2da transparent}.msg-bubble table{border-collapse:collapse;width:100%;font-size:.9em;line-height:1.7}.msg-bubble th,.msg-bubble td{border-bottom:1px solid #e9ecef;padding:9px 14px;text-align:left;min-width:110px;vertical-align:top}.msg-bubble th{font-weight:600;background:#f6f8fa;color:#3c4653}.msg-bubble tr:last-child td{border-bottom:0}.msg-bubble tbody tr:nth-child(even){background:#fcfcfd}.msg-bubble tbody tr:hover{background:#f6f8fb}.msg-bubble td code{white-space:nowrap}.msg-bubble ::selection{background:#dce9f6}.assistant-tool-text{background:#f3f3f3;border-radius:20px;padding:7px 11px;font-size:12px}.side-section-history{display:flex;flex-direction:column}.chat-input{font-family:inherit}button:focus-visible,a:focus-visible{outline:2px solid #737373;outline-offset:3px}@media (max-width:600px){.chat-area{padding:24px 20px 32px}.composer{padding-left:12px;padding-right:12px}.msg-row.user .msg-wrap{max-width:90%}.msg-bubble{font-size:16px}.message-list{gap:28px}.welcome-title{font-size:25px}.example-grid{gap:8px}.example-chip{font-size:13px;padding:10px 12px}.assistant-toolbar{gap:8px}}@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}.refs-description{margin:0;padding:14px 18px 4px;color:#777;font-size:12px;line-height:1.65}.refs-source-type{display:inline-block;color:#777;font-size:11px;margin-bottom:6px}@media (max-width:600px){.assistant-card{padding:14px 16px 16px;border-radius:16px}.msg-row.assistant .msg-bubble{line-height:1.75}.msg-bubble h2{font-size:1.18em}.msg-bubble blockquote{padding:8px 12px}.msg-bubble th,.msg-bubble td{padding:8px 10px}}.markdown-preview .assistant-tool-btn,.markdown-preview .msg-actions,.markdown-preview .msg-edit-pop{display:none}.markdown-preview .status-hint a{color:#365f91;text-underline-offset:3px}.attach-btn{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;padding:0;border:1px solid #e5eaf1;background:#f0f3f8;color:#6c7e93;flex-shrink:0;cursor:pointer;border-radius:11px;transition:background .15s ease,color .15s ease}.attach-btn:hover:not(:disabled){background:#e5ebf3;color:#354b65}.attach-btn:disabled{opacity:.4;cursor:default}.image-attachments{display:flex;gap:10px;flex-wrap:wrap}.image-attachments:not(:empty){padding:2px 4px 4px}.attachment-preview{position:relative;width:76px;height:76px}.attachment-preview img{width:100%;height:100%;object-fit:contain;background:#f7f7f8;border:1px solid #e5e7eb;border-radius:10px}.attachment-preview button{position:absolute;right:-5px;top:-5px;border:1px solid #ddd;background:white;border-radius:50%;width:22px;height:22px;cursor:pointer}.message-images{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end}.message-images img{max-width:min(260px,100%);max-height:240px;object-fit:contain;border-radius:12px;border:1px solid #e5e7eb}