*{box-sizing:border-box}html,body{margin:0;padding:0;height:100%;background:#f5f6f7;color:#1f2329;font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Helvetica Neue",Arial,sans-serif}body{overflow:hidden}.app{display:flex;height:100vh;width:100%}.sidebar{width:260px;background:#f0f2f5;border-right:1px solid #e5e7eb;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 #c9dcff;background:#eaf2ff;color:#1664ff;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:#dfeaff}.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:#eaf2ff;color:#1664ff;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:#f7f7f8}.main-topbar{height:60px;display:flex;align-items:center;justify-content:center;padding:0 20px;border-bottom:1px solid #eceef2;background:#f7f7f8;color:#1f2329;font-size:17px;font-weight:600;flex-shrink:0}.chat-area{flex:1;min-height:0;overflow-y:auto;padding:20px 20px 120px}.chat-inner{max-width:900px;margin:0 auto}.welcome-screen{min-height:calc(100vh - 180px);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:18px}.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:min(78%,760px);max-width:min(78%,760px)}.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:15px;line-height:1.8;white-space:pre-wrap;word-break:normal;overflow-wrap:anywhere;display:block;min-width:0}.msg-row.assistant .msg-bubble{width:100%;background:#ffffff;color:#1f2329;border:1px solid #eceef2;border-top-left-radius:8px;min-height:54px}.msg-row.user .msg-bubble{background:#dce9ff;color:#1f2329;border-top-right-radius:8px;min-width:220px;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:100vh;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:#1664ff}.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:15px;line-height:1.8;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:linear-gradient(to top,#f7f7f8 78%,rgba(247,247,248,0));padding:18px 20px 24px}.composer-inner{max-width:900px;margin:0 auto}.input-shell{background:#ffffff;border:1px solid #d8dde6;border-radius:22px;box-shadow:0 2px 8px rgba(31,35,41,0.04);padding:12px 12px 12px 16px;display:flex;align-items:flex-end;gap:10px}.input-shell:focus-within{border-color:#b9cdfd;box-shadow:0 0 0 4px rgba(22,100,255,0.08)}.chat-input{flex:1;border:none;outline:none;resize:none;background:transparent;min-height:24px;max-height:180px;font-size:15px;line-height:1.7;color:#1f2329;padding:4px 0}.chat-input::placeholder{color:#a0a7b1}.send-btn{width:40px;height:40px;border:none;border-radius:50%;background:#111827;color:#fff;cursor:pointer;font-size:16px;flex-shrink:0;transition:.15s ease}.send-btn:hover{opacity:.9}.send-btn:disabled{opacity:.5;cursor:not-allowed}.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:88%}.welcome-title{font-size:24px}.example-grid{max-width:100%}}