:root{font-family:-apple-system,BlinkMacSystemFont,PingFang SC,Microsoft YaHei,sans-serif;color:#1f2933;background:#eef2f5}*{box-sizing:border-box}html,body,#app{margin:0;min-height:100%;height:100%}body{background:#eef2f5}button,textarea,input{font:inherit}button{-webkit-tap-highlight-color:transparent}.chat-shell{min-height:100vh;display:grid;place-items:center;padding:16px;background:linear-gradient(180deg,#ffffffc7,#eef2f5eb),#e8edf2}.chat-shell.embed{padding:0;background:transparent}.chat-window{width:min(430px,100%);height:min(780px,calc(100vh - 32px));display:grid;grid-template-rows:auto minmax(0,1fr) auto auto;border:1px solid rgba(15,23,42,.1);border-radius:18px;background:#ededed;box-shadow:0 22px 60px #0f172a2e;overflow:hidden}.embed .chat-window{width:100vw;height:100vh;border:0;border-radius:0;box-shadow:none}.chat-header{min-height:64px;display:flex;align-items:center;gap:10px;padding:10px 12px;padding-top:calc(10px + env(safe-area-inset-top));border-bottom:1px solid rgba(0,0,0,.06);background:#f7f7f7f5;-webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px)}.agent-avatar,.chat-avatar{display:grid;place-items:center;overflow:hidden;flex:0 0 auto;background:#07c160;color:#fff;font-weight:700}.header-avatar{width:42px;height:42px;border-radius:8px;box-shadow:0 4px 12px #07c16038}.agent-avatar img,.chat-avatar img{width:100%;height:100%;object-fit:cover}.header-main{flex:1;min-width:0}h1,p{margin:0}h1{max-width:100%;overflow:hidden;color:#111827;font-size:16px;font-weight:700;line-height:1.3;text-overflow:ellipsis;white-space:nowrap}.chat-header p{margin-top:3px;color:#697586;font-size:12px}.online:before,.offline:before{content:"";display:inline-block;width:7px;height:7px;margin-right:5px;border-radius:50%;background:#07c160}.offline:before{background:#f59e0b}.connection-state{max-width:78px;padding:4px 7px;border-radius:999px;overflow:hidden;color:#6b7280;background:#e5e7eb;font-size:11px;text-overflow:ellipsis;white-space:nowrap}.connection-state.connected{color:#047857;background:#07c16021}.connection-state.connecting{color:#92400e;background:#fef3c7}.connection-state.closed{color:#475569;background:#e2e8f0}.leave-shortcut{min-width:46px;height:30px;padding:0 10px;border:0;border-radius:999px;background:#07c160;color:#fff;font-size:12px;font-weight:600;cursor:pointer}.message-list{min-height:0;display:flex;flex-direction:column;gap:14px;padding:14px 12px 18px;overflow-x:hidden;overflow-y:auto;background:#ededed;overscroll-behavior:contain}.message-row{display:flex;align-items:flex-start;gap:8px}.message-row.me{flex-direction:row-reverse}.chat-avatar{width:36px;height:36px;border-radius:6px;background:#dbe4ee;color:#475569;font-size:13px}.message-row.me .chat-avatar{background:#07c160;color:#fff}.message-stack{display:grid;gap:4px;max-width:min(76%,300px)}.message-row.me .message-stack{justify-items:end}.message-time,.status{display:block;color:#8a94a3;font-size:11px;line-height:1.2}.bubble{position:relative;min-width:36px;padding:9px 11px;border-radius:5px;background:#fff;color:#111827;font-size:15px;line-height:1.55;word-break:break-word;box-shadow:0 1px 1px #0f172a0a}.bubble:before{content:"";position:absolute;top:12px;left:-5px;width:9px;height:9px;background:inherit;transform:rotate(45deg)}.message-row.me .bubble{background:#95ec69}.message-row.me .bubble:before{right:-5px;left:auto}.bubble p{margin:0}.status{margin-top:1px}.bubble .message-image{width:100px;max-width:100px;height:auto;display:block;border-radius:6px;cursor:zoom-in;object-fit:cover}.rich-message{line-height:1.6;word-break:break-word}.rich-message p,.rich-message div,.rich-message ul,.rich-message ol,.rich-message blockquote,.rich-message h1,.rich-message h2,.rich-message h3,.rich-message h4,.rich-message h5,.rich-message h6{margin:0 0 8px}.rich-message h1,.rich-message h2,.rich-message h3{font-size:16px}.rich-message ul,.rich-message ol{padding-left:20px}.rich-message img{width:min(180px,100%);height:auto;display:block;margin:8px 0;border-radius:7px;cursor:zoom-in}.rich-message a{color:#2563eb;text-decoration:none}.file-message{width:min(230px,70vw);min-height:64px;display:grid;grid-template-columns:42px minmax(0,1fr);column-gap:10px;align-items:center;color:inherit;text-decoration:none}.file-message .file-icon{width:42px;height:42px;grid-row:span 2;display:grid;place-items:center;border-radius:8px;background:#eef2f5;overflow:hidden}.file-message .file-icon img{width:28px;height:28px;object-fit:contain}.file-message strong,.file-message small{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.file-message strong{font-size:14px}.file-message small{color:#8a94a3;font-size:12px}.image-preview{position:fixed;inset:0;z-index:50;display:grid;place-items:center;padding:24px;background:#000000d1}.image-preview img{max-width:min(94vw,920px);max-height:86vh;border-radius:8px;box-shadow:0 22px 70px #0000006b}.preview-close{position:fixed;top:calc(14px + env(safe-area-inset-top));right:14px;width:38px;height:38px;padding:0;border:0;border-radius:50%;display:grid;place-items:center;background:#ffffffe6;color:#111827;font-size:24px;line-height:1}.leave-mask{position:fixed;inset:0;z-index:40;display:grid;align-items:end;padding:16px;background:#0f172a5c}.leave-dialog{width:min(430px,100%);margin:0 auto;display:grid;gap:12px;padding:16px;padding-bottom:calc(16px + env(safe-area-inset-bottom));border-radius:14px;background:#fff;box-shadow:0 24px 70px #0f172a3d}.leave-dialog-head,.leave-actions{display:flex;align-items:center;justify-content:space-between;gap:8px}.leave-dialog-head strong{display:block;color:#111827;font-size:17px}.leave-dialog-head span{display:block;margin-top:3px;color:#64748b;font-size:12px}.leave-dialog-head button{width:32px;height:32px;padding:0;border:0;border-radius:50%;background:#eef2f5;color:#475569;font-size:22px;line-height:1}.leave-form{display:grid;gap:9px}.leave-form input,.leave-form textarea{width:100%;border:1px solid #d9dee5;border-radius:8px;padding:10px 11px;outline:none;background:#f8fafc}.leave-form textarea{resize:vertical}.leave-actions button,.send-button,.icon-tool,.emoji-item{border:0;cursor:pointer}.leave-actions button{min-width:72px;padding:8px 12px;border-radius:6px;background:#07c160;color:#fff}.leave-actions .ghost{background:#eef2f5;color:#334155}.composer{position:relative;z-index:1;display:grid;gap:8px;padding:8px 10px;padding-bottom:calc(8px + env(safe-area-inset-bottom));border-top:1px solid rgba(0,0,0,.08);background:#f7f7f7}.emoji-panel{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:6px;padding:8px;border-radius:10px;background:#fff;box-shadow:inset 0 0 0 1px #0f172a0f}.tool-panel{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;padding:12px 8px 10px;border-radius:10px;background:#fff;box-shadow:inset 0 0 0 1px #0f172a0f}.tool-item{display:grid;justify-items:center;gap:6px;padding:0;border:0;background:transparent;color:#334155;cursor:pointer}.tool-icon{width:48px;height:48px;display:grid;place-items:center;border-radius:10px;background:#f8fafc;box-shadow:inset 0 0 0 1px #e2e8f0}.tool-icon img{width:30px;height:30px;object-fit:contain}.tool-item strong{font-size:12px;font-weight:500}.tool-item:disabled{opacity:.46;cursor:not-allowed}.emoji-item{height:34px;padding:0;border-radius:8px;background:#f8fafc;font-size:20px;line-height:1}.emoji-item:active{background:#e5e7eb}.input-row{display:flex;align-items:flex-end;gap:8px}.input-row textarea{min-width:0;min-height:38px;max-height:110px;flex:1;border:0;border-radius:5px;padding:9px 10px;outline:none;background:#fff;line-height:1.4;resize:none}.icon-tool{width:38px;height:38px;padding:0;border-radius:50%;display:grid;place-items:center;background:#e5e7eb;color:#334155;font-size:24px;line-height:1}.emoji-toggle{font-size:19px}.emoji-toggle.active{background:#07c16029;color:#047857}.add-toggle.active{background:#07c16029;color:#047857;transform:rotate(45deg)}.send-button{flex:0 0 auto;min-width:58px;height:38px;padding:0 12px;border-radius:5px;background:#07c160;color:#fff;font-size:14px;font-weight:600}.send-button:disabled,.icon-tool:disabled{cursor:not-allowed;opacity:.46}.file-input{display:none}@media(max-width:520px){.chat-shell{padding:0}.chat-window{width:100vw;height:100dvh;border:0;border-radius:0}.message-stack{max-width:calc(100vw - 104px)}}
